{
"model": "deepseek-v4.1-flash-1017",
"messages": [
{
"role": "user",
"content": "北京今天适合穿短袖吗?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "查询指定城市的当前天气与气温",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名,如 北京"
},
"unit": {
"type": "string",
"enum": [
"c",
"f"
],
"description": "温度单位"
}
},
"required": [
"city"
]
},
"strict": false
}
}
],
"tool_choice": "auto",
"parallel_tool_calls": false
}curl --location 'https://aipipe.vip/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"model": "deepseek-v4.1-flash-1017",
"messages": [
{
"role": "user",
"content": "北京今天适合穿短袖吗?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "查询指定城市的当前天气与气温",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名,如 北京"
},
"unit": {
"type": "string",
"enum": [
"c",
"f"
],
"description": "温度单位"
}
},
"required": [
"city"
]
},
"strict": false
}
}
],
"tool_choice": "auto",
"parallel_tool_calls": false
}'{
"choices": [
{
"finish_reason": "tool_calls",
"index": 0,
"logprobs": null,
"message": {
"content": "我来帮你查一下北京当前的天气。",
"reasoning_content": "The user asks whether Beijing is suitable for short sleeves today. I need to check weather.\n\nLet me call get_weather for Beijing.",
"role": "assistant",
"tool_calls": [
{
"function": {
"arguments": "{\"city\": \"北京\", \"unit\": \"c\"}",
"name": "get_weather"
},
"id": "call_00_pb7liyorbfxglli1tnyzklre",
"type": "function"
}
]
}
}
],
"created": 1796089859,
"id": "02179608985873207cd85838d5694bc24eebb4287275ea62c5698",
"model": "deepseek-v4-1-flash-261017",
"service_tier": "default",
"object": "chat.completion",
"usage": {
"completion_tokens": 89,
"prompt_tokens": 334,
"total_tokens": 423,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 27
}
}
}