// The model recognized the intent and proposed a tool call with parameters
{
"id": "291c59ebf4017a937a2a42a8ed52581f.c2669ebc05a491c70f821b4e568b6433",
"object": "chat.completion",
"created": 1722505763,
"model": "step-5-preview",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "call_brg23SRcTgmpm_V0jfP-iA",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"city\": \" Shanghai \"}"
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"cached_tokens": 48,
"prompt_tokens": 94,
"completion_tokens": 16,
"total_tokens": 110
}
}
# Then call the weather API with those parameters and return the result
{
"status": "1",
"count": "1",
"info": "OK",
"infocode": "10000",
"lives": [
{
"province": "Shanghai",
"city": "Shanghai",
"adcode": "310000",
"weather": "Sunny",
"temperature": "37",
"winddirection": "NW",
"windpower": "≤3",
"humidity": "42",
"reporttime": "2024-08-02 10:01:14",
"temperature_float": "37.0",
"humidity_float": "42.0"
}
]
}
# Append the API result to messages as context and continue generation.