本文档由 DataEyesAI 提供,专注于人工智能行业的API服务商! 扫码入群即可领取免费额度!
{
"model": "claude-3-5-sonnet-20241022",
"messages": [
{
"role": "user",
"content": "今天北京的天气怎么样?"
}
],
"tools": [
{
"name": "get_weather",
"description": "获取指定位置的当前天气",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "城市名称,如:北京"
}
},
"required": [
"location"
]
}
}
]
}curl --location --request POST 'https://api.dataeyes.ai/v1/messages' \
--header 'anthropic-version: 2023-06-01' \
--header 'Authorization: {{Authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "claude-3-5-sonnet-20241022",
"messages": [
{
"role": "user",
"content": "今天北京的天气怎么样?"
}
],
"tools": [
{
"name": "get_weather",
"description": "获取指定位置的当前天气",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "城市名称,如:北京"
}
},
"required": [
"location"
]
}
}
]
}'{
"content": [
{
"text": "我来帮您查询北京的天气情况。",
"type": "text"
},
{
"id": "toolu_012f3meaYuYj9yPPuyuRVw9U",
"input": {
"location": "北京"
},
"name": "get_weather",
"type": "tool_use"
}
],
"id": "msg_0195XjbG2FGZfN7Dqkd9kyyW",
"model": "claude-sonnet-4-20250514",
"role": "assistant",
"stop_reason": "tool_use",
"stop_sequence": null,
"type": "message",
"usage": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"input_tokens": 478,
"output_tokens": 71,
"service_tier": "standard"
}
}扫码加入开发者交流群
DataEysAI-专注于人工智能行业的API服务商! 扫码入群即可领取免费额度

扫码加群-领免费额度