curl --request POST \
--url https://api.foxapi.cc/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "杭州今天的天气适合出去玩吗?"
}
]
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "get_weather",
"description": "获取指定城市的当前天气信息",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
],
"description": "温度单位"
}
},
"required": [
"city"
]
}
}
]
}
]
}
'