工具和函数调用
工具调用
ToolCall
用于表示工具调用的结构体,当大模型需要在生成过程中调用外部函数或插件时,会返回相应的工具调用信息:FunctionCall
描述,包含函数的详细信息。函数调用
FunctionCall
描述具体调用的函数 信息:常见用例
1.
send_email(to: string, body: string)
, get_current_weather(location: string, unit: 'celsius' | 'fahrenheit')
2.
get_customers(min_revenue: int, created_before: string, limit: int)
,然后调用你内部的 API3.
extract_data(name: string, birthday: string)
, sql_query(query: string)
函数调用的基本步骤
1.
functions
参数中定义你可用的函数列表。2.
3.
4.
修改于 2025-04-10 05:05:41