【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"
posted @ 2025-06-09 19:38  十三山入秋  阅读(51)  评论(1)    收藏  举报