diff --git a/providertests/google_test.go b/providertests/google_test.go index 50c19501f568c2e85725e9177555929c6687ff0f..d49e13a2afb440825a97aa8bd80ecf8df831a2d5 100644 --- a/providertests/google_test.go +++ b/providertests/google_test.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "os" + "strings" "testing" "charm.land/fantasy" @@ -37,7 +38,7 @@ func TestGoogleCommon(t *testing.T) { } func TestGoogleThinking(t *testing.T) { - opts := fantasy.ProviderOptions{ + gemini2Opts := fantasy.ProviderOptions{ google.Name: &google.ProviderOptions{ ThinkingConfig: &google.ThinkingConfig{ ThinkingBudget: fantasy.Opt(int64(100)), @@ -45,19 +46,7 @@ func TestGoogleThinking(t *testing.T) { }, }, } - - var pairs []builderPair - for _, m := range geminiTestModels { - if !m.reasoning { - continue - } - pairs = append(pairs, builderPair{m.name, geminiBuilder(m.model), opts, nil}) - } - testThinking(t, pairs, testGoogleThinking) -} - -func TestGoogleThinkingLevel(t *testing.T) { - opts := fantasy.ProviderOptions{ + gemini3Opts := fantasy.ProviderOptions{ google.Name: &google.ProviderOptions{ ThinkingConfig: &google.ThinkingConfig{ ThinkingLevel: fantasy.Opt(google.ThinkingLevelHigh), @@ -71,6 +60,10 @@ func TestGoogleThinkingLevel(t *testing.T) { if !m.reasoning { continue } + opts := gemini3Opts + if strings.HasPrefix(m.model, "gemini-2") { + opts = gemini2Opts + } pairs = append(pairs, builderPair{m.name, geminiBuilder(m.model), opts, nil}) } testThinking(t, pairs, testGoogleThinking) diff --git a/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking-streaming.yaml b/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking-streaming.yaml index bf96a0f089dea40bc8a95a1b9ce41e1b0c0b61fd..1c582a472e4a32aa34254890e3236034c0b4413f 100644 --- a/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking-streaming.yaml +++ b/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking-streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse method: POST response: @@ -25,22 +25,22 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"**Retrieving Weather Data**\\n\\nI've determined that the user is requesting weather information for Florence, Italy. The appropriate course of action is to utilize the 'weather' tool, specifically setting the 'location' parameter to \\\"Florence, Italy\\\". I am now ready to invoke the tool.\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 54,\"totalTokenCount\": 118,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 64},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"pKIdaeGWJZfOvdIPsNOE0Qk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiQB0e2Kb6BrFiQflb8Sv1fcJ7NAjomD8XzlmWVURMpiVruMgccKYwHR7YpvMnA7YUpMDw7SFo5/T4+Uu75O9TYeVgbxgbO67DG9hZwNJLKKnFjPUTk4KGwgj6xf2mBF48mB00qcBcTNldnnBqvW5d2OJ84gU8nDk03GfVW1err5sbF0ybD2ctjViArnAQHR7YpvHOuUFZzPOv5jO60KyvuXQXD+auw8/ZTTDF+GqgDsx2piCvMdPlQJ4pplwwwq2nAKv8k5Y1rLLcDFbKmaIVMJJwisEbJ5gDLDpDN5IRF6u7BlnXLkATjvKcF5OoDy2Se8IhA5Y26u53m5popZI7v+mswAT49iYnmrBk1UcTsDV7EK2WlebVi6URJwncZbsmfgNCZBDn5LygjopGZC4Md0t/9zC+H109Pv8ByVhhLdq5YCVf5wCzVjvjRSs4/t1MCPFzmxmu+fwQcIY/k+Rxpp706fFrNzCmMOoJCraC83Qb5B7Q==\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 14,\"totalTokenCount\": 132,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 64},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"pKIdaeGWJZfOvdIPsNOE0Qk\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"**Determining Weather Location**\\n\\nI've determined I need the weather information for \\\"Florence, Italy.\\\" To get this, I will use the \\\"weather\\\" tool. It takes a \\\"location\\\" argument. My next action is to call the tool with \\\"Florence, Italy\\\" specified as the location.\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 54,\"totalTokenCount\": 106,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 52},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"e_-dafyqMbqCz7IPtZzw-Qw\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiQBvj72+xhpHSwaiE2z4k0+iM8cB8J/EDqbIhEs4R2d7FlQ0YkKYwG+Pvb70y4a04+KpbQReMlGpMk8CIUXVwr3i6DFALjGemIj+6m5L1K7kWfW0L2lWOCZStD5f5i4XQfMqyY+3/29VksqkB18v/YWUtWH8mtovWgnRl5eVgnjYai6z4sSr7eqBQrCAQG+Pvb7ISCCctl/xvb5jVVLz9GObHzP+VhteNwg2cybmJVmHm7fw9PE1e4BYg+Sxd5BB9pM4PQ664DV79ulddpRzh6+WRdXinfuDY4Gmo9CFW00eYd0SpqJZpJHdm4wzJmjT5rVaXALITgmUz//P4+M4ZFhRnx8vA539uw8ZKP+IunUvCrqo2OHBgMUybPUBZSlM8diOo4AxHGMdUQlGdsbF8aHawGYgTaUO9tim3VvJSTQnygjwVMKTh1Mjl8b12JC\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 14,\"totalTokenCount\": 120,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 52},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"e_-dafyqMbqCz7IPtZzw-Qw\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.213771542s + duration: 1.475852417s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1286 + content_length: 1234 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CiQB0e2Kb6BrFiQflb8Sv1fcJ7NAjomD8XzlmWVURMpiVruMgccKYwHR7YpvMnA7YUpMDw7SFo5/T4+Uu75O9TYeVgbxgbO67DG9hZwNJLKKnFjPUTk4KGwgj6xf2mBF48mB00qcBcTNldnnBqvW5d2OJ84gU8nDk03GfVW1err5sbF0ybD2ctjViArnAQHR7YpvHOuUFZzPOv5jO60KyvuXQXD+auw8/ZTTDF+GqgDsx2piCvMdPlQJ4pplwwwq2nAKv8k5Y1rLLcDFbKmaIVMJJwisEbJ5gDLDpDN5IRF6u7BlnXLkATjvKcF5OoDy2Se8IhA5Y26u53m5popZI7v+mswAT49iYnmrBk1UcTsDV7EK2WlebVi6URJwncZbsmfgNCZBDn5LygjopGZC4Md0t/9zC+H109Pv8ByVhhLdq5YCVf5wCzVjvjRSs4/t1MCPFzmxmu+fwQcIY/k+Rxpp706fFrNzCmMOoJCraC83Qb5B7Q=="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CiQBvj72+xhpHSwaiE2z4k0+iM8cB8J/EDqbIhEs4R2d7FlQ0YkKYwG+Pvb70y4a04+KpbQReMlGpMk8CIUXVwr3i6DFALjGemIj+6m5L1K7kWfW0L2lWOCZStD5f5i4XQfMqyY+3/29VksqkB18v/YWUtWH8mtovWgnRl5eVgnjYai6z4sSr7eqBQrCAQG+Pvb7ISCCctl/xvb5jVVLz9GObHzP+VhteNwg2cybmJVmHm7fw9PE1e4BYg+Sxd5BB9pM4PQ664DV79ulddpRzh6+WRdXinfuDY4Gmo9CFW00eYd0SpqJZpJHdm4wzJmjT5rVaXALITgmUz//P4+M4ZFhRnx8vA539uw8ZKP+IunUvCrqo2OHBgMUybPUBZSlM8diOo4AxHGMdUQlGdsbF8aHawGYgTaUO9tim3VvJSTQnygjwVMKTh1Mjl8b12JC"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse method: POST response: @@ -56,10 +56,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The weather in Florence\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 146,\"candidatesTokenCount\": 4,\"totalTokenCount\": 150,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 146}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"pqIdabTFPLDTxN8Pj8DlmQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 C.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 146,\"candidatesTokenCount\": 12,\"totalTokenCount\": 158,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 146}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"pqIdabTFPLDTxN8Pj8DlmQk\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The weather in Florence\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 136,\"candidatesTokenCount\": 4,\"totalTokenCount\": 140,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 136}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"ff-dabnuEdadz7IP5KOCgAI\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 C.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 136,\"candidatesTokenCount\": 12,\"totalTokenCount\": 148,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 136}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"ff-dabnuEdadz7IP5KOCgAI\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.488522583s + duration: 818.421583ms diff --git a/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking.yaml b/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking.yaml index 0eb5727e17f7cde8e29fcce8ae6ac344d2ed693d..efd084aec4e30ffdcb0b11fec6bfa0430c7ffc10 100644 --- a/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking.yaml +++ b/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "**Weather Inquiry: Florence, Italy**\n\nOkay, so the user wants to know the weather. Seems straightforward enough. They've specified \"Florence, Italy,\" which is great, because I need a location to work with. Fortunately, I have a \"weather\" tool at my disposal, and it appears it's designed to take a `location` as input. Therefore, my next step is clear: I'll use the \"weather\" tool, feeding it \"Florence, Italy\" as the `location` parameter. That should give me the weather information the user is after.\n", + "text": "Okay, here's my thought process regarding the user's request:\n\n**Analyzing the Query: Florence Weather**\n\nAlright, I see the user wants the weather for Florence, Italy. That's straightforward. The key here is the tool I have access to – the `weather` tool. I know this tool is designed for precisely this kind of query. Crucially, the tool documentation says it requires a `location` argument. So, my task is to parse the user's request and feed that location information to the tool. It's a classic input-process-output situation. The \"input\" is Florence, Italy, or at least, that's what I'll be using for the query, and the \"process\" is to send it to the weather tool with the location parameter. I'm ready to query!\n", "thought": true }, { @@ -40,7 +40,7 @@ interactions: "location": "Florence, Italy" } }, - "thoughtSignature": "CvYBAdHtim9qsdgUovUUbgAa9oML5LNXaG6UCnPcGzw1zOO0g3lKC3BMnvd5uNr1Dbu4iv/D1RFKhdpNvKq36C4OgfmARWRVkb6SCFEB2HliZgcq0eH24m1h1Wc3TgGsGNTm4Ppy61sth++CxfYNEZLnw+7xD/VhRMJn5a6/faKS4+MGzsH63NHx0DYdfpFpMytkoCa551Aunb8VOPy9KG2auvUT5KfWqf32mrjbeRhe3ngFDM7gBzYq/1AiVyQVluHSlvmHQ738klIpV7rZelCWzr+QgcPrc+T2MjHoXFtQQ5W24CHqHdW+ViYmcgpQT7QIM/1qCohh" + "thoughtSignature": "CoACAb4+9vsBHFxHrQuonIUfSR6Nm17lrRyUzuM6N/Hcp+/BSAONP0z+zhyo4cp6LNYfVevZZJjYIbDZrdqY/Quk9hwF1CaGnxmSMl5S6MbEYyIyNckE7tHMcNMJu3ODw37XOzCltw40lrTQvZmvkSrmMy9+X45L0RXDOJf9mYy9V3BCwPBoFK5uJr+BsaXb/DAbbFoPJXKuN++xTywS1smdJRB8YcVq/oGdbgB8RY0+/2EfNWrHipiSq06vjvwuXyCJFdziEtsxWNqv3GvqCv+M7BfE3P3EXCRbiNfDmfLjilifRs1Xw12rK7wC9TMUS7b52d/k/Js/StKn1ww8CtRffA==" } ], "role": "model" @@ -63,28 +63,28 @@ interactions: "thoughtsTokenCount": 51 }, "modelVersion": "gemini-2.5-flash", - "responseId": "o6Idaab7Kdj9xN8PsaeMoAU" + "responseId": "eP-dacvXLKScz7IP_bysiAI" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.776984417s + duration: 2.312526792s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1118 + content_length: 1134 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CvYBAdHtim9qsdgUovUUbgAa9oML5LNXaG6UCnPcGzw1zOO0g3lKC3BMnvd5uNr1Dbu4iv/D1RFKhdpNvKq36C4OgfmARWRVkb6SCFEB2HliZgcq0eH24m1h1Wc3TgGsGNTm4Ppy61sth++CxfYNEZLnw+7xD/VhRMJn5a6/faKS4+MGzsH63NHx0DYdfpFpMytkoCa551Aunb8VOPy9KG2auvUT5KfWqf32mrjbeRhe3ngFDM7gBzYq/1AiVyQVluHSlvmHQ738klIpV7rZelCWzr+QgcPrc+T2MjHoXFtQQ5W24CHqHdW+ViYmcgpQT7QIM/1qCohh"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CoACAb4+9vsBHFxHrQuonIUfSR6Nm17lrRyUzuM6N/Hcp+/BSAONP0z+zhyo4cp6LNYfVevZZJjYIbDZrdqY/Quk9hwF1CaGnxmSMl5S6MbEYyIyNckE7tHMcNMJu3ODw37XOzCltw40lrTQvZmvkSrmMy9+X45L0RXDOJf9mYy9V3BCwPBoFK5uJr+BsaXb/DAbbFoPJXKuN++xTywS1smdJRB8YcVq/oGdbgB8RY0+/2EfNWrHipiSq06vjvwuXyCJFdziEtsxWNqv3GvqCv+M7BfE3P3EXCRbiNfDmfLjilifRs1Xw12rK7wC9TMUS7b52d/k/Js/StKn1ww8CtRffA=="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -121,11 +121,11 @@ interactions: ] }, "modelVersion": "gemini-2.5-flash", - "responseId": "pKIdafytEKa_vdIPwLzvqQk" + "responseId": "e_-daeLyAsDhz7IPvpGWmQ0" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 586.682167ms + duration: 759.335917ms diff --git a/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking-streaming.yaml b/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking-streaming.yaml index e5122d3c1316d393f5bccd9416190576ba23d824..b83d18c074c6b94608e70279d5463178f3cea970 100644 --- a/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking-streaming.yaml +++ b/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking-streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse method: POST response: @@ -25,22 +25,22 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"**Analyzing Weather Request**\\n\\nI've determined the user is asking for the weather. I've successfully mapped the request to the `weather.get_weather` function. I identified the necessary parameter, `location`, and extracted \\\"Florence, Italy\\\" from the user's input. The core functionality is identified, and the primary data point has been found.\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 54,\"totalTokenCount\": 118,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 64},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"raIdadC2Ley2vdIP_Yq5mQ4\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiIB0e2Kbxjem07JhW18mjM77Q1xAYo6atiTkGnnNaxM6ib5CmcB0e2Kb8IL4bFjiMiDFPUGlfIvUEbRd27l5H14zwW5CEN4jNHSGzGZNldVdmTXMTk+kVlnHncEUaUDL0EuxMc4QFav16fm0Depm9wGyQqGhDSeMQK3QRtAXrimzFT7dCVo3cpA41hwCoABAdHtim9KVkD8CchpZ2W0MEreLCMRm4a4lg5Oien3mEVKAKevqyVEaTH1daHzyHeNLRFqndWwyzYwht6GRlrPjwh56xL1cjZr1RHq+VFop1r/vi44DZpwItRdyydsS/Ya1NTUOAa2ExgLbZmflaNaFAeTfh2mjxhb3jIRjnhu+UAKbwHR7Ypvt9f5xttbSFKScgccrciYxBZaMzYPeYU/Sj7G0VOfQHkWeleXr/1S9L6CK9+OtCElAt+2gPdVTd/p1BzGrPjMwuyCT4d8YZIKOMwoqE75n6cDYN7Mdy3Cd7NtakmsmVztqqn5hA2wCcRnMw==\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 14,\"totalTokenCount\": 132,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 64},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"raIdadC2Ley2vdIP_Yq5mQ4\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"**Mapping the Request**\\n\\nI've successfully mapped the user's weather request for \\\"Florence, Italy\\\" to the `weather.get_weather` function. I've also identified the necessary parameter, `location`, and determined its value should be \\\"Florence, Italy.\\\" I'm proceeding to the next logical step.\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 54,\"totalTokenCount\": 118,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 64},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"g_-dad7bAqrVz7IP-de64Ag\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiIBvj72+xPAl4QAfiyiRNjOwQZuUww0ylKAdQZTMNWmXT8aCmcBvj72+z20MdGWkjvpvQq0E3VDMDkiuWpOdKUckkZi4z5L3zpJ8Uzi+5wTqtP3bFLTWoGEcZynphYSNOm/BL7Rs/b2dwtPnvV5K1spNtUdXkA2U+zf5WED6ewfHXf4KplcfsGaLzMjCoYBAb4+9vvGhZgA1rF9408TNbD9AScCFJ68tsgkt0NU2bJbHZlGfASQr/LkM+vzpLSIKpRYbdIqoi/1JTcdsTbW/mJJ2jk6LQ2cQ7qznXfGBreudI0jQPKbrIvwYDBs4GoM7+5wCIvuKoXX0KSJfg7bpk9CffKFbPjSFbVopU1XvEnQVVHY7C4KcAG+Pvb7iqruwYdznTRkMrOob04XRBlOeOKtJC8S6NGf+TjlZ1d9l6zUnT9bCklqOclTLWivcNtacnNY0z8sOXrcRy3p/2VnAiKXhPQTdfPs0oMGK+cJQJN2RUcXBBSj38JfTf5tg/ANMYIVsUC7EFE=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 14,\"totalTokenCount\": 132,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 64},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"g_-dad7bAqrVz7IP-de64Ag\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 3.008202292s + duration: 2.388863542s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1302 + content_length: 1310 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CiIB0e2Kbxjem07JhW18mjM77Q1xAYo6atiTkGnnNaxM6ib5CmcB0e2Kb8IL4bFjiMiDFPUGlfIvUEbRd27l5H14zwW5CEN4jNHSGzGZNldVdmTXMTk+kVlnHncEUaUDL0EuxMc4QFav16fm0Depm9wGyQqGhDSeMQK3QRtAXrimzFT7dCVo3cpA41hwCoABAdHtim9KVkD8CchpZ2W0MEreLCMRm4a4lg5Oien3mEVKAKevqyVEaTH1daHzyHeNLRFqndWwyzYwht6GRlrPjwh56xL1cjZr1RHq+VFop1r/vi44DZpwItRdyydsS/Ya1NTUOAa2ExgLbZmflaNaFAeTfh2mjxhb3jIRjnhu+UAKbwHR7Ypvt9f5xttbSFKScgccrciYxBZaMzYPeYU/Sj7G0VOfQHkWeleXr/1S9L6CK9+OtCElAt+2gPdVTd/p1BzGrPjMwuyCT4d8YZIKOMwoqE75n6cDYN7Mdy3Cd7NtakmsmVztqqn5hA2wCcRnMw=="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CiIBvj72+xPAl4QAfiyiRNjOwQZuUww0ylKAdQZTMNWmXT8aCmcBvj72+z20MdGWkjvpvQq0E3VDMDkiuWpOdKUckkZi4z5L3zpJ8Uzi+5wTqtP3bFLTWoGEcZynphYSNOm/BL7Rs/b2dwtPnvV5K1spNtUdXkA2U+zf5WED6ewfHXf4KplcfsGaLzMjCoYBAb4+9vvGhZgA1rF9408TNbD9AScCFJ68tsgkt0NU2bJbHZlGfASQr/LkM+vzpLSIKpRYbdIqoi/1JTcdsTbW/mJJ2jk6LQ2cQ7qznXfGBreudI0jQPKbrIvwYDBs4GoM7+5wCIvuKoXX0KSJfg7bpk9CffKFbPjSFbVopU1XvEnQVVHY7C4KcAG+Pvb7iqruwYdznTRkMrOob04XRBlOeOKtJC8S6NGf+TjlZ1d9l6zUnT9bCklqOclTLWivcNtacnNY0z8sOXrcRy3p/2VnAiKXhPQTdfPs0oMGK+cJQJN2RUcXBBSj38JfTf5tg/ANMYIVsUC7EFE="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse method: POST response: @@ -56,10 +56,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The weather in Florence\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 146,\"candidatesTokenCount\": 4,\"totalTokenCount\": 150,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 146}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"sKIdae6vLf_WvdIPm53psAk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 C. \\n\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 146,\"candidatesTokenCount\": 12,\"totalTokenCount\": 158,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 146}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"sKIdae6vLf_WvdIPm53psAk\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"It\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 148,\"candidatesTokenCount\": 1,\"totalTokenCount\": 149,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 148}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"hf-daabsHZqsz7IPxKKgiAk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"'s 40 C in Florence, Italy. \\n\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 148,\"candidatesTokenCount\": 12,\"totalTokenCount\": 160,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 148}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"hf-daabsHZqsz7IPxKKgiAk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.696688208s + duration: 1.252537292s diff --git a/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking.yaml b/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking.yaml index 1237887cf06ee5b0dc714e2145c0d6b888936f95..74b2d3ed363fa0690dc683eb22754e45e42ed06b 100644 --- a/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking.yaml +++ b/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "**Getting the Weather in Florence**\n\nOkay, so I see the user wants to know the weather in Florence, Italy. That's straightforward; that query directly corresponds to my `weather.get_weather` function. It's pretty clear-cut, the function takes a `location` parameter, and in this case, that `location` is simply \"Florence, Italy\". Nothing complicated here, I can just set that parameter and move on.\n", + "text": "**Weather in Florence, Italy**\n\nOkay, so the user wants the weather for \"Florence, Italy.\" That's straightforward; my processing path leads directly to `weather.get_weather`. This is a clear case for that particular function. It takes a `location` argument, and that's easy enough. I'll just set the `location` parameter to \"Florence, Italy.\" Done! Ready to execute.\n", "thought": true }, { @@ -40,7 +40,7 @@ interactions: "location": "Florence, Italy" } }, - "thoughtSignature": "CpwCAdHtim+0FmI+WFq9+osYttd0V3wq5L6xpmfD+s3Xy+iz1L6F5MmUgDo3Vop462ydmq46DgqFSLYj33RAcxmXMnfJMnqdDbLkR00eT6FtPNKk1HxBIDg+d8nxH5LBRnQ4+/Py4nOa4oMiTfNaOuMpZZnIyJBRLFSOw0ZQftvmXoKCB/hZEW6dYve3wxGH+o4BZ/sdxO/3IdPhk2eRlcieDEVN/F4Fg1xAmdc/60inB/SsuSIMRRKHW/48nlCOwlJbbTRI9FIhtqLkDwjXMMWxwovwhstRb4+frvLsOIsBNQk+q5MByNI+waAOxhSVVvHChLh9vQTM4xZ0g14GGZ6SbLz+ujRWdPYjN1ON25uMX00ZTwM2S5K8IZUeJsM=" + "thoughtSignature": "CpwCAb4+9vsnDPVKCBbr2tnMUnEAJFGNMneg95rjCSOs6HV/dxMzyPDGxbqSkXe22liMoinB/fkfQFE9JI121uEeAjCBPYluDcHAuoOR6z3WdK+9x4gLfjsjieoOSGE+x9KkM0iml+XX+RP42tuBsOEn5AQsvr3iUQ/rdo1hanDOSdT0RfNyWmwYdGNAHPFsehZN3FAEuMCKEPS5bVsh6rGMpccdFYLHy9hnLIg0WZFZwSwhmGNSXuBUc6YK71TtMRxe19WuRbrXA4Na2ig9pBWIcOtYwaeTRcYmaZoh5agdiG9G4tWZCQ1Kbxsg1FZ8jXXrlPefL2jwtgDcidWKt3BQ3XvGm1db0I+H08+LOZa6ITpOd0qtIc4Pc2T/EmE=" } ], "role": "model" @@ -53,24 +53,24 @@ interactions: "usageMetadata": { "promptTokenCount": 54, "candidatesTokenCount": 15, - "totalTokenCount": 135, + "totalTokenCount": 133, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 54 } ], - "thoughtsTokenCount": 66 + "thoughtsTokenCount": 64 }, "modelVersion": "gemini-2.5-pro", - "responseId": "qqIdaZ73A_ClvdIPvJaP0Ak" + "responseId": "gP-dacn4HJCDz7IP58yLgAc" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 3.080074125s + duration: 2.659325375s - id: 1 request: proto: HTTP/1.1 @@ -79,12 +79,12 @@ interactions: content_length: 1170 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CpwCAdHtim+0FmI+WFq9+osYttd0V3wq5L6xpmfD+s3Xy+iz1L6F5MmUgDo3Vop462ydmq46DgqFSLYj33RAcxmXMnfJMnqdDbLkR00eT6FtPNKk1HxBIDg+d8nxH5LBRnQ4+/Py4nOa4oMiTfNaOuMpZZnIyJBRLFSOw0ZQftvmXoKCB/hZEW6dYve3wxGH+o4BZ/sdxO/3IdPhk2eRlcieDEVN/F4Fg1xAmdc/60inB/SsuSIMRRKHW/48nlCOwlJbbTRI9FIhtqLkDwjXMMWxwovwhstRb4+frvLsOIsBNQk+q5MByNI+waAOxhSVVvHChLh9vQTM4xZ0g14GGZ6SbLz+ujRWdPYjN1ON25uMX00ZTwM2S5K8IZUeJsM="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"CpwCAb4+9vsnDPVKCBbr2tnMUnEAJFGNMneg95rjCSOs6HV/dxMzyPDGxbqSkXe22liMoinB/fkfQFE9JI121uEeAjCBPYluDcHAuoOR6z3WdK+9x4gLfjsjieoOSGE+x9KkM0iml+XX+RP42tuBsOEn5AQsvr3iUQ/rdo1hanDOSdT0RfNyWmwYdGNAHPFsehZN3FAEuMCKEPS5bVsh6rGMpccdFYLHy9hnLIg0WZFZwSwhmGNSXuBUc6YK71TtMRxe19WuRbrXA4Na2ig9pBWIcOtYwaeTRcYmaZoh5agdiG9G4tWZCQ1Kbxsg1FZ8jXXrlPefL2jwtgDcidWKt3BQ3XvGm1db0I+H08+LOZa6ITpOd0qtIc4Pc2T/EmE="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -121,11 +121,11 @@ interactions: ] }, "modelVersion": "gemini-2.5-pro", - "responseId": "rKIdaY5egY690g_byfO5CQ" + "responseId": "gf-daYz0NaDVz7IP_-SygAI" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.95741725s + duration: 1.360388541s diff --git a/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml index 6e9c8bd55b128e2d48d64dd33dbb5491b51a97cf..b6dc1375ee8a9c644cf17f2416e0851136a064f0 100644 --- a/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml +++ b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml @@ -6,10 +6,10 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 550 + content_length: 552 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingLevel":"HIGH"}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} form: alt: - sse @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse method: POST response: @@ -25,22 +25,22 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"**Examining the Query**\\n\\nI'm currently analyzing the incoming request. The user is clearly seeking current weather information. My primary focus is pinpointing the specific location—Florence, Italy—which is crucial for the function call. I need to formulate the right parameters to obtain the correct weather data.\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"totalTokenCount\": 65,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"n6IdafKCLorkvdIPipOBkQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"**Exploring Tool Options**\\n\\nI've discovered a tool, aptly named \\\"default\\\\_api:weather,\\\" which is ideal for this task. It seems perfectly suited, with its description explicitly stating its capability to retrieve weather details based on location. I'm now certain this is the appropriate API call to acquire the necessary information. I'm moving forward with confidence.\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"totalTokenCount\": 65,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"n6IdafKCLorkvdIPipOBkQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"EoMECoAEAdHtim81mSx3N5M3zd8oz+3yIyyUSy0Gz1XbUZ0/o+D/FVqMu7H+cuRdFB7jIOareNRWH5VZs2W64dxNI6YnvG9VdmYQyucoUMDLOrrEMFosx5QgJRzpKTJ9Kh6QoTZrlDg9WC0Z7JXPc75LN7YR1Y+Sto3FKTAuJ7l93u7Yhfc5Q9q1zi7FK5hELlkQD5Z8/ENCv0ouCmWPi3QK0nnl4t2SxzdP455ujbh8klcm+5F705VhNvD9o55MX7DUx0mIExhCvkIWMjfx0tMmC9mlHH6KuqwBjFzaoUF6l8S0Xb50NYA1t63F/G6sb+OUw3m/5uoxpyHrFihKehsBkOpI7sBtbMgcAOmZHDkp+MxBK7fbBOg8zLCLKP9A64d2Qsx0oEwUTiGDNVdKLu4i6SQc/p/PNUoWG4RQ4oGOxXM/1kVlvws1aRNPZBk7uTPmjVXg3dzXlX1bin4GomZy2aEt5sPzv6kCc0BCZhh05y7SYZGhA0J1uyKdrun5SLaG8DtIhS2Jb+RJBON3ubIUaBZDUa4RVS/QnNPBpAXEDI7q5HBKiz2tuKstpMDsP48rbtR2rh4sG/gnVVDMESMgyJtI291plYuBsZS7+fUuxr8y+9pu4BxvuZwUXuKOSfOZe815ILhKyDNCdcp+1QSuBy6XUrp5DLL1ucH5Hu4tk+bnShA=\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"candidatesTokenCount\": 16,\"totalTokenCount\": 185,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}],\"thoughtsTokenCount\": 104},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"n6IdafKCLorkvdIPipOBkQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"candidatesTokenCount\": 16,\"totalTokenCount\": 185,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}],\"thoughtsTokenCount\": 104},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"n6IdafKCLorkvdIPipOBkQk\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"EqoDCqcDAb4+9vtxYT0MyTOcABWD9QZqDpm796s3VmnwFwdFNh/sd/gdkTxOEWPxg1YG5CYfNIr4+IVvBgqtGb5osFqiIEVetBLwdCnZlPCRT5mjeJNvRLN11YqUzNWjokDKsiKMAynCETBR0s5FN+HW8ANlVJiMRTgknDuAAEWBU8X1S7ST0V4KUrK0Qt//hh9njcp3gDabEu3IMKRfUEC9uoicajB+u+EOS7bH8gzR+JqvNqLyzcSb2BTy9JIE09lweuDs2ONAdbOC1EhJpObh7QG3GNy9Wbw2+5MnnOk2NQxY72yLDDl+rTYVeR3U4wQPkFrv9BaoIOOKu2i51JB7kCNVxXrGt3QxpAy4fBULpJ7WamIIEM+zaM7MwVeD1+9pdXSUDvZ9ZT6LmiKBFtG/Cw5RQaHbNxFR7GS/bOYZPv3JaOIUDDfHoWOokFrJ1exTx5b5IQ9a8vAZZhNAHbWT5OIHLkOzjgJGfK3E/KLudlAdUDhJgCR6p/KHQRC11eE2RrvWfoJri+IEW4h4+4P3dk50AZXgslTB4fjdninU1rqLEdarsdhHQ0jl\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"candidatesTokenCount\": 16,\"totalTokenCount\": 154,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}],\"thoughtsTokenCount\": 73},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"dv-dadqKAouGz7IP2r-x4Ao\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"candidatesTokenCount\": 16,\"totalTokenCount\": 154,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}],\"thoughtsTokenCount\": 73},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"dv-dadqKAouGz7IP2r-x4Ao\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 2.532721041s + duration: 2.657040917s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1478 + content_length: 1360 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"EoMECoAEAdHtim81mSx3N5M3zd8oz+3yIyyUSy0Gz1XbUZ0/o+D/FVqMu7H+cuRdFB7jIOareNRWH5VZs2W64dxNI6YnvG9VdmYQyucoUMDLOrrEMFosx5QgJRzpKTJ9Kh6QoTZrlDg9WC0Z7JXPc75LN7YR1Y+Sto3FKTAuJ7l93u7Yhfc5Q9q1zi7FK5hELlkQD5Z8/ENCv0ouCmWPi3QK0nnl4t2SxzdP455ujbh8klcm+5F705VhNvD9o55MX7DUx0mIExhCvkIWMjfx0tMmC9mlHH6KuqwBjFzaoUF6l8S0Xb50NYA1t63F/G6sb+OUw3m/5uoxpyHrFihKehsBkOpI7sBtbMgcAOmZHDkp+MxBK7fbBOg8zLCLKP9A64d2Qsx0oEwUTiGDNVdKLu4i6SQc/p/PNUoWG4RQ4oGOxXM/1kVlvws1aRNPZBk7uTPmjVXg3dzXlX1bin4GomZy2aEt5sPzv6kCc0BCZhh05y7SYZGhA0J1uyKdrun5SLaG8DtIhS2Jb+RJBON3ubIUaBZDUa4RVS/QnNPBpAXEDI7q5HBKiz2tuKstpMDsP48rbtR2rh4sG/gnVVDMESMgyJtI291plYuBsZS7+fUuxr8y+9pu4BxvuZwUXuKOSfOZe815ILhKyDNCdcp+1QSuBy6XUrp5DLL1ucH5Hu4tk+bnShA="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"EqoDCqcDAb4+9vtxYT0MyTOcABWD9QZqDpm796s3VmnwFwdFNh/sd/gdkTxOEWPxg1YG5CYfNIr4+IVvBgqtGb5osFqiIEVetBLwdCnZlPCRT5mjeJNvRLN11YqUzNWjokDKsiKMAynCETBR0s5FN+HW8ANlVJiMRTgknDuAAEWBU8X1S7ST0V4KUrK0Qt//hh9njcp3gDabEu3IMKRfUEC9uoicajB+u+EOS7bH8gzR+JqvNqLyzcSb2BTy9JIE09lweuDs2ONAdbOC1EhJpObh7QG3GNy9Wbw2+5MnnOk2NQxY72yLDDl+rTYVeR3U4wQPkFrv9BaoIOOKu2i51JB7kCNVxXrGt3QxpAy4fBULpJ7WamIIEM+zaM7MwVeD1+9pdXSUDvZ9ZT6LmiKBFtG/Cw5RQaHbNxFR7GS/bOYZPv3JaOIUDDfHoWOokFrJ1exTx5b5IQ9a8vAZZhNAHbWT5OIHLkOzjgJGfK3E/KLudlAdUDhJgCR6p/KHQRC11eE2RrvWfoJri+IEW4h4+4P3dk50AZXgslTB4fjdninU1rqLEdarsdhHQ0jl"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingLevel":"HIGH"}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse method: POST response: @@ -56,10 +56,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"It\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 95,\"candidatesTokenCount\": 1,\"totalTokenCount\": 96,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 95}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"oaIdaciSM6HXxN8Ph5ic0Ak\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"'s currently 40 degrees Celsius in Florence, Italy.\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 95,\"candidatesTokenCount\": 14,\"totalTokenCount\": 109,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 95}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"oaIdaciSM6HXxN8Ph5ic0Ak\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 197,\"candidatesTokenCount\": 14,\"totalTokenCount\": 211,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 197}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"oaIdaciSM6HXxN8Ph5ic0Ak\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The weather in Florence\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 95,\"candidatesTokenCount\": 4,\"totalTokenCount\": 99,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 95}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"eP-dabHAGIWsz7IP8p272QY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is currently 40°C.\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 95,\"candidatesTokenCount\": 14,\"totalTokenCount\": 109,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 95}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"eP-dabHAGIWsz7IP8p272QY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 168,\"candidatesTokenCount\": 14,\"totalTokenCount\": 182,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 168}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"eP-dabHAGIWsz7IP8p272QY\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.537615041s + duration: 1.739511583s diff --git a/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml index 8d6a343f9fec02a4226ef3e087fe2d02f130144f..1cc77a94f732f7e5c2233dc665b5b9d36ab5281c 100644 --- a/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml +++ b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml @@ -6,15 +6,15 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 550 + content_length: 552 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingLevel":"HIGH"}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "**Breaking Down the Weather Query**\n\nOkay, here's what I'm processing. A user is asking about the weather in Florence, Italy. That's straightforward enough - they want current weather data. Looking at my toolset, I see the `weather` tool is perfect for this. It's explicitly designed for retrieving weather information based on a location. Easy. This is a classic example of intent recognition and tool selection. My next step would be to formulate the `weather` function call with the correct parameters, specifically the location, \"Florence, Italy\". I'm ready to get this user the information they need.\n\n\n", + "text": "**My Approach to Gathering Weather Information**\n\nOkay, so the user wants the weather for Florence, Italy. My primary task here is to find the most efficient way to get that information. I immediately recognize the need for a weather data retrieval tool; that's the obvious starting point. I quickly scan my available tools and, from what I see, the `weather` tool seems like the most relevant option. That's a good sign.\n\nNow, I need to ensure I'm using this tool correctly. It takes a `location` parameter, which is exactly what I need to specify the city. Excellent, that aligns perfectly with the user's request for Florence. Therefore, the logical action is to call the `weather` tool and pass \"Florence, Italy\" as the value for the `location` parameter. The structure will be `weather(location=\"Florence, Italy\")`. That should provide the user with the weather details they're after.\n\n\n", "thought": true }, { @@ -40,7 +40,7 @@ interactions: "location": "Florence, Italy" } }, - "thoughtSignature": "EtMDCtADAdHtim/Qznjl3jYdbqtczyFkf1sarL7CYPmwkwMTU8qifm7AQe1i21NWqWvbSGT+KG/NkCBhcC0Zc8MusHqgFm2Iw+2TP0Ckp8nL5k+1G7jffxPRKsXcyq/6jvRtGvcxb199vZTNapt2/vYas7tEOZahNr/Xiuic7yVEcEEQD8Vdsp9qgRy8qu4RO1nc8Q5cnbd8fOEKfjusde2ehpTA47PUNhhIWlLBEGeMOowAoaEf9/W7cMxlg21omQYaYiIVgvI1qi2U/4nSOKDBlTA2N0LDuygPTtRsz2ZMwJGC8CIrrCW0apY1X2QcgO+s/9tNurJp/D9tiIFnwRXT8q7V90nAng9dSqHrChr2jvr4n3j5wgbvHnqLJouCKR8ME+leQZUHefdJyHeXNSjv9Rzs7cqiaUgWR7Rn11BQld3Q/myVqq7/r0LI/IchztYQVKDvE0XXbc0o8x4cfQTmtdlSwcAQxE5OG6sLNoRPAJmPfkwlppeHwNGG7ntkCKX/nG/o40w2OyFwk6WnkyNhnqTiA5knDyP51fnOiwKhFYxtDa7f2WdUPsILiJjqT7hDjtYTCnYvuWgTvqkaRtfLWES9QIVVZP63zK6PDFQLtLp8kd0=" + "thoughtSignature": "EoMDCoADAb4+9vvcql04LjFTQa1nTMMudhrlpmFSqgQWtecZs9Gzm8GC6izmq42etV5ICgg5qr/h5KO05LHjo7OT/Y/O6zTq5vweOOvvAZHK3IDBgU7FBiCW5bW+nI6TjhgDHSNPn/Uk14iuv5RGXrH1QgxQ2ApBiLQlEmkjzmzmBUgI0gRmjRX+sDMF0IJu66tmZfkaqvR9Tp2xxEZjJitWL7P6jZvql6JE54UmL8dI02Dk/xnNS76rZiipzg8013aXxfIEgTEHMnsRvzK7QCGaukQ+/DU8GnomhZRYZPEW32OxQEjUyqm10c8o62WPtThyfIUmUBHwc8oojkH/2IT5fRy2nJwvUar3O82/of2miqe/9z7TNTKNK83wl9Gy5R3Gbc/XjI7A+LrwlYTynsVRqXFg3YURlzRnfFcGt4KEUcd2wLKqpeCNSngzS0VgiEqK5j9RTPedm3S2/oTgtl8jt2gff3NEDkJe8xUlXLS+l28rJ22Loc9BooDebKZYBBHvL9qu" } ], "role": "model" @@ -53,38 +53,38 @@ interactions: "usageMetadata": { "promptTokenCount": 65, "candidatesTokenCount": 16, - "totalTokenCount": 189, + "totalTokenCount": 161, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 65 } ], - "thoughtsTokenCount": 108 + "thoughtsTokenCount": 80 }, "modelVersion": "gemini-3-pro-preview", - "responseId": "mqIdabO3C5S3vdIPuPm34Ak" + "responseId": "cf-dacuQCbPoz7IPiZ25mAE" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 3.163927334s + duration: 4.104216583s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1414 + content_length: 1308 host: generativelanguage.googleapis.com body: | - {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"EtMDCtADAdHtim/Qznjl3jYdbqtczyFkf1sarL7CYPmwkwMTU8qifm7AQe1i21NWqWvbSGT+KG/NkCBhcC0Zc8MusHqgFm2Iw+2TP0Ckp8nL5k+1G7jffxPRKsXcyq/6jvRtGvcxb199vZTNapt2/vYas7tEOZahNr/Xiuic7yVEcEEQD8Vdsp9qgRy8qu4RO1nc8Q5cnbd8fOEKfjusde2ehpTA47PUNhhIWlLBEGeMOowAoaEf9/W7cMxlg21omQYaYiIVgvI1qi2U/4nSOKDBlTA2N0LDuygPTtRsz2ZMwJGC8CIrrCW0apY1X2QcgO+s/9tNurJp/D9tiIFnwRXT8q7V90nAng9dSqHrChr2jvr4n3j5wgbvHnqLJouCKR8ME+leQZUHefdJyHeXNSjv9Rzs7cqiaUgWR7Rn11BQld3Q/myVqq7/r0LI/IchztYQVKDvE0XXbc0o8x4cfQTmtdlSwcAQxE5OG6sLNoRPAJmPfkwlppeHwNGG7ntkCKX/nG/o40w2OyFwk6WnkyNhnqTiA5knDyP51fnOiwKhFYxtDa7f2WdUPsILiJjqT7hDjtYTCnYvuWgTvqkaRtfLWES9QIVVZP63zK6PDFQLtLp8kd0="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingBudget":128}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} + {"contents":[{"parts":[{"text":"What's the weather in Florence, Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"1","name":"weather"},"thoughtSignature":"EoMDCoADAb4+9vvcql04LjFTQa1nTMMudhrlpmFSqgQWtecZs9Gzm8GC6izmq42etV5ICgg5qr/h5KO05LHjo7OT/Y/O6zTq5vweOOvvAZHK3IDBgU7FBiCW5bW+nI6TjhgDHSNPn/Uk14iuv5RGXrH1QgxQ2ApBiLQlEmkjzmzmBUgI0gRmjRX+sDMF0IJu66tmZfkaqvR9Tp2xxEZjJitWL7P6jZvql6JE54UmL8dI02Dk/xnNS76rZiipzg8013aXxfIEgTEHMnsRvzK7QCGaukQ+/DU8GnomhZRYZPEW32OxQEjUyqm10c8o62WPtThyfIUmUBHwc8oojkH/2IT5fRy2nJwvUar3O82/of2miqe/9z7TNTKNK83wl9Gy5R3Gbc/XjI7A+LrwlYTynsVRqXFg3YURlzRnfFcGt4KEUcd2wLKqpeCNSngzS0VgiEqK5j9RTPedm3S2/oTgtl8jt2gff3NEDkJe8xUlXLS+l28rJ22Loc9BooDebKZYBBHvL9qu"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"thinkingConfig":{"includeThoughts":true,"thinkingLevel":"HIGH"}},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.4 + - google-genai-sdk/1.47.0 gl-go/go1.26.0 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent method: POST response: @@ -100,7 +100,7 @@ interactions: "content": { "parts": [ { - "text": "It's currently 40°C (104°F) in Florence, Italy. That is quite hot!" + "text": "The weather in Florence, Italy is currently 40 degrees Celsius." } ], "role": "model" @@ -110,22 +110,22 @@ interactions: } ], "usageMetadata": { - "promptTokenCount": 201, - "candidatesTokenCount": 26, - "totalTokenCount": 227, + "promptTokenCount": 175, + "candidatesTokenCount": 14, + "totalTokenCount": 189, "promptTokensDetails": [ { "modality": "TEXT", - "tokenCount": 201 + "tokenCount": 175 } ] }, "modelVersion": "gemini-3-pro-preview", - "responseId": "naIdabjfC4HhvdIPo9CWoAk" + "responseId": "c_-daaKZE47oz7IP_YXG8AY" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 3.0175995s + duration: 2.255511958s