top_p
但不是两者。temperature
但不是两者。{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "Get the current weather in a given location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}
],
"tool_choice":{"type": "auto"},
"messages": [
{
"role": "user",
"content": "What is the weather like in San Francisco?"
}
]
}
curl --location --request POST 'https://api.302.ai/v1/messages' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "Get the current weather in a given location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}
],
"tool_choice":{"type": "auto"},
"messages": [
{
"role": "user",
"content": "What is the weather like in San Francisco?"
}
]
}'
{
"id": "msg_01QyXuu5DMbJWUN22Ys6Kvoh",
"type": "message",
"role": "assistant",
"model": "claude-3-5-sonnet-20240620",
"content": [
{
"type": "text",
"text": "Hello! How can I assist you today? Feel free to ask me any questions or let me know if you need help with anything."
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 10,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"output_tokens": 30
}
}