{
"model": "hy3",
"messages": [
{
"role": "user",
"content": "深圳今天天气怎么样?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "获取指定城市的当前天气信息",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称,例如:北京"
}
},
"required": [
"city"
]
}
}
}
],
"tool_choice": "auto"
}curl --location '/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "hy3",
"messages": [
{
"role": "user",
"content": "深圳今天天气怎么样?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "获取指定城市的当前天气信息",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称,例如:北京"
}
},
"required": [
"city"
]
}
}
}
],
"tool_choice": "auto"
}'{
"Created": 0,
"Usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0
},
"Note": "string",
"Id": "string",
"Choices": [
{}
],
"ErrorMsg": {},
"SearchInfo": {},
"Replaces": [
{}
],
"RecommendedQuestions": [
"string"
],
"Processes": {},
"RequestId": "string"
}