curl --location 'https://4sapi.com/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "hy3",
"messages": [
{
"role": "user",
"content": "深圳今天天气怎么样?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "获取指定城市的当前天气信息",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称,例如:北京"
}
},
"required": [
"city"
]
}
}
}
],
"tool_choice": "auto"
}'