openai_tool_calling{
"model": "{{model}}",
"messages": [
{
"role": "user",
"content": "Use the weather tool for Shenzhen."
}
],
"temperature": 0,
"max_tokens": 128,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
]
}
}
}
],
"tool_choice": {
"type": "function",
"function": {
"name": "get_weather"
}
}
}curl --location 'https://api.147ai.cn/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{api_key}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "{{model}}",
"messages": [
{
"role": "user",
"content": "Use the weather tool for Shenzhen."
}
],
"temperature": 0,
"max_tokens": 128,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
]
}
}
}
],
"tool_choice": {
"type": "function",
"function": {
"name": "get_weather"
}
}
}'{}