{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Create a bar chart titled ''Quarterly Sales'' with data: Q1: 50000, Q2: 75000, Q3: 60000."
}
]
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "create_bar_chart",
"description": "Creates a bar chart given a title, labels, and corresponding values.",
"parameters": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The title for the chart."
},
"labels": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of labels for the data points (e.g., [''Q1'', ''Q2'', ''Q3''])."
},
"values": {
"type": "array",
"items": {
"type": "number"
},
"description": "List of numerical values corresponding to the labels (e.g., [50000, 75000, 60000])."
}
},
"required": [
"title",
"labels",
"values"
]
}
}
]
}
]
}
curl --location --request POST '/v1beta/models/:generateContent' \
--header 'x-goog-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Create a bar chart titled '\'''\''Quarterly Sales'\'''\'' with data: Q1: 50000, Q2: 75000, Q3: 60000."
}
]
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "create_bar_chart",
"description": "Creates a bar chart given a title, labels, and corresponding values.",
"parameters": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The title for the chart."
},
"labels": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of labels for the data points (e.g., ['\'''\''Q1'\'''\'', '\'''\''Q2'\'''\'', '\'''\''Q3'\'''\''])."
},
"values": {
"type": "array",
"items": {
"type": "number"
},
"description": "List of numerical values corresponding to the labels (e.g., [50000, 75000, 60000])."
}
},
"required": [
"title",
"labels",
"values"
]
}
}
]
}
]
}'
{
"candidates": [
{
"content": {
"parts": [
{
"functionCall": {
"name": "create_bar_chart",
"args": {
"values": [
50000,
75000,
60000
],
"labels": [
"Q1",
"Q2",
"Q3"
],
"title": "Quarterly Sales"
}
},
"thoughtSignature": "CrwCAVSoXO6EoYxWDOjmW0KWyjPe2NNq9fYcHQCpm9/TDtu7/AJwPoGS4YHi0S9XTEyJI38oqLlNAesf+qlI5EEBT52qRZ3kZUyuvg2RGaEs9HftvKjfXr428bcGKt5rQC+qgjE0siHzEHSbKLSEmdStS3qAoTQIY1RTuLYQoWtEjYee4trE9BSVY8Tco654BXd/TlO8aySPbuNqYF1m+0L49RpyPtkdwPCT+oBUhnM4OxlRlI69d68rAjtsWVCDPg2TdpElfRgO80W1qAWC/i1zyjHEyXZ84hG1cy7+z9d/Zk7z563eA6lonKVFYPQ8fKjaLqDrStOtNb7MPAduOkyZejPBo0N/XQFWwbswbH5nsL8kHxCkqE8MtFlLCLZWcS3iqZ9zl2vnxjITugb9IM9OdTXtQtNCstJMjuVw9Q=="
}
],
"role": "model"
},
"finishReason": "STOP",
"index": 0
}
],
"usageMetadata": {
"promptTokenCount": 181,
"candidatesTokenCount": 56,
"totalTokenCount": 335,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 181
}
],
"thoughtsTokenCount": 98
},
"modelVersion": "gemini-2.5-flash",
"responseId": "HuK6aLnJKq_mqtsPkZen8A0"
}