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      - Charm-Fantasy/0.12.2 (https://charm.land/fantasy)
21      - google-genai-sdk/1.49.0 gl-go/go1.26.1
22    url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse
23    method: POST
24  response:
25    proto: HTTP/2.0
26    proto_major: 2
27    proto_minor: 0
28    content_length: -1
29    body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"b\": 3,\"a\": 2}},\"thoughtSignature\": \"CloBvj72+4/aTlyeodvVsF6WQseQLaqynO0Ocu6hCxSIV1rJCGFv67dtpjtFqWaborKte+82ZXWG2DaoPZaL+k7ONU3tUVwUXH0yI3ADtb46NJAqGWp2V/Ht3uMKhQEBvj72+53r7rtJS2JS+RSr/gNHTgRy4DDPTPtEEj+K6F4GFNMQEXVmXPYPa87j/74GGwi14Qwvde1kfemWz/+cRwpf2EDDKELVYuZ56LWb6pmPj4kyXPBERjn3dCiTrAhaysdd21dD0/t3xSXCKNFbPTDjK6IeGzqAGRFeL5D37oKPrh2N\"},{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"a\": 2,\"b\": 3}}}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 121,\"candidatesTokenCount\": 36,\"totalTokenCount\": 195,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 121}],\"thoughtsTokenCount\": 38},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"XQCzaYWvIqfRz7IPupTlyAk\"}\r\n\r\n"
30    headers:
31      Content-Type:
32      - text/event-stream
33    status: 200 OK
34    code: 200
35    duration: 999.347125ms
36- id: 1
37  request:
38    proto: HTTP/1.1
39    proto_major: 1
40    proto_minor: 1
41    content_length: 1464
42    host: generativelanguage.googleapis.com
43    body: |
44      {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"},{"parts":[{"functionCall":{"args":{"a":2,"b":3},"id":"1","name":"add"},"thoughtSignature":"CloBvj72+4/aTlyeodvVsF6WQseQLaqynO0Ocu6hCxSIV1rJCGFv67dtpjtFqWaborKte+82ZXWG2DaoPZaL+k7ONU3tUVwUXH0yI3ADtb46NJAqGWp2V/Ht3uMKhQEBvj72+53r7rtJS2JS+RSr/gNHTgRy4DDPTPtEEj+K6F4GFNMQEXVmXPYPa87j/74GGwi14Qwvde1kfemWz/+cRwpf2EDDKELVYuZ56LWb6pmPj4kyXPBERjn3dCiTrAhaysdd21dD0/t3xSXCKNFbPTDjK6IeGzqAGRFeL5D37oKPrh2N"},{"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"}}]}]}
45    form:
46      alt:
47      - sse
48    headers:
49      Content-Type:
50      - application/json
51      User-Agent:
52      - Charm-Fantasy/0.12.2 (https://charm.land/fantasy)
53      - google-genai-sdk/1.49.0 gl-go/go1.26.1
54    url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse
55    method: POST
56  response:
57    proto: HTTP/2.0
58    proto_major: 2
59    proto_minor: 0
60    content_length: -1
61    body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The sum of \"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 218,\"candidatesTokenCount\": 3,\"totalTokenCount\": 221,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 218}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"XgCzaazDItHRz7IPmsmB4Qk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"2 and 3 is 5. The product of 2 and 3 is\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 218,\"candidatesTokenCount\": 20,\"totalTokenCount\": 238,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 218}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"XgCzaazDItHRz7IPmsmB4Qk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" 6.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 218,\"candidatesTokenCount\": 22,\"totalTokenCount\": 240,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 218}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"XgCzaazDItHRz7IPmsmB4Qk\"}\r\n\r\n"
62    headers:
63      Content-Type:
64      - text/event-stream
65    status: 200 OK
66    code: 200
67    duration: 737.114625ms