llm_call_tool
Last updated
# Use weather tool to get forecast
response = llm_call_tool(
"weather_agent",
messages=[
{"role": "user", "content": "What's the weather like in New York today?"}
],
tools=[{
"name": "weather_service/get_forecast",
"description": "Get weather forecast for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"},
"units": {"type": "string", "enum": ["metric", "imperial"]}
},
"required": ["location"]
}
}]
)
# Process the tool response
print(response["response"]["response_message"])