【function call & tools】
# function_call 是大模型返回的结构化格式(如 OpenAI 的 function calling / tool calling)
{
"function_call": {
"name": "get_weather",
"arguments": "{ \"location\": \"Shanghai\" }"
}
}
# tool 是系统注册的实际可执行函数(Python 函数、JS 方法等)
def get_weather(location):
return f"{location} 天气晴,25°C"

浙公网安备 33010602011771号