Authorization: Bearer ********************
top_p
但不是两者。temperature
但不是两者。{
"stream": false,
"messages": [
{
"role": "user",
"content": "北京今天天气怎么样"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location"
]
}
}
}
],
"max_tokens": 100,
"temperature": 0.8,
"model": "claude-3-5-sonnet-20241022"
}
curl --location --request POST '/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"stream": false,
"messages": [
{
"role": "user",
"content": "北京今天天气怎么样"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location"
]
}
}
}
],
"max_tokens": 100,
"temperature": 0.8,
"model": "claude-3-5-sonnet-20241022"
}'
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}