{
"model": "deepseek-v4.1-flash-1017",
"messages": [
{
"role": "user",
"content": "北京今天适合穿短袖吗?"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "call_001",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"city\":\"北京\",\"unit\":\"c\"}"
}
}
]
},
{
"role": "tool",
"tool_call_id": "call_001",
"content": "{\"city\":\"北京\",\"temp_c\":18,\"desc\":\"多云\"}"
}
],
"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"
}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": "北京今天适合穿短袖吗?"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "call_001",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"city\":\"北京\",\"unit\":\"c\"}"
}
}
]
},
{
"role": "tool",
"tool_call_id": "call_001",
"content": "{\"city\":\"北京\",\"temp_c\":18,\"desc\":\"多云\"}"
}
],
"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"
}'{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "北京现在 **18℃、多云**,光穿短袖偏凉了点。\n\n建议:\n- **不太推荐只穿短袖**——18℃ 有风或多云时体感会更低,早晚尤其凉。\n- 折中方案:短袖 + 一件薄外套/长袖衬衫,中午热了可以脱。\n- 如果怕冷或要在户外久待,穿长袖更稳妥。\n\n如果你白天大部分时间在户外活动、又比较怕热,短袖也是可以的,但最好带件外套备用。要不要我顺便看看今天的气温变化趋势或多天的天气?",
"reasoning_content": "Weather: 18°C, cloudy. Not really short-sleeve weather for most people — maybe light long sleeves.",
"role": "assistant"
}
}
],
"created": 1796090024,
"id": "52d712fd-3ed7-4691-85de-7b1053a9c312",
"model": "deepseek-v4.1-flash-1017",
"object": "chat.completion",
"usage": {
"prompt_tokens": 415,
"completion_tokens": 151,
"total_tokens": 566,
"prompt_tokens_details": {
"cached_tokens": 256
},
"completion_tokens_details": {
"reasoning_tokens": 25
}
}
}