multi_tool.yaml

  1---
  2version: 2
  3interactions:
  4- id: 0
  5  request:
  6    proto: HTTP/1.1
  7    proto_major: 1
  8    proto_minor: 1
  9    content_length: 826
 10    host: generativelanguage.googleapis.com
 11    body: |
 12      {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS."}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Add two numbers","name":"add","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Multiply two numbers","name":"multiply","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}}]}]}
 13    headers:
 14      Content-Type:
 15      - application/json
 16      User-Agent:
 17      - google-genai-sdk/1.23.0 gl-go/go1.25.1
 18    url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
 19    method: POST
 20  response:
 21    proto: HTTP/2.0
 22    proto_major: 2
 23    proto_minor: 0
 24    content_length: -1
 25    uncompressed: true
 26    body: |
 27      {
 28        "candidates": [
 29          {
 30            "content": {
 31              "parts": [
 32                {
 33                  "functionCall": {
 34                    "name": "add",
 35                    "args": {
 36                      "a": 2,
 37                      "b": 3
 38                    }
 39                  },
 40                  "thoughtSignature": "Cr4BAdHtim9LvttVUIQ0QpEtexErSfMWokWFxdJCGfdh4M6N0YBwqI+kBhIbVJOwQonI1GmBaw8lfUzjvYYW2ScSRvYAUJoBWMRuLzcaafC/2FnOcLPR9hyaC9499fBWocLFbnCRO/0bzA+Z4uAS81EL/zTqCsZuO5OS5KwvLe9OIbPXrMc65pKhED6D80UaJe9+9OfeIKsTf53yxXUk7elFlA//EukpULLiadHrHKMVFu9FKnHwFBQ+BsY9lALcSg=="
 41                },
 42                {
 43                  "functionCall": {
 44                    "name": "multiply",
 45                    "args": {
 46                      "a": 2,
 47                      "b": 3
 48                    }
 49                  }
 50                }
 51              ],
 52              "role": "model"
 53            },
 54            "finishReason": "STOP",
 55            "index": 0
 56          }
 57        ],
 58        "usageMetadata": {
 59          "promptTokenCount": 125,
 60          "candidatesTokenCount": 36,
 61          "totalTokenCount": 200,
 62          "promptTokensDetails": [
 63            {
 64              "modality": "TEXT",
 65              "tokenCount": 125
 66            }
 67          ],
 68          "thoughtsTokenCount": 39
 69        },
 70        "modelVersion": "gemini-2.5-flash",
 71        "responseId": "53LWaN-ZF8_l7M8Pt4CxmQE"
 72      }
 73    headers:
 74      Content-Type:
 75      - application/json; charset=UTF-8
 76    status: 200 OK
 77    code: 200
 78    duration: 1.153815667s
 79- id: 1
 80  request:
 81    proto: HTTP/1.1
 82    proto_major: 1
 83    proto_minor: 1
 84    content_length: 1173
 85    host: generativelanguage.googleapis.com
 86    body: |
 87      {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"},{"parts":[{"functionCall":{"args":{"a":2,"b":3},"id":"add","name":"add"}},{"functionCall":{"args":{"a":2,"b":3},"id":"multiply","name":"multiply"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"add","name":"add","response":{"result":"5"}}},{"functionResponse":{"id":"multiply","name":"multiply","response":{"result":"6"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS."}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Add two numbers","name":"add","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Multiply two numbers","name":"multiply","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}}]}]}
 88    headers:
 89      Content-Type:
 90      - application/json
 91      User-Agent:
 92      - google-genai-sdk/1.23.0 gl-go/go1.25.1
 93    url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
 94    method: POST
 95  response:
 96    proto: HTTP/2.0
 97    proto_major: 2
 98    proto_minor: 0
 99    content_length: -1
100    uncompressed: true
101    body: |
102      {
103        "candidates": [
104          {
105            "content": {
106              "parts": [
107                {
108                  "text": "The sum of 2 and 3 is 5. The product of 2 and 3 is 6."
109                }
110              ],
111              "role": "model"
112            },
113            "finishReason": "STOP",
114            "index": 0
115          }
116        ],
117        "usageMetadata": {
118          "promptTokenCount": 185,
119          "candidatesTokenCount": 24,
120          "totalTokenCount": 209,
121          "promptTokensDetails": [
122            {
123              "modality": "TEXT",
124              "tokenCount": 185
125            }
126          ]
127        },
128        "modelVersion": "gemini-2.5-flash",
129        "responseId": "53LWaPLjL-Li7M8P1p-bsAs"
130      }
131    headers:
132      Content-Type:
133      - application/json; charset=UTF-8
134    status: 200 OK
135    code: 200
136    duration: 401.486666ms