main
py 21 lines 737 Bytes
Raw
1 from helpers.tool import Tool, Response
2
3 # this is an example tool class
4 # don't forget to include instructions in the system prompt by creating
5 # agent.system.tool.example_tool.md file in prompts directory of your agent
6 # see /python/tools folder for all default tools
7
8 class ExampleTool(Tool):
9 async def execute(self, **kwargs):
10
11 # parameters
12 test_input = kwargs.get("test_input", "")
13
14 # do something
15 print("Example tool executed with test_input: " + test_input)
16
17 # return response
18 return Response(
19 message="This is an example tool response, test_input: " + test_input, # response for the agent
20 break_loop=False, # stop the message chain if true
21 )