import json
def call_model_with_tools(user_query, available_tools):
# A tool-calling model outputs a structured call instead of free text.
return {"tool": "search", "arguments": {"query": user_query}}
tools = [{"name": "search", "parameters": {"query": "string"}}]
call = call_model_with_tools("current weather in Tokyo", tools)
print(json.dumps(call, indent=2)){
"tool": "search",
"arguments": {
"query": "current weather in Tokyo"
}
}