multi_tool_streaming.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: 809
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. Always use both add and multiply at the same time."}],"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    form:
14      alt:
15      - sse
16    headers:
17      Content-Type:
18      - application/json
19      User-Agent:
20      - google-genai-sdk/1.33.0 gl-go/go1.25.0
21    url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse
22    method: POST
23  response:
24    proto: HTTP/2.0
25    proto_major: 2
26    proto_minor: 0
27    content_length: -1
28    body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"b\": 3,\"a\": 2}},\"thoughtSignature\": \"CikB0e2Kb/HMQc6i7UBRyFsYt3Py//kiN1i+ogTc09WPsRdhdlrPbqY0dQpYAdHtim8DpoYoaf6/9WaPOuM4ieoyrooxEGgr+rAl5vIIQ4mHHGPK3ES36kZb5fJGPx3mhtjks/+IGCakkpTqeVM5b8/uRyU+wFaI0KauqOwXHOhzt7euogp/AdHtim+wDPZH2rIZ9gMZsEEmpRPJB6D9vvfWb5DkLAc6lIG7AFW4Kzih+bkvgt96liwfadjYmkq/yepyTwMlArb+AA2NyudR0MgHxyh+l5BN/gxRZNmGhKfZprKbIPDiHstjnpJXZy136L25YwkcerUaVSUUi/bUUrScZW6IXQ==\"},{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"b\": 3,\"a\": 2}}}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 121,\"candidatesTokenCount\": 36,\"totalTokenCount\": 196,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 121}],\"thoughtsTokenCount\": 39},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"9gcJaf-cE-uJz7IPu5TY2QE\"}\r\n\r\n"
29    headers:
30      Content-Type:
31      - text/event-stream
32    status: 200 OK
33    code: 200
34    duration: 1.219170666s
35- id: 1
36  request:
37    proto: HTTP/1.1
38    proto_major: 1
39    proto_minor: 1
40    content_length: 1138
41    host: generativelanguage.googleapis.com
42    body: |
43      {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"},{"parts":[{"functionCall":{"args":{"a":2,"b":3},"id":"1","name":"add"}},{"functionCall":{"args":{"a":2,"b":3},"id":"2","name":"multiply"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"add","response":{"result":"5"}}},{"functionResponse":{"id":"2","name":"multiply","response":{"result":"6"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant. Always use both add and multiply at the same time."}],"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"}}]}]}
44    form:
45      alt:
46      - sse
47    headers:
48      Content-Type:
49      - application/json
50      User-Agent:
51      - google-genai-sdk/1.33.0 gl-go/go1.25.0
52    url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse
53    method: POST
54  response:
55    proto: HTTP/2.0
56    proto_major: 2
57    proto_minor: 0
58    content_length: -1
59    body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The sum\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 181,\"candidatesTokenCount\": 2,\"totalTokenCount\": 183,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 181}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"-AcJaaKMKLDhz7IPovKDoQc\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" of 2 and 3 is 5, and the product of 2 and\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 181,\"candidatesTokenCount\": 19,\"totalTokenCount\": 200,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 181}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"-AcJaaKMKLDhz7IPovKDoQc\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" 3 is 6.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 181,\"candidatesTokenCount\": 24,\"totalTokenCount\": 205,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 181}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"-AcJaaKMKLDhz7IPovKDoQc\"}\r\n\r\n"
60    headers:
61      Content-Type:
62      - text/event-stream
63    status: 200 OK
64    code: 200
65    duration: 1.700229875s