{
"system_instruction": {
"parts": [
{
"text": "You are a helpful lighting system bot. You can turn lights on and off, and you can set the color. Do not perform any other tasks."
}
]
},
"tools": [
{
"function_declarations": [
{
"name": "enable_lights",
"description": "Turn on the lighting system."
},
{
"name": "set_light_color",
"description": "Set the light color. Lights must be enabled for this to work.",
"parameters": {
"type": "object",
"properties": {
"rgb_hex": {
"type": "string",
"description": "The light color as a 6-digit hex string, e.g. ff0000 for red."
}
},
"required": [
"rgb_hex"
]
}
},
{
"name": "stop_lights",
"description": "Turn off the lighting system."
}
]
}
],
"tool_config": {
"function_calling_config": {
"mode": "auto"
}
},
"contents": [
{
"role": "user",
"parts": [
{
"text": "Turn on the lights please."
}
]
}
]
}curl --location -g --request POST 'http://api.example.com/v1beta/models/gemini-2.5-flash:generateContent?key=sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"system_instruction": {
"parts": [
{
"text": "You are a helpful lighting system bot. You can turn lights on and off, and you can set the color. Do not perform any other tasks."
}
]
},
"tools": [
{
"function_declarations": [
{
"name": "enable_lights",
"description": "Turn on the lighting system."
},
{
"name": "set_light_color",
"description": "Set the light color. Lights must be enabled for this to work.",
"parameters": {
"type": "object",
"properties": {
"rgb_hex": {
"type": "string",
"description": "The light color as a 6-digit hex string, e.g. ff0000 for red."
}
},
"required": [
"rgb_hex"
]
}
},
{
"name": "stop_lights",
"description": "Turn off the lighting system."
}
]
}
],
"tool_config": {
"function_calling_config": {
"mode": "auto"
}
},
"contents": [
{
"role": "user",
"parts": [
{
"text": "Turn on the lights please."
}
]
}
]
}'{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"functionCall": {
"name": "enable_lights",
"args": {}
},
"thoughtSignature": "CpwBAePx/177Vlhuj0psYC3riGeT4MRwg9aaKRfmOneE43rc5mTuqPD+2fNoSde04iMifAICMuW8GUyLgH8Yh2Bf0lGty9N3kafJgAwHE4oH05/tqHEw8kqHmEOb825Ktz7MIh9n+aYJzLuyGdel3PRUcM6Fd58wBoowBHDJtVFIHyZTYArxWWqK/9KkpKL+VGh4HZCn/ngXckVQK3na"
}
]
},
"finishReason": "STOP",
"avgLogprobs": -0.78177380561828613
}
],
"usageMetadata": {
"promptTokenCount": 75,
"candidatesTokenCount": 3,
"totalTokenCount": 107,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 75
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"thoughtsTokenCount": 29
},
"modelVersion": "gemini-2.5-flash",
"createTime": "2025-11-29T15:25:23.292666Z",
"responseId": "YxArabruEfO24_UP9PW30QQ"
}