{
"model": "MiniMax-M3",
"messages": [
{
"role": "user",
"content": "旧金山现在天气怎么样?"
}
],
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state/country, e.g. San Francisco, US"
}
},
"required": [
"location"
]
},
"description": "Get the current weather for a given location."
}
],
"tool_choice": {
"type": "auto"
}
}curl --location '/v1/messages' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-M3",
"messages": [
{
"role": "user",
"content": "旧金山现在天气怎么样?"
}
],
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state/country, e.g. San Francisco, US"
}
},
"required": [
"location"
]
},
"description": "Get the current weather for a given location."
}
],
"tool_choice": {
"type": "auto"
}
}'{
"id": "066b13de1224099141792cd806ed4f56",
"type": "message",
"role": "assistant",
"model": "MiniMax-M3",
"content": [
{
"thinking": "The user is asking about the current weather in San Francisco. I should use the get_weather tool to fetch this information. The location parameter requires city and state/country format, so \"San Francisco, US\" would be appropriate.",
"signature": "ca8010ef1c5606561a17158c090bd20f33a8a8ac5f3b6cfb4326408395cbff39",
"type": "thinking"
},
{
"type": "tool_use",
"id": "call_function_debp7sfnk20c_1",
"name": "get_weather",
"input": {
"location": "San Francisco, US"
}
}
],
"usage": {
"input_tokens": 14,
"output_tokens": 79,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 397
},
"stop_reason": "tool_use"
}