curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-5-mini",
"messages": [
{
"role": "system",
"content": "你是一个乐于助人的客户服务助理,请使用提供的工具来协助用户。"
},
{
"role": "user",
"content": "你好,杭州今天的天气怎么样?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "获取给定地区的天气信息",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "城市或者地区,如浙江杭州"
},
"unit": {
"type": "string",
"enum": ["℃","℉"]
}
},
"required": [
"location"
]
}
}
}
],
"tool_choice": "auto"
}'