An Action taken by Agent can involve use of multiple Tools to complete
Examples of Tools
Web Search
Image Generation
Retrieval
API interface
A Tool should contain
Textual description of function
Callable
Arguments with typings
Outputs with typings
@tool decorator automatically provides a to_string() method which provides all this info
@tooldef calculator(a: int, b: int) -> int: """Multiply two integers.""" return a * bprint(calculator.to_string())# Tool Name: calculator, Description: Multiply two integers., Arguments: a: int, b: int, Outputs: int
This description is injected in the system prompt
system_message="""You are an AI assistant designed to help users efficiently and accurately. Your primary goal is to provide helpful, precise, and clear responses.You have access to the following tools:Tool Name: calculator, Description: Multiply two integers., Arguments: a: int, b: int, Outputs: int"""
Thought-Action-Observation cycle
Agent follows continuous cycle of:
Thought: The LLM part of the Agent decides what the next step should be.
Action: The agent takes an action by calling the tools with the associated arguments.
Observation: The model reflects on the response from the tool.
Agent frameworks inject this in system prompt
system_message="""You are an AI assistant designed to help users efficiently and accurately. Your primary goal is to provide helpful, precise, and clear responses.You have access to the following tools:Tool Name: calculator, Description: Multiply two integers., Arguments: a: int, b: int, Outputs: intYou should think step by step in order to fulfill the objective with a reasoning divided into Thought/Action/Observation steps that can be repeated multiple times if needed.You should first reflect on the current situation using 'Thought: {your_thoughts}', then (if necessary), call a tool with the proper JSON formatting 'Action: {JSON_BLOB}', or print your final answer starting with the prefix 'Final Answer:'"""