From 4e3f10a6cf20370ab1f0ed8e8f19985375288d85 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Wed, 19 Nov 2025 12:44:04 +0100 Subject: [PATCH] fix: handle google model reasoning correctly (#82) --- providers/google/google.go | 198 ++++++++++++++---- providers/google/provider_options.go | 1 + providers/openrouter/language_model_hooks.go | 133 +++++++++++- providertests/google_test.go | 1 + providertests/openrouter_test.go | 1 + .../gemini-2.5-flash/multi_tool.yaml | 28 +-- .../multi_tool_streaming.yaml | 16 +- .../gemini-2.5-flash/simple.yaml | 10 +- .../gemini-2.5-flash/simple_streaming.yaml | 6 +- .../gemini-2.5-flash/tool.yaml | 22 +- .../gemini-2.5-flash/tool_streaming.yaml | 16 +- .../gemini-2.5-pro/multi_tool.yaml | 32 +-- .../gemini-2.5-pro/multi_tool_streaming.yaml | 16 +- .../gemini-2.5-pro/simple.yaml | 14 +- .../gemini-2.5-pro/simple_streaming.yaml | 6 +- .../TestGoogleCommon/gemini-2.5-pro/tool.yaml | 28 +-- .../gemini-2.5-pro/tool_streaming.yaml | 16 +- .../gemini-3-pro-preview/multi_tool.yaml | 137 ++++++++++++ .../multi_tool_streaming.yaml | 65 ++++++ .../gemini-3-pro-preview/simple.yaml | 63 ++++++ .../simple_streaming.yaml | 34 +++ .../gemini-3-pro-preview/tool.yaml | 127 +++++++++++ .../gemini-3-pro-preview/tool_streaming.yaml | 65 ++++++ .../vertex-claude-3-7-sonnet/simple.yaml | 4 +- .../simple_streaming.yaml | 38 +--- .../vertex-claude-3-7-sonnet/tool.yaml | 12 +- .../tool_streaming.yaml | 87 ++++---- .../vertex-gemini-2-5-flash/multi_tool.yaml | 32 +-- .../multi_tool_streaming.yaml | 16 +- .../vertex-gemini-2-5-flash/simple.yaml | 14 +- .../simple_streaming.yaml | 6 +- .../vertex-gemini-2-5-flash/tool.yaml | 40 ++-- .../tool_streaming.yaml | 16 +- .../vertex-gemini-2-5-pro/multi_tool.yaml | 48 ++--- .../multi_tool_streaming.yaml | 16 +- .../vertex-gemini-2-5-pro/simple.yaml | 20 +- .../simple_streaming.yaml | 6 +- .../vertex-gemini-2-5-pro/tool.yaml | 42 ++-- .../vertex-gemini-2-5-pro/tool_streaming.yaml | 16 +- .../gemini-2.5-flash/complex_object.yaml | 10 +- .../complex_object_streaming.yaml | 6 +- .../gemini-2.5-flash/simple_object.yaml | 12 +- .../simple_object_streaming.yaml | 6 +- .../gemini-2.5-pro/complex_object.yaml | 14 +- .../complex_object_streaming.yaml | 6 +- .../gemini-2.5-pro/simple_object.yaml | 10 +- .../simple_object_streaming.yaml | 6 +- .../gemini-3-pro-preview/complex_object.yaml | 63 ++++++ .../complex_object_streaming.yaml | 34 +++ .../gemini-3-pro-preview/simple_object.yaml | 63 ++++++ .../simple_object_streaming.yaml | 34 +++ .../gemini-2.5-flash/thinking-streaming.yaml | 16 +- .../gemini-2.5-flash/thinking.yaml | 20 +- .../gemini-2.5-pro/thinking-streaming.yaml | 16 +- .../gemini-2.5-pro/thinking.yaml | 26 +-- .../thinking-streaming.yaml | 65 ++++++ .../gemini-3-pro-preview/thinking.yaml | 131 ++++++++++++ .../gemini-3-pro-preview/multi_tool.yaml | 63 ++++++ .../multi_tool_streaming.yaml | 81 +++++++ .../gemini-3-pro-preview/simple.yaml | 33 +++ .../simple_streaming.yaml | 44 ++++ .../gemini-3-pro-preview/tool.yaml | 63 ++++++ .../gemini-3-pro-preview/tool_streaming.yaml | 81 +++++++ .../thinking-streaming.yaml | 77 +++++++ .../gemini-3-pro-preview/thinking.yaml | 63 ++++++ 65 files changed, 2050 insertions(+), 441 deletions(-) create mode 100644 providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool.yaml create mode 100644 providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool_streaming.yaml create mode 100644 providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple.yaml create mode 100644 providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple_streaming.yaml create mode 100644 providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool.yaml create mode 100644 providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool_streaming.yaml create mode 100644 providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object.yaml create mode 100644 providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object_streaming.yaml create mode 100644 providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object.yaml create mode 100644 providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object_streaming.yaml create mode 100644 providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml create mode 100644 providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple_streaming.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking-streaming.yaml create mode 100644 providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking.yaml diff --git a/providers/google/google.go b/providers/google/google.go index 964649b9b5f183d269aaab287dc267b87b39375c..5a41b16fbf749588a6bdcfa984b1b712ecb60195 100644 --- a/providers/google/google.go +++ b/providers/google/google.go @@ -387,19 +387,37 @@ func toGooglePrompt(prompt fantasy.Prompt) (*genai.Content, []*genai.Content, [] } case fantasy.MessageRoleAssistant: var parts []*genai.Part - // INFO: (kujtim) this is kind of a hacky way to include thinking for google - // weirdly thinking needs to be included in a function call - var signature []byte + var currentReasoningMetadata *ReasoningMetadata for _, part := range msg.Content { switch part.GetType() { + case fantasy.ContentTypeReasoning: + reasoning, ok := fantasy.AsMessagePart[fantasy.ReasoningPart](part) + if !ok { + continue + } + + metadata, ok := reasoning.ProviderOptions[Name] + if !ok { + continue + } + reasoningMetadata, ok := metadata.(*ReasoningMetadata) + if !ok { + continue + } + currentReasoningMetadata = reasoningMetadata case fantasy.ContentTypeText: text, ok := fantasy.AsMessagePart[fantasy.TextPart](part) if !ok || text.Text == "" { continue } - parts = append(parts, &genai.Part{ + geminiPart := &genai.Part{ Text: text.Text, - }) + } + if currentReasoningMetadata != nil { + geminiPart.ThoughtSignature = []byte(currentReasoningMetadata.Signature) + currentReasoningMetadata = nil + } + parts = append(parts, geminiPart) case fantasy.ContentTypeToolCall: toolCall, ok := fantasy.AsMessagePart[fantasy.ToolCallPart](part) if !ok { @@ -411,33 +429,18 @@ func toGooglePrompt(prompt fantasy.Prompt) (*genai.Content, []*genai.Content, [] if err != nil { continue } - parts = append(parts, &genai.Part{ + geminiPart := &genai.Part{ FunctionCall: &genai.FunctionCall{ ID: toolCall.ToolCallID, Name: toolCall.ToolName, Args: result, }, - ThoughtSignature: signature, - }) - // reset - signature = nil - case fantasy.ContentTypeReasoning: - reasoning, ok := fantasy.AsMessagePart[fantasy.ReasoningPart](part) - if !ok { - continue - } - metadata, ok := reasoning.ProviderOptions[Name] - if !ok { - continue - } - reasoningMetadata, ok := metadata.(*ReasoningMetadata) - if !ok { - continue } - if !ok || reasoningMetadata.Signature == "" { - continue + if currentReasoningMetadata != nil { + geminiPart.ThoughtSignature = []byte(currentReasoningMetadata.Signature) + currentReasoningMetadata = nil } - signature = []byte(reasoningMetadata.Signature) + parts = append(parts, geminiPart) } } if len(parts) > 0 { @@ -635,7 +638,18 @@ func (g *languageModel) Stream(ctx context.Context, call fantasy.Call) (fantasy. return } } else { - // Regular text part + // Start new text block if not already active + if !isActiveText { + isActiveText = true + currentTextBlockID = fmt.Sprintf("%d", blockCounter) + blockCounter++ + if !yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeTextStart, + ID: currentTextBlockID, + }) { + return + } + } // End any active reasoning block before starting text if isActiveReasoning { isActiveReasoning = false @@ -651,16 +665,23 @@ func (g *languageModel) Stream(ctx context.Context, call fantasy.Call) (fantasy. }) { return } - } + } else if part.ThoughtSignature != nil { + metadata := &ReasoningMetadata{ + Signature: string(part.ThoughtSignature), + } - // Start new text block if not already active - if !isActiveText { - isActiveText = true - currentTextBlockID = fmt.Sprintf("%d", blockCounter) - blockCounter++ if !yield(fantasy.StreamPart{ - Type: fantasy.StreamPartTypeTextStart, - ID: currentTextBlockID, + Type: fantasy.StreamPartTypeReasoningStart, + ID: currentReasoningBlockID, + }) { + return + } + if !yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeReasoningEnd, + ID: currentReasoningBlockID, + ProviderMetadata: fantasy.ProviderMetadata{ + Name: metadata, + }, }) { return } @@ -687,11 +708,13 @@ func (g *languageModel) Stream(ctx context.Context, call fantasy.Call) (fantasy. return } } + toolCallID := cmp.Or(part.FunctionCall.ID, g.providerOptions.toolCallIDFunc()) + // End any active reasoning block before starting text if isActiveReasoning { isActiveReasoning = false - metadata := &ReasoningMetadata{ Signature: string(part.ThoughtSignature), + ToolID: toolCallID, } if !yield(fantasy.StreamPart{ Type: fantasy.StreamPartTypeReasoningEnd, @@ -702,10 +725,28 @@ func (g *languageModel) Stream(ctx context.Context, call fantasy.Call) (fantasy. }) { return } - } - - toolCallID := cmp.Or(part.FunctionCall.ID, g.providerOptions.toolCallIDFunc()) + } else if part.ThoughtSignature != nil { + metadata := &ReasoningMetadata{ + Signature: string(part.ThoughtSignature), + ToolID: toolCallID, + } + if !yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeReasoningStart, + ID: currentReasoningBlockID, + }) { + return + } + if !yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeReasoningEnd, + ID: currentReasoningBlockID, + ProviderMetadata: fantasy.ProviderMetadata{ + Name: metadata, + }, + }) { + return + } + } args, err := json.Marshal(part.FunctionCall.Args) if err != nil { yield(fantasy.StreamPart{ @@ -1233,11 +1274,46 @@ func (g languageModel) mapResponse(response *genai.GenerateContentResponse, warn switch { case part.Text != "": if part.Thought { - metadata := &ReasoningMetadata{ - Signature: string(part.ThoughtSignature), + reasoningContent := fantasy.ReasoningContent{Text: part.Text} + if part.ThoughtSignature != nil { + metadata := &ReasoningMetadata{ + Signature: string(part.ThoughtSignature), + } + reasoningContent.ProviderMetadata = fantasy.ProviderMetadata{ + Name: metadata, + } } - content = append(content, fantasy.ReasoningContent{Text: part.Text, ProviderMetadata: fantasy.ProviderMetadata{Name: metadata}}) + content = append(content, reasoningContent) } else { + foundReasoning := false + if part.ThoughtSignature != nil { + metadata := &ReasoningMetadata{ + Signature: string(part.ThoughtSignature), + } + // find the last reasoning content and add the signature + for i := len(content) - 1; i >= 0; i-- { + c := content[i] + if c.GetType() == fantasy.ContentTypeReasoning { + reasoningContent, ok := fantasy.AsContentType[fantasy.ReasoningContent](c) + if !ok { + continue + } + reasoningContent.ProviderMetadata = fantasy.ProviderMetadata{ + Name: metadata, + } + content[i] = reasoningContent + foundReasoning = true + break + } + } + if !foundReasoning { + content = append(content, fantasy.ReasoningContent{ + ProviderMetadata: fantasy.ProviderMetadata{ + Name: metadata, + }, + }) + } + } content = append(content, fantasy.TextContent{Text: part.Text}) } case part.FunctionCall != nil: @@ -1246,6 +1322,36 @@ func (g languageModel) mapResponse(response *genai.GenerateContentResponse, warn return nil, err } toolCallID := cmp.Or(part.FunctionCall.ID, g.providerOptions.toolCallIDFunc()) + foundReasoning := false + if part.ThoughtSignature != nil { + metadata := &ReasoningMetadata{ + Signature: string(part.ThoughtSignature), + ToolID: toolCallID, + } + // find the last reasoning content and add the signature + for i := len(content) - 1; i >= 0; i-- { + c := content[i] + if c.GetType() == fantasy.ContentTypeReasoning { + reasoningContent, ok := fantasy.AsContentType[fantasy.ReasoningContent](c) + if !ok { + continue + } + reasoningContent.ProviderMetadata = fantasy.ProviderMetadata{ + Name: metadata, + } + content[i] = reasoningContent + foundReasoning = true + break + } + } + if !foundReasoning { + content = append(content, fantasy.ReasoningContent{ + ProviderMetadata: fantasy.ProviderMetadata{ + Name: metadata, + }, + }) + } + } content = append(content, fantasy.ToolCallContent{ ToolCallID: toolCallID, ToolName: part.FunctionCall.Name, @@ -1273,6 +1379,16 @@ func (g languageModel) mapResponse(response *genai.GenerateContentResponse, warn }, nil } +// GetReasoningMetadata extracts reasoning metadata from provider options for google models. +func GetReasoningMetadata(providerOptions fantasy.ProviderOptions) *ReasoningMetadata { + if googleOptions, ok := providerOptions[Name]; ok { + if reasoning, ok := googleOptions.(*ReasoningMetadata); ok { + return reasoning + } + } + return nil +} + func mapFinishReason(reason genai.FinishReason) fantasy.FinishReason { switch reason { case genai.FinishReasonStop: diff --git a/providers/google/provider_options.go b/providers/google/provider_options.go index 7d45563c030e3d23a842d047969baeb81d70fcd3..7a0cd375c85bbebf1aeeebb1c5e845a848a91e07 100644 --- a/providers/google/provider_options.go +++ b/providers/google/provider_options.go @@ -40,6 +40,7 @@ type ThinkingConfig struct { // ReasoningMetadata represents reasoning metadata for the Google provider. type ReasoningMetadata struct { Signature string `json:"signature"` + ToolID string `json:"tool_id"` } // Options implements the ProviderOptionsData interface for ReasoningMetadata. diff --git a/providers/openrouter/language_model_hooks.go b/providers/openrouter/language_model_hooks.go index 77cc839414d2aeb2b856a92a5b1b22d5b9946d66..fb69565ac57730cc7e323f4e9036849bc5cbd39a 100644 --- a/providers/openrouter/language_model_hooks.go +++ b/providers/openrouter/language_model_hooks.go @@ -9,6 +9,7 @@ import ( "charm.land/fantasy" "charm.land/fantasy/providers/anthropic" + "charm.land/fantasy/providers/google" "charm.land/fantasy/providers/openai" openaisdk "github.com/openai/openai-go/v2" "github.com/openai/openai-go/v2/packages/param" @@ -81,9 +82,14 @@ func languageModelExtraContent(choice openaisdk.ChatCompletionChoice) []fantasy. text string metadata *anthropic.ReasoningOptionMetadata } + type googleReasoningBlock struct { + text string + metadata *google.ReasoningMetadata + } responsesReasoningBlocks := make([]openai.ResponsesReasoningMetadata, 0) anthropicReasoningBlocks := make([]anthropicReasoningBlock, 0) + googleReasoningBlocks := make([]googleReasoningBlock, 0) otherReasoning := make([]string, 0) for _, detail := range reasoningData.ReasoningDetails { if strings.HasPrefix(detail.Format, "openai-responses") || strings.HasPrefix(detail.Format, "xai-responses") { @@ -108,6 +114,26 @@ func languageModelExtraContent(choice openaisdk.ChatCompletionChoice) []fantasy. responsesReasoningBlocks[detail.Index] = thinkingBlock continue } + if strings.HasPrefix(detail.Format, "google-gemini") { + var thinkingBlock googleReasoningBlock + if len(googleReasoningBlocks)-1 >= detail.Index { + thinkingBlock = googleReasoningBlocks[detail.Index] + } else { + thinkingBlock = googleReasoningBlock{metadata: &google.ReasoningMetadata{}} + googleReasoningBlocks = append(googleReasoningBlocks, thinkingBlock) + } + + switch detail.Type { + case "reasoning.text": + thinkingBlock.text = detail.Text + case "reasoning.encrypted": + thinkingBlock.metadata.Signature = detail.Data + thinkingBlock.metadata.ToolID = detail.ID + } + + googleReasoningBlocks[detail.Index] = thinkingBlock + continue + } if strings.HasPrefix(detail.Format, "anthropic-claude") { anthropicReasoningBlocks = append(anthropicReasoningBlocks, anthropicReasoningBlock{ @@ -141,6 +167,14 @@ func languageModelExtraContent(choice openaisdk.ChatCompletionChoice) []fantasy. }, }) } + for _, block := range googleReasoningBlocks { + content = append(content, fantasy.ReasoningContent{ + Text: block.text, + ProviderMetadata: fantasy.ProviderMetadata{ + google.Name: block.metadata, + }, + }) + } for _, reasoning := range otherReasoning { content = append(content, fantasy.ReasoningContent{ @@ -151,7 +185,9 @@ func languageModelExtraContent(choice openaisdk.ChatCompletionChoice) []fantasy. } type currentReasoningState struct { - metadata *openai.ResponsesReasoningMetadata + metadata *openai.ResponsesReasoningMetadata + googleMetadata *google.ReasoningMetadata + googleText string } func extractReasoningContext(ctx map[string]any) *currentReasoningState { @@ -227,11 +263,43 @@ func languageModelStreamExtra(chunk openaisdk.ChatCompletionChunk, yield func(fa } } + if strings.HasPrefix(detail.Format, "google-gemini") { + // this means there is only encrypted data available start and finish right away + if detail.Type == "reasoning.encrypted" { + ctx[reasoningStartedCtx] = nil + if !yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeReasoningStart, + ID: fmt.Sprintf("%d", inx), + }) { + return ctx, false + } + return ctx, yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeReasoningEnd, + ID: fmt.Sprintf("%d", inx), + ProviderMetadata: fantasy.ProviderMetadata{ + google.Name: &google.ReasoningMetadata{ + Signature: detail.Data, + ToolID: detail.ID, + }, + }, + }) + } + currentState.googleMetadata = &google.ReasoningMetadata{} + currentState.googleText = detail.Text + metadata = fantasy.ProviderMetadata{ + google.Name: currentState.googleMetadata, + } + } + ctx[reasoningStartedCtx] = currentState + delta := detail.Summary + if strings.HasPrefix(detail.Format, "google-gemini") { + delta = detail.Text + } return ctx, yield(fantasy.StreamPart{ Type: fantasy.StreamPartTypeReasoningStart, ID: fmt.Sprintf("%d", inx), - Delta: detail.Summary, + Delta: delta, ProviderMetadata: metadata, }) } @@ -313,6 +381,34 @@ func languageModelStreamExtra(chunk openaisdk.ChatCompletionChunk, yield func(fa }) } + if strings.HasPrefix(detail.Format, "google-gemini") { + // reasoning.text type - accumulate text + if detail.Type == "reasoning.text" { + currentState.googleText += detail.Text + ctx[reasoningStartedCtx] = currentState + return ctx, yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeReasoningDelta, + ID: fmt.Sprintf("%d", inx), + Delta: detail.Text, + }) + } + + // reasoning.encrypted type - end reasoning with signature + if detail.Type == "reasoning.encrypted" { + currentState.googleMetadata.Signature = detail.Data + currentState.googleMetadata.ToolID = detail.ID + metadata := fantasy.ProviderMetadata{ + google.Name: currentState.googleMetadata, + } + ctx[reasoningStartedCtx] = nil + return ctx, yield(fantasy.StreamPart{ + Type: fantasy.StreamPartTypeReasoningEnd, + ID: fmt.Sprintf("%d", inx), + ProviderMetadata: metadata, + }) + } + } + return ctx, yield(fantasy.StreamPart{ Type: fantasy.StreamPartTypeReasoningDelta, ID: fmt.Sprintf("%d", inx), @@ -793,7 +889,38 @@ func languageModelToPrompt(prompt fantasy.Prompt, _, model string) ([]openaisdk. assistantMsg.SetExtraFields(map[string]any{ "reasoning_details": reasoningDetailsMap, }) - + case strings.HasPrefix(model, "google/"): + metadata := google.GetReasoningMetadata(reasoningPart.Options()) + if metadata == nil { + text := fmt.Sprintf("%s", reasoningPart.Text) + if assistantMsg.Content.OfString.Valid() { + text = assistantMsg.Content.OfString.Value + "\n" + text + } + // this reasoning did not come from anthropic just add a text content + assistantMsg.Content = openaisdk.ChatCompletionAssistantMessageParamContentUnion{ + OfString: param.NewOpt(text), + } + continue + } + if reasoningPart.Text != "" { + reasoningDetails = append(reasoningDetails, ReasoningDetail{ + Type: "reasoning.text", + Format: "google-gemini-v1", + Text: reasoningPart.Text, + }) + } + reasoningDetails = append(reasoningDetails, ReasoningDetail{ + Type: "reasoning.encrypted", + Format: "google-gemini-v1", + Data: metadata.Signature, + ID: metadata.ToolID, + }) + data, _ := json.Marshal(reasoningDetails) + reasoningDetailsMap := []map[string]any{} + _ = json.Unmarshal(data, &reasoningDetailsMap) + assistantMsg.SetExtraFields(map[string]any{ + "reasoning_details": reasoningDetailsMap, + }) default: reasoningDetails = append(reasoningDetails, ReasoningDetail{ Type: "reasoning.text", diff --git a/providertests/google_test.go b/providertests/google_test.go index 8f6b1d3c5106e0d099ac4b3c41302446a002a626..c681411ab08450308eff51bc30fe8804ab7a0ab8 100644 --- a/providertests/google_test.go +++ b/providertests/google_test.go @@ -14,6 +14,7 @@ import ( ) var geminiTestModels = []testModel{ + {"gemini-3-pro-preview", "gemini-3-pro-preview", true}, {"gemini-2.5-flash", "gemini-2.5-flash", true}, {"gemini-2.5-pro", "gemini-2.5-pro", true}, } diff --git a/providertests/openrouter_test.go b/providertests/openrouter_test.go index 003e8f10cc15f9efec3a7bb54974a6f5c90fd673..13f117c1c156b5720faf5683e2311a98ad71d6c2 100644 --- a/providertests/openrouter_test.go +++ b/providertests/openrouter_test.go @@ -20,6 +20,7 @@ var openrouterTestModels = []testModel{ {"deepseek-chat-v3.1-free", "deepseek/deepseek-chat-v3.1:free", false}, {"qwen3-235b-a22b-2507", "qwen/qwen3-235b-a22b-2507", false}, {"gpt-5", "openai/gpt-5", true}, + {"gemini-3-pro-preview", "google/gemini-3-pro-preview", true}, {"glm-4.5", "z-ai/glm-4.5", false}, {"glm-4.6", "z-ai/glm-4.6", true}, } diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool.yaml index ddaa0858d512fb6d3bc7621b46ff650736d08e38..2c28a0f95c3e655152cf001163bd839523912aa7 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -37,7 +37,7 @@ interactions: "b": 3 } }, - "thoughtSignature": "CrwBAdHtim+wl6784Zk4lDQyf935vvgPxSmTr5FU84nEUq8ijt+y5Ajfd9AXfYybZQjoWoSaAORt4/EsHJNCd45DrAwz8UZYKIvpGgw9k5aKjLYYgw5GkRc2Cgs6uy4AlHHRIkyWMQfaxIcyV2a0Mm4aiT419RVlLd5vIVxEVHlUVawR/9Sds+EuksQP/EKQfuNaAAFXhunEQmJJiMdyGWKMhXYF+L2jMBTN9DxGpoXBiNeu4w/a32l1OTtxdog=" + "thoughtSignature": "Cr4BAdHtim/Tq8T9XkqzcvcAqMXcurtfsNWvF+glFr+dbbGawdwSHuZ7mw9Xlm6KJ8Cie6v/uKr/LuTDVu+O1FD2kHVHH63fBYS4jt0jJdUs2xRL9+TdlgkrB1SyYzciPTdvzFrtCoM/iUQhtwohV0gr+3TWRYFtuOhW/WEDzYAJFjIPMftG0Jngtz2O59EN10sdngWQaAEYu2CUaPG47rqBITRumXdfX3+0nMCNpmbjqPCpJNg93O7EhMU8gJxs0g==" }, { "functionCall": { @@ -59,38 +59,38 @@ interactions: "usageMetadata": { "promptTokenCount": 125, "candidatesTokenCount": 36, - "totalTokenCount": 201, + "totalTokenCount": 200, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 125 } ], - "thoughtsTokenCount": 40 + "thoughtsTokenCount": 39 }, "modelVersion": "gemini-2.5-flash", - "responseId": "9AcJad7SDPSGz7IPjsKs6A0" + "responseId": "c6IdafipKOX-vdIPoJuZsAs" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 3.031359958s + duration: 974.216125ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1155 + content_length: 1437 host: generativelanguage.googleapis.com body: | - {"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. 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"}}]}]} + {"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":"Cr4BAdHtim/Tq8T9XkqzcvcAqMXcurtfsNWvF+glFr+dbbGawdwSHuZ7mw9Xlm6KJ8Cie6v/uKr/LuTDVu+O1FD2kHVHH63fBYS4jt0jJdUs2xRL9+TdlgkrB1SyYzciPTdvzFrtCoM/iUQhtwohV0gr+3TWRYFtuOhW/WEDzYAJFjIPMftG0Jngtz2O59EN10sdngWQaAEYu2CUaPG47rqBITRumXdfX3+0nMCNpmbjqPCpJNg93O7EhMU8gJxs0g=="},{"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. 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"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -106,7 +106,7 @@ interactions: "content": { "parts": [ { - "text": "The sum is 5 and the product is 6." + "text": "The sum of 2 and 3 is 5 and the product of 2 and 3 is 6." } ], "role": "model" @@ -117,8 +117,8 @@ interactions: ], "usageMetadata": { "promptTokenCount": 185, - "candidatesTokenCount": 12, - "totalTokenCount": 197, + "candidatesTokenCount": 24, + "totalTokenCount": 209, "promptTokensDetails": [ { "modality": "TEXT", @@ -127,11 +127,11 @@ interactions: ] }, "modelVersion": "gemini-2.5-flash", - "responseId": "9QcJaYSCJPSGz7IPhcKs6A0" + "responseId": "dKIdabyVFsrVvdIPuoSCuAk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.487203542s + duration: 693.548334ms diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool_streaming.yaml index 7a87fe1d85b2b58db7cdcd523a2012f0ada8ae13..5c98e052a0a896638329588309362d54b893d7e1 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/multi_tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": [{\"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" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"b\": 3,\"a\": 2}},\"thoughtSignature\": \"CikB0e2KbzJ53cZQAbVmS3FT2mrSIPh4SqG9C0hmU6Af0IhPFXcFgoc5twptAdHtim8trKjd4oXwYT0oCz0ruME+ffJ75W/FCaehBo4LLnMuwRYanvHpWA8knHwPzDPADfYQCldBCzW+B2pcMTLxlHfoaaY+7mGGOqb9eyzyKxGJmmCBD80fHvEY0zNwjnLyLhrQjjLPjQOJJwpnAdHtim/XR83WyBkpOGrXLvmZ2ZNz16pdlWavvk2U+RyzJH2ca5szuZ3ZlepealN3RCzYHo2vUpwBqPKx2NGNVTfI8jUAueIO8tb/0Z+VJHpktNds5qCJgvCZUfQwN8MEWO0vMOgqww==\"},{\"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\": \"dKIdacS5OILaxs0PwvHjwQ4\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.219170666s + duration: 897.297ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1138 + content_length: 1508 host: generativelanguage.googleapis.com body: | - {"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"}}]}]} + {"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":"CikB0e2KbzJ53cZQAbVmS3FT2mrSIPh4SqG9C0hmU6Af0IhPFXcFgoc5twptAdHtim8trKjd4oXwYT0oCz0ruME+ffJ75W/FCaehBo4LLnMuwRYanvHpWA8knHwPzDPADfYQCldBCzW+B2pcMTLxlHfoaaY+7mGGOqb9eyzyKxGJmmCBD80fHvEY0zNwjnLyLhrQjjLPjQOJJwpnAdHtim/XR83WyBkpOGrXLvmZ2ZNz16pdlWavvk2U+RyzJH2ca5szuZ3ZlepealN3RCzYHo2vUpwBqPKx2NGNVTfI8jUAueIO8tb/0Z+VJHpktNds5qCJgvCZUfQwN8MEWO0vMOgqww=="},{"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"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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 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" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The sum of \"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 217,\"candidatesTokenCount\": 3,\"totalTokenCount\": 220,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 217}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"daIdacGIO4XlvdIPwJX1gAk\"}\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\": 217,\"candidatesTokenCount\": 20,\"totalTokenCount\": 237,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 217}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"daIdacGIO4XlvdIPwJX1gAk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" 6.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 217,\"candidatesTokenCount\": 22,\"totalTokenCount\": 239,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 217}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"daIdacGIO4XlvdIPwJX1gAk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.700229875s + duration: 691.66875ms diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple.yaml index 61b145b86106a29e757aa30c9d00d19037fb34bb..027c1ebd71ec40f22f7cd80712d522a7153391cd 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -42,21 +42,21 @@ interactions: "usageMetadata": { "promptTokenCount": 11, "candidatesTokenCount": 2, - "totalTokenCount": 42, + "totalTokenCount": 35, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 11 } ], - "thoughtsTokenCount": 29 + "thoughtsTokenCount": 22 }, "modelVersion": "gemini-2.5-flash", - "responseId": "6gcJafzNJPSHz7IPwvXNgAs" + "responseId": "bqIdadvABK-8xN8Plpr0oAY" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.003357083s + duration: 517.171875ms diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple_streaming.yaml index aefe99af08bd7075da0dc36131ca53960248ba7a..0ca5d57c2172285221e379693d4284ac714b3ac8 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/simple_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"Olá!\\n\\nIn Portuguese, \\\"hi\\\" is **Olá!**\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 14,\"totalTokenCount\": 49,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 24},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"6wcJab6wEJucz7IP3f6J4Qk\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"Olá! In Portuguese, you can say:\\n\\n**Olá!**\\n\\nIt's a versatile greeting that works for \\\"hi,\\\" \\\"hello,\\\" and even \\\"hey.\\\"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 35,\"totalTokenCount\": 78,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 32},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"bqIdacLAGozKvdIP5Nu3oAg\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 835.455625ms + duration: 733.998792ms diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool.yaml index cac4526545ee2c0467c9bf73a2248a7df6f4aa0d..f6f5ceb0a1952b3e69a8f10466ee2e164f06571e 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -36,7 +36,7 @@ interactions: "location": "Florence, Italy" } }, - "thoughtSignature": "CvYBAdHtim+VrL2UvucUTXguiAiFr1B+yVyHmXWGv262dyNf/DOFOwEVrAAoqSE8NbBv/nkGGVn7PkdDdEKEa+1uCDOMMa0K8FUj6zu3ZivA2JYeqY/ASmq6BnC8JMrvHObNh7KxKI7H7TJ4GzG7uoWUBuwTmmecQcN19f59Zf36Gekwa10X673O1v02WK4D2H+hGfnnNYauwrlMHjDYkruYSrb2u6QcEoLnASnW5WU9ESLGbZy0uqKMztlFvhDcoUCEPboy4p4KjUt0S/iEpjHc2bDjq+EqYS8icqu9zo2UeVREa6nPSOspkW0AGVedfMheSaeJHw4A" + "thoughtSignature": "CoICAdHtim+oSIAY8uUYR6EfmWAxA3fQg7sAam3Jw4sK1xvXAvTmomotsL1uIgSO4Kx79F3+SQ3iVydWojoLVRBdLbdc+U0K2rXqTzc739H/3nUgqnfYELuBXKYE7W5ON5r2y2LzanK4lbUpHh8M4PYAtY8yIn8wonpr1KL+Ec6ykafkiT4nGHQHmmqndKKsdkLXboxtBxeKp2ZV0aCv1NiNvuwz0kucUx1AXBTI2SUpvAEsz2BfpmJg1i3eBwHtCyuz/I7/K2hqWHsO1NY1M0mL2c+1uwRhwTO5kNJ2i5q+la5MP6GN4Un5yceWmI4LNWInHfL0PUJ1MiCkurtsFMGqNA5+" } ], "role": "model" @@ -49,38 +49,38 @@ interactions: "usageMetadata": { "promptTokenCount": 54, "candidatesTokenCount": 15, - "totalTokenCount": 120, + "totalTokenCount": 122, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 54 } ], - "thoughtsTokenCount": 51 + "thoughtsTokenCount": 53 }, "modelVersion": "gemini-2.5-flash", - "responseId": "7QcJadHhA7zQz7IP_7Hy4AY" + "responseId": "b6IdafT6Kd6evdIPrZ2kqAU" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.571397s + duration: 903.990542ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 723 + content_length: 1093 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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"CoICAdHtim+oSIAY8uUYR6EfmWAxA3fQg7sAam3Jw4sK1xvXAvTmomotsL1uIgSO4Kx79F3+SQ3iVydWojoLVRBdLbdc+U0K2rXqTzc739H/3nUgqnfYELuBXKYE7W5ON5r2y2LzanK4lbUpHh8M4PYAtY8yIn8wonpr1KL+Ec6ykafkiT4nGHQHmmqndKKsdkLXboxtBxeKp2ZV0aCv1NiNvuwz0kucUx1AXBTI2SUpvAEsz2BfpmJg1i3eBwHtCyuz/I7/K2hqWHsO1NY1M0mL2c+1uwRhwTO5kNJ2i5q+la5MP6GN4Un5yceWmI4LNWInHfL0PUJ1MiCkurtsFMGqNA5+"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -117,11 +117,11 @@ interactions: ] }, "modelVersion": "gemini-2.5-flash", - "responseId": "7gcJadaCEfODz7IP5-D4uAo" + "responseId": "cKIdaYmFE-73vdIPyu-CiQ4" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.260155292s + duration: 580.239833ms diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool_streaming.yaml index 2299795401727c522917a98af67bd834700dcdf4..031d770637138437c6f49ebfcb770e94891ea09d 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-flash/tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence,Italy\"}},\"thoughtSignature\": \"CiQB0e2Kbz2crqvruArjSlMqMOtnGgo1ZpJGsdxnVFpgkDXGtTEKYwHR7YpveubeGFUFl6exWyagY7U3zE+s9Y7i6IV2ATxSiAypzYLrsfgCAnE0VVv745LXwIuGhFLSVoJD/9OcE5nsgogT2c+MZekAXnunp1Ztd783HOezRYnCiNlm/PhtROWUGwrBAQHR7YpvE6Tr3ySQDr9r64anLJgaLwomXEzpEw2FqqYlneGDBv9hELi4tWMOq1BqdEkMgOv3lrG1pst4301q/Btd93SQYil7fCOaQELrQdaM9Rvj+qNNMuAv1E5QUSe+PUl/nFQGBiPdIRkm6vsT8k06Gj7RdDhON/o5ZD7b8ewDdpc0Net5w0TxFwWwtt6BqOeKPzUJUW+dbXIS35xQKFb6iz/DeTr2S6zTi6IhdAcyQOG5k6vUfoAz4kgjReFT+gc=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 15,\"totalTokenCount\": 123,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 54},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"7wcJaa_5GJXlz7IPuaWZsAw\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiQB0e2Kb5hLxW4oJvRVAtEyLSHknL6TrwoTlUrzV/NIKu+R2z8KYwHR7YpvSN4fng8omWFL8Aqjsl9X3H+kgDzmS7IrsQLTYrFyl7mDqVImhz66isD523DqKjTNM+VDowi7QGeoVmSGy4+iDSNmK4JMcn8hMxHExBdm1BDyf2m5oXW+6Q2hVWscoQqJAgHR7YpvKGTVtc/SBxH4DcGgHUE2vbnfSF8icr79c/9Z4JUVIM8e3vDxVSlSoXqSyOBIjCYx75OWcokqKhKSbksYQhgWj2OBK4yqkjgDn4Ei6a3mO4m1B+fCX39c73spRSK+0RCGfPdkmL0iTB+lTB4QjKZZGqjEe87oL4rt26ZlndfpPRmdqqqdC4MVnRDqXOO4xrSr4A+n27MCr/mzu0FGg2ld13WUuu42nvb+pSgIoQC1ARz5CsDhTfXp2vFywCpbFzK1w61QJSgyjcBph/SljYIVLLwcY8uaWr1ZLIc+6sdZU9g3n2jlZ/HIR9zc62qdIcdLWLaqfuRKfRQXykjOAJwwMziZ7ncKIwHR7YpvVfOT+ooTKaMyWqreuH0LElgmp0tV5T5M+SoXjTTp\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 15,\"totalTokenCount\": 139,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 70},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"caIdad66Iaq-vdIPlaK54Ak\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.557144s + duration: 1.638936291s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 722 + content_length: 1337 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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"CiQB0e2Kb5hLxW4oJvRVAtEyLSHknL6TrwoTlUrzV/NIKu+R2z8KYwHR7YpvSN4fng8omWFL8Aqjsl9X3H+kgDzmS7IrsQLTYrFyl7mDqVImhz66isD523DqKjTNM+VDowi7QGeoVmSGy4+iDSNmK4JMcn8hMxHExBdm1BDyf2m5oXW+6Q2hVWscoQqJAgHR7YpvKGTVtc/SBxH4DcGgHUE2vbnfSF8icr79c/9Z4JUVIM8e3vDxVSlSoXqSyOBIjCYx75OWcokqKhKSbksYQhgWj2OBK4yqkjgDn4Ei6a3mO4m1B+fCX39c73spRSK+0RCGfPdkmL0iTB+lTB4QjKZZGqjEe87oL4rt26ZlndfpPRmdqqqdC4MVnRDqXOO4xrSr4A+n27MCr/mzu0FGg2ld13WUuu42nvb+pSgIoQC1ARz5CsDhTfXp2vFywCpbFzK1w61QJSgyjcBph/SljYIVLLwcY8uaWr1ZLIc+6sdZU9g3n2jlZ/HIR9zc62qdIcdLWLaqfuRKfRQXykjOAJwwMziZ7ncKIwHR7YpvVfOT+ooTKaMyWqreuH0LElgmp0tV5T5M+SoXjTTp"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": 84,\"candidatesTokenCount\": 4,\"totalTokenCount\": 88,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 84}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"8QcJadawA56gz7IPnsmG-QY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 C.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 84,\"candidatesTokenCount\": 12,\"totalTokenCount\": 96,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 84}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"8QcJadawA56gz7IPnsmG-QY\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The weather in Florence\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 152,\"candidatesTokenCount\": 4,\"totalTokenCount\": 156,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 152}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"cqIdaf_pKt20xN8P1r_twQg\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 C.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 152,\"candidatesTokenCount\": 12,\"totalTokenCount\": 164,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 152}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"cqIdaf_pKt20xN8P1r_twQg\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.100343625s + duration: 744.812791ms diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool.yaml index 12b3001846eec1b09473fee3b9aef9f25a017eeb..bc03680e1443312acedc771592725ee73e0a87b2 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -37,14 +37,14 @@ interactions: "b": 3 } }, - "thoughtSignature": "CpECAdHtim+6+kabSNJ55G1aHXgyrJEt4/hov4uGHkcSqzlgfBd4clna+c9UpSL1rvSqMOb2E8NohfunKGm4ZHHOX9X+dBKww0ekyLz+83CF28LbsOzDHrPtIiRYoDaL/75h/HzhboaPK+aunAUglNLxM/b5yrr2tT0jKvz4LzuymTYHCpzBCcoIecoeuT0RO/WaUsjB8CMRGxnigv2XtuFkBxxzk2OWPmhSM6KTeIQTVe0d3T4HjKe2L76XG1WeaV3weeMxeCyrqX4ycxH2fJ1h5cG5EONLNxqA9eHREWu/j5ABiOGxZv2ih6xU/xyo5apwpLAwVSYtyDKXiTH4T6Wp/V7t8E7Urj4smOABFupCATUl" + "thoughtSignature": "Ct4DAdHtim86WQIPk3bh2XALNHL2XEV9TyeNz9k+Z06RPzFlt9c10RhGIIiLApE4rqlKdDjjly0ZJY0+UYfFkA1ZnAYgz8v/GnqX822cM936bMf2yQ3BLMQn9KYN2iabIhiS0wy9eF2MYE/xjlaYrAfH6Ek6/gmyTSjmstOU0/ipD+XcmqRiryIEEDINK4SjFK4aGAy6pkVYtNPT/1mm5l01Nr8b6IJaPq5YyPTHud14tw0ZnJaqff0TfM4t0NLYV0cgFTCR9phlWyR2ByE0xLigMSVOwNqWow4JPanV4CmxliGwuzJzrhhc7Olc9oIX0CVE8sLJwgH2I4lCUBx4g2JxvLI4flrY4d3nVbAbOtjLgAB0jQO24VL1tjRM+N/TP1KcdGKMhqLvv8TPAuKLsuoreI70Ggfph0ZstnQt/CgRIrvdG1q1j6+3S5H9l+5OL1JHwqPNfEcxawFtWbE1etM0EHXG0c1lRa090y+e2lLMDxNUyiUXl9UfLeQR0dCWqW+lL98DBYpT8eVF4VUCaxKR2uDlKuoBrP9KchziKXh4W61Guj3dGXSOQvo3UrQXna80k0rcIWnJ93Ri2/b6zjWUJoGPPr74qAID2ld3dA4DwsSG2oaVZ9SkDuO1RfdkUA==" }, { "functionCall": { "name": "multiply", "args": { - "a": 2, - "b": 3 + "b": 3, + "a": 2 } } } @@ -59,38 +59,38 @@ interactions: "usageMetadata": { "promptTokenCount": 125, "candidatesTokenCount": 36, - "totalTokenCount": 234, + "totalTokenCount": 292, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 125 } ], - "thoughtsTokenCount": 73 + "thoughtsTokenCount": 131 }, "modelVersion": "gemini-2.5-pro", - "responseId": "DQkJadesHOWzqtsP98mO8Ao" + "responseId": "kKIdaerxBqH6xs0P87WrgAk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.444643917s + duration: 2.442287917s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1155 + content_length: 1821 host: generativelanguage.googleapis.com body: | - {"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. 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"}}]}]} + {"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":"Ct4DAdHtim86WQIPk3bh2XALNHL2XEV9TyeNz9k+Z06RPzFlt9c10RhGIIiLApE4rqlKdDjjly0ZJY0+UYfFkA1ZnAYgz8v/GnqX822cM936bMf2yQ3BLMQn9KYN2iabIhiS0wy9eF2MYE/xjlaYrAfH6Ek6/gmyTSjmstOU0/ipD+XcmqRiryIEEDINK4SjFK4aGAy6pkVYtNPT/1mm5l01Nr8b6IJaPq5YyPTHud14tw0ZnJaqff0TfM4t0NLYV0cgFTCR9phlWyR2ByE0xLigMSVOwNqWow4JPanV4CmxliGwuzJzrhhc7Olc9oIX0CVE8sLJwgH2I4lCUBx4g2JxvLI4flrY4d3nVbAbOtjLgAB0jQO24VL1tjRM+N/TP1KcdGKMhqLvv8TPAuKLsuoreI70Ggfph0ZstnQt/CgRIrvdG1q1j6+3S5H9l+5OL1JHwqPNfEcxawFtWbE1etM0EHXG0c1lRa090y+e2lLMDxNUyiUXl9UfLeQR0dCWqW+lL98DBYpT8eVF4VUCaxKR2uDlKuoBrP9KchziKXh4W61Guj3dGXSOQvo3UrQXna80k0rcIWnJ93Ri2/b6zjWUJoGPPr74qAID2ld3dA4DwsSG2oaVZ9SkDuO1RfdkUA=="},{"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. 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"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -106,7 +106,7 @@ interactions: "content": { "parts": [ { - "text": "The sum is 5 and the product is 6. \n" + "text": "The sum of 2 and 3 is 5. The product of 2 and 3 is 6.\n" } ], "role": "model" @@ -117,8 +117,8 @@ interactions: ], "usageMetadata": { "promptTokenCount": 185, - "candidatesTokenCount": 12, - "totalTokenCount": 197, + "candidatesTokenCount": 24, + "totalTokenCount": 209, "promptTokensDetails": [ { "modality": "TEXT", @@ -127,11 +127,11 @@ interactions: ] }, "modelVersion": "gemini-2.5-pro", - "responseId": "DwkJadePAt-kqtsP1JHw4Qo" + "responseId": "kqIdaYyhHaq-vdIPkaK54Ak" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.534345s + duration: 2.379932167s diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool_streaming.yaml index c24392b3fc4d68a3b684524a37968ca162bdd09f..ca92c65f739b8e83f28376f8264cdc63d50ad196 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/multi_tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"a\": 2,\"b\": 3}},\"thoughtSignature\": \"CiQB0e2Kb7YEHMMkoQRSJ8gl7diEFXH31v+YNVPBgn7Qtq5Q9tAKXgHR7YpvCHB+KkeNMUCYvgK7uIfdunfNo6dC/sm2CTPUVk8Y9SsZst/Ipa15nFNzHnQU6lXU67A+gXcP7IgDthFY1p6SEuJN1Sgj9rwmCeEq6kPdII9o5gHfR25JqCcKhwEB0e2Kb5be8OfcikkDenpA8Tfej3kLugRApjKWRQC9ZoSk+H/3aRr+YSVBKSG3EKShFvAYvznsL4VuGsTHmISw+sHn4iqx2aHXfcvM/FonIXAhpFj+Rx9sVbPFKmvwVrJQSdkrP/oZsnik5QLU6YmZGQwq8nsDSGE+ehZyxt1sn31UmZ550nMKhwEB0e2Kb9Zfe/KOVtjjcxnNw4bWeoN8Ned3X7uc5ZGiHnJzANGTAD2LtJFZ3mx9eBg1KY8p8bE16ge4j0fYuqQ5KGdRZlFM2IRhZiZhU5hA3kqKHQ4d7Xl/l60vYaqWk1Ltq/buI8nNidBqPuL+eNEdmNnT+FBjqSs/qlJjwmsJIJv190jvNYYKcQHR7YpvTIinJMqJP1u8F3T5UbZWmkFxNCLaGcQaK0QrO/t/0LyGZ7PNxGI93hhH7ugwRTnY8bkhwHX9FxPN14iXH3BIH+zM6AtHujB/GflOnPuQA5ajiP4pFUVzDIkYvQ8zNF3s9RgXlidKinBjdRJqCmcB0e2KbxdxtRBpbJBkeMiGIkip38hrib1I5Av3Z6M6dZY9lYDfhiVkkrvKwH2jlHXoSuvvVKOODKn0zVjxDUiX44YwBW8g/pkHnXh75VV6hFHZrpMxrbY+zQrsyUc6GvZSaDfRQuwGCmUB0e2Kb3PgxUrdsmkoQoW9nR0cddrdGf7qXbsrfJcVNrYQSG98MyfrNE4dnCSv436w6vealuhuZ0sVzX+eJ60JZs/QbM+SBAu6lLq02ZI9EO9aLsRptu6qVKAMuPo21p4oo3AiPQqNAQHR7Ypvazjl2/Bd1fxqrgZoJX6D6cpjxbtFc/WUkG8DHVBgsNGIc6SuGZtpyGmBumS4Qqt5T9AKiqHZuDBpvT3lYxL/gdBTIhm9eV7Lpi4muJHXKBd5T3xJBtirPTKqYXipwY3pDJdVjmamtwwtPEweoGH8QhUlUun1TrCnKSmVeFUeQ5tsic0JmWHPLwpLAdHtim+u7mTVPrKiBQ19RuwEyvpVDukizW1OuKNuvk85x3lbXD0QKe7dlLDgOQ+QhCXgG9uJX7qgym3Vc07IXCesWLiZXexPp1DhCoIBAdHtim91yPaGEBRTahfNFiS4v6MCLHB25jpUB09aWVefv7uilMC8nzrW0QEbk0X/bdFw64ADiBOI0MqGM7iww/iQW+GkFgVT3O9TqY9vC0NeP93Eyl+eVQ+HiRSI3qfmcUfr8q4vHmkS3jYGxCKBKxblTgKojYhbXsk0mvoEt8Ce6wqAAQHR7Ypva//b8KLGbnZeCVZSY6H3673S0wLkv8AbX9QP+BFkqafi918kQ+Ilak7gl89tR1kHqywtuip3zw8iFA5NM/S7bt6wSqMhIBaasm/IaNLvnu4pyrY177iEiMslFe0dDnjwS6X2pscpN/uQONYOnFT2qex9JunYEmLYH0+8\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 121,\"candidatesTokenCount\": 18,\"totalTokenCount\": 371,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 121}],\"thoughtsTokenCount\": 232},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"fAkJaY3xA9zVz7IP4bms6Qk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"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\": 389,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 121}],\"thoughtsTokenCount\": 232},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"fAkJaY3xA9zVz7IP4bms6Qk\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"a\": 2,\"b\": 3}},\"thoughtSignature\": \"CiQB0e2Kbx/zJCGX4QRM1YjdG/0vM0O4q138GSgP9DFjPo5BvxgKXgHR7Ypvpmm3CK4gVVZtV0AvJ5MhonziwhvNMCDxg+jdrww42W8UHrTuM1cvExKrM1WsQkHnTo1PUMcUH9Ju006B1GZbgQvs3J8svt8NYJgh0WNDt8UHPO6b6VGSss4KkQEB0e2Kb68CHsB09XAnHX229MS+YrPraiD8fPqMxVLLkc2FuCR5+fI7A+kzP91qGr92hzdvYlksVeLRy5a5n1LEQmnxxFXtY8xsKDaBXDUlIvdK7VEUb60Gn9vss03eABVgI6cmwR46HFzDAvSwsl3sWtP2U4qoHTTNZ4Dt36pl/S4nxB7Lp14pcLP7sOLZkowTCoEBAdHtim8Pb7C65eIUdYFOqURU6C1ur0uJa+zVoM2/bIsSO8LXUpvdLcOM6mPhIxLisPAwhhk35D3vgnRW+luq0e8A0VsKo6AhR0NAsIN3IQnC0+vreFuIzaCYOpNuHlYXjNVbfX/CbLHsIF0+waFfbkF2ZO3GFOji0b0BTsrXoheuCo4BAdHtim8nuIkYXJNfCkRLNH8/SIGCEBIFitZzjcwzbfOLkNm/ibVwVYY8D838Gii33aJN1DyuxE4k3A+c0W8pe/YXPkdV9SXSsQ+N8KDwKRNjgjpog9psIBwG+7GfNkk3ImBvN1NwptAWKOgk5AO4dt0K7aGzWpdN+a8CfHlIjv3SKlt8AHvS82uRqv235QpmAdHtim9SMTkv6plfjBrsVRQqxAgl0jx8LVeR230NGsiTtc79hjGV1U/s2pDAdJDZp717tUJ0qL7L222pR5YbwtxqZZKBUl/ouOKOaYbZwXfuVAfL6U22ByxWWzjqXv360BthO8IVCogBAdHtim+nET8Gb9Oab/o8GshmXqUY2b7baafXDOcauibkZcx71dgfKxCnCm22wy1rTGG1Nz0nsJTPsAn2cVw+8XcWqSzpwDTRlxqnLu4/XoxjgE2nWADt8xTOgp5wFd4nw9tIs+5G2ApE2wCpRZ2cVWo2m/3onEfP9+GUJutE5YEzyXgThr7nGgpOAdHtim+uYwn7607G/Pg+uC0cCWm7SJZxDYhohc40e5tqDXxIXfixJ5CYUiKURKX658TamimYkiBr8FGZs2XkdMKkn1gFbQj4tZjpHu+R\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 121,\"candidatesTokenCount\": 18,\"totalTokenCount\": 308,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 121}],\"thoughtsTokenCount\": 169},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"k6Idad-8PLLUvdIP9tDr8As\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"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\": 326,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 121}],\"thoughtsTokenCount\": 169},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"k6Idad-8PLLUvdIP9tDr8As\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 3.95219825s + duration: 2.96572975s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1138 + content_length: 2336 host: generativelanguage.googleapis.com body: | - {"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"}}]}]} + {"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":"CiQB0e2Kbx/zJCGX4QRM1YjdG/0vM0O4q138GSgP9DFjPo5BvxgKXgHR7Ypvpmm3CK4gVVZtV0AvJ5MhonziwhvNMCDxg+jdrww42W8UHrTuM1cvExKrM1WsQkHnTo1PUMcUH9Ju006B1GZbgQvs3J8svt8NYJgh0WNDt8UHPO6b6VGSss4KkQEB0e2Kb68CHsB09XAnHX229MS+YrPraiD8fPqMxVLLkc2FuCR5+fI7A+kzP91qGr92hzdvYlksVeLRy5a5n1LEQmnxxFXtY8xsKDaBXDUlIvdK7VEUb60Gn9vss03eABVgI6cmwR46HFzDAvSwsl3sWtP2U4qoHTTNZ4Dt36pl/S4nxB7Lp14pcLP7sOLZkowTCoEBAdHtim8Pb7C65eIUdYFOqURU6C1ur0uJa+zVoM2/bIsSO8LXUpvdLcOM6mPhIxLisPAwhhk35D3vgnRW+luq0e8A0VsKo6AhR0NAsIN3IQnC0+vreFuIzaCYOpNuHlYXjNVbfX/CbLHsIF0+waFfbkF2ZO3GFOji0b0BTsrXoheuCo4BAdHtim8nuIkYXJNfCkRLNH8/SIGCEBIFitZzjcwzbfOLkNm/ibVwVYY8D838Gii33aJN1DyuxE4k3A+c0W8pe/YXPkdV9SXSsQ+N8KDwKRNjgjpog9psIBwG+7GfNkk3ImBvN1NwptAWKOgk5AO4dt0K7aGzWpdN+a8CfHlIjv3SKlt8AHvS82uRqv235QpmAdHtim9SMTkv6plfjBrsVRQqxAgl0jx8LVeR230NGsiTtc79hjGV1U/s2pDAdJDZp717tUJ0qL7L222pR5YbwtxqZZKBUl/ouOKOaYbZwXfuVAfL6U22ByxWWzjqXv360BthO8IVCogBAdHtim+nET8Gb9Oab/o8GshmXqUY2b7baafXDOcauibkZcx71dgfKxCnCm22wy1rTGG1Nz0nsJTPsAn2cVw+8XcWqSzpwDTRlxqnLu4/XoxjgE2nWADt8xTOgp5wFd4nw9tIs+5G2ApE2wCpRZ2cVWo2m/3onEfP9+GUJutE5YEzyXgThr7nGgpOAdHtim+uYwn7607G/Pg+uC0cCWm7SJZxDYhohc40e5tqDXxIXfixJ5CYUiKURKX658TamimYkiBr8FGZs2XkdMKkn1gFbQj4tZjpHu+R"},{"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"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 181,\"candidatesTokenCount\": 1,\"totalTokenCount\": 182,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 181}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"fwkJacCiGJCHz7IPz96n6Qo\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" sum of 2 and 3 is 5 and the product is 6.\\n\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 181,\"candidatesTokenCount\": 18,\"totalTokenCount\": 199,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 181}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"fwkJacCiGJCHz7IPz96n6Qo\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 181,\"candidatesTokenCount\": 18,\"totalTokenCount\": 199,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 181}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"fwkJacCiGJCHz7IPz96n6Qo\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 348,\"candidatesTokenCount\": 1,\"totalTokenCount\": 349,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 348}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"lqIdafyeNI7WvdIP2uCBoAw\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" sum of 2 and 3 is 5, and the product of 2 and \"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 348,\"candidatesTokenCount\": 19,\"totalTokenCount\": 367,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 348}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"lqIdafyeNI7WvdIP2uCBoAw\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"3 is 6.\\n\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 348,\"candidatesTokenCount\": 24,\"totalTokenCount\": 372,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 348}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"lqIdafyeNI7WvdIP2uCBoAw\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.093789375s + duration: 1.420692s diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple.yaml index 3f549c7cd16f69d5f27405f763ee76f78103bf6d..409caf5eaecc3d0549c78b813789b6a9b9d14d81 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "Of course!\n\nThe most common ways to say \"hi\" in Portuguese are:\n\n* **Olá** (This is the standard \"hello,\" and it works in any situation.)\n* **Oi** (This is a more informal and very common \"hi,\" especially in Brazil.)\n\nYou might also hear people greet each other with:\n\n* **Tudo bem?** (Which means \"How are you?\" or \"Is everything okay?\")" + "text": "Of course!\n\nThe most common ways to say \"hi\" in Portuguese are:\n\n* **Olá** (oh-LAH) - This is the direct translation of \"hello\" and can be used in any situation, formal or informal.\n* **Oi** (oy) - This is more informal and very common, just like \"hi\" in English.\n\nYou can also use:\n\n* **Tudo bem?** (too-doh beng?) - Which means \"How are you?\" or \"Is everything good?\" and is a very common way to greet someone." } ], "role": "model" @@ -41,22 +41,22 @@ interactions: ], "usageMetadata": { "promptTokenCount": 11, - "candidatesTokenCount": 94, - "totalTokenCount": 802, + "candidatesTokenCount": 122, + "totalTokenCount": 849, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 11 } ], - "thoughtsTokenCount": 697 + "thoughtsTokenCount": 716 }, "modelVersion": "gemini-2.5-pro", - "responseId": "AQgJabbjM5rQz7IPgq_yiAc" + "responseId": "fqIdabztHPjXxs0P146HoQk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 8.976729125s + duration: 8.426214208s diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple_streaming.yaml index 8144a25b2e87d4a3a36e5ed2108d470c2ac9c14a..d384ea4d4ff84b4e29871590ac1656ed32c5f67a 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/simple_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"Of course! The most common ways to say \\\"hi\\\" in Portuguese are:\\n\\n* **Olá** (Hello\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 24,\"totalTokenCount\": 972,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 937},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"AwgJaevdBYDVz7IPnYmg4AY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \") - This is a universal greeting that works in any situation, formal or informal.\\n* **Oi** (Hi) -\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 51,\"totalTokenCount\": 999,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 937},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"AwgJaevdBYDVz7IPnYmg4AY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" This is more informal and very common, especially in Brazil.\\n\\nYou can also use greetings that depend on the time of\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 75,\"totalTokenCount\": 1023,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 937},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"AwgJaevdBYDVz7IPnYmg4AY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" day:\\n\\n* **Bom dia** (Good morning)\\n* **Boa tarde** (Good afternoon)\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 99,\"totalTokenCount\": 1047,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 937},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"AwgJaevdBYDVz7IPnYmg4AY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\\n* **Boa noite** (Good evening / Good night)\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 112,\"totalTokenCount\": 1060,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 937},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"AwgJaevdBYDVz7IPnYmg4AY\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"Of course!\\n\\nThe most common ways to say \\\"hi\\\" in Portuguese are:\\n\\n* **Olá!** (\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 25,\"totalTokenCount\": 645,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 609},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"gKIdacu9Ct_UvdIPu_e3-QY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"This is the direct translation of \\\"hello\\\" and works in any situation.)\\n* **Oi!** (This\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 49,\"totalTokenCount\": 669,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 609},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"gKIdacu9Ct_UvdIPu_e3-QY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" is more informal and very common, like saying \\\"hi\\\" or \\\"hey.\\\")\\n\\nYou can also use greetings based on the\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 74,\"totalTokenCount\": 694,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 609},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"gKIdacu9Ct_UvdIPu_e3-QY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" time of day:\\n\\n* **Bom dia** (Good morning)\\n* **Boa tarde** (Good\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 98,\"totalTokenCount\": 718,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 609},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"gKIdacu9Ct_UvdIPu_e3-QY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" afternoon)\\n* **Boa noite** (Good evening / Good night)\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 115,\"totalTokenCount\": 735,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 609},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"gKIdacu9Ct_UvdIPu_e3-QY\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 8.933529709s + duration: 7.118728083s diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool.yaml index 67e93be38eef9182fbe553a138d08e4245b37a6d..3042c2ee8b56c3ef18eff7246d7a91faf030f7e2 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -36,7 +36,7 @@ interactions: "location": "Florence, Italy" } }, - "thoughtSignature": "CoUDAdHtim8N4HKZPr0LvOdoOCBZCvZIDq+277VOB/Ee7dBu8J4m0pT+8u9m55SqUFvQcQVSxjJEIvR/o6eUzbeSKwJ9s9MgEnQoNXUktpSUuiJ7HJhdapcQnZbCRPrcs+zdqSQGdXHdpjRguIVDRG+r5GnD40lYk1AurV31uEe6Jpox1MIfPxNOLnhuVDwjhAv2zqW0e6hf9ZtmlXk6qtIoLOnFxRAAx2NqZYA22kkoA0s0DtSTAUDQTMr+NrXTbOELd3ZeVjLBsWutkYNwIRWAnzNJ1il3A8xbmEh8YL4Uy+nH48ROgams6PCuxtxTEyOk0sAOKQkfid1STQfDO3VAoB4ne7cgNDh80y1fAo/5cXSGkeMPLqgyZr2jeIx7lWWWDaOHw/ieZDTaJGInBy5blOEkWxKl8mKKgAbvALOEFCdVDwFN+maw17w/Y0FtKWgk8zrdsM8naF/mBtGkulhMDoqjB0XNcIihur24NuD8vyifQl+s7MkkdctYLxdSXVFhfiB5D8w=" + "thoughtSignature": "CtcDAdHtim8sltjSbCOxCM3sW652tUKKCiplDIoViEhKUuXpAUkg8vvhGpNwIBQdUOU091dd13FYdNYoTg/N62xtEIbin8xsVkDAhEBNTyciVa1cUORxFwTjID5b4z8/byy0Zf/e6sbKXMxbf9BpAVMHQW0mF6Yz82BQsczMi3B00lOO+0VV82ClVs4tBXYf7o3kekAAVD+XGCfuB/YGr9V6CeJCMXc8+gVpLIFS4DaPlNMoG3Lv4PnZp4beJ4puuIxh+3ipmGv8hJKAwUFAZmuU/knnUMqc09ddXtJdPKyssWbuR51SIU49+eVtxOib43fUOILlOO+J0oukfCSt2JS6EuVVSNYDMC7HOUkkY9T7V9IbCEtiuL42gvWbCAEwbta/QuGH1L9emajt2yiX+bIcuCl3GuRU0wQ/AB4mMBFwmnATUiaEKAmtSpiSvHy20SUHMh/KPNEOfQ0J6IyBWWhKhEaiAezRaKZSao6g68ymM5xOAyY0Vkrq3pWeUjboR9Z65I/tKiE2Qs6PuQJWI1sL67D9a885x10iR6NpaJyETpOYqGDqjZ3zs8ZiibLy0iitwibDwXzJyCLrJzEoTRmtotxoSkTm2wQVUpVpQzZBl4pzMbY2CRoR" } ], "role": "model" @@ -49,38 +49,38 @@ interactions: "usageMetadata": { "promptTokenCount": 54, "candidatesTokenCount": 15, - "totalTokenCount": 162, + "totalTokenCount": 181, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 54 } ], - "thoughtsTokenCount": 93 + "thoughtsTokenCount": 112 }, "modelVersion": "gemini-2.5-pro", - "responseId": "DQgJaczjHfHAz7IPo92A4QY" + "responseId": "iKIdafbaFtX8vdIPueXoyAk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.028702667s + duration: 2.134031542s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 723 + content_length: 1377 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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"CtcDAdHtim8sltjSbCOxCM3sW652tUKKCiplDIoViEhKUuXpAUkg8vvhGpNwIBQdUOU091dd13FYdNYoTg/N62xtEIbin8xsVkDAhEBNTyciVa1cUORxFwTjID5b4z8/byy0Zf/e6sbKXMxbf9BpAVMHQW0mF6Yz82BQsczMi3B00lOO+0VV82ClVs4tBXYf7o3kekAAVD+XGCfuB/YGr9V6CeJCMXc8+gVpLIFS4DaPlNMoG3Lv4PnZp4beJ4puuIxh+3ipmGv8hJKAwUFAZmuU/knnUMqc09ddXtJdPKyssWbuR51SIU49+eVtxOib43fUOILlOO+J0oukfCSt2JS6EuVVSNYDMC7HOUkkY9T7V9IbCEtiuL42gvWbCAEwbta/QuGH1L9emajt2yiX+bIcuCl3GuRU0wQ/AB4mMBFwmnATUiaEKAmtSpiSvHy20SUHMh/KPNEOfQ0J6IyBWWhKhEaiAezRaKZSao6g68ymM5xOAyY0Vkrq3pWeUjboR9Z65I/tKiE2Qs6PuQJWI1sL67D9a885x10iR6NpaJyETpOYqGDqjZ3zs8ZiibLy0iitwibDwXzJyCLrJzEoTRmtotxoSkTm2wQVUpVpQzZBl4pzMbY2CRoR"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -96,7 +96,7 @@ interactions: "content": { "parts": [ { - "text": "The weather in Florence, Italy is 40 degrees Celsius. \n" + "text": "The weather in Florence, Italy is 40 C." } ], "role": "model" @@ -107,8 +107,8 @@ interactions: ], "usageMetadata": { "promptTokenCount": 84, - "candidatesTokenCount": 13, - "totalTokenCount": 97, + "candidatesTokenCount": 12, + "totalTokenCount": 96, "promptTokensDetails": [ { "modality": "TEXT", @@ -117,11 +117,11 @@ interactions: ] }, "modelVersion": "gemini-2.5-pro", - "responseId": "DggJacXrMP2Hz7IP-sawqQ0" + "responseId": "iqIdaYfpG6_9xN8Pgt6ymQk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.309785584s + duration: 2.067662125s diff --git a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool_streaming.yaml index a0d5a005c20056c231b0b6ea3acd4b64be11e47a..ec87ed3592d38ccadf3af72289ecdfb57d4a2ef7 100644 --- a/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/gemini-2.5-pro/tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiIB0e2Kb7ZcJkyUiaPtH3M3XggxlaO8JZtcKU9zLre7wKgQCmcB0e2Kb2HHioOSolufbR8pcO7tHiyzUuAt0Vqb4LlW+Tsams8t8fV+T0AdZB0/DS5Bs+r+HQQ7GmlMZWKnkD5vJ9hsVgwBYCTKNac3MRqX1+dpyLkds0/xz1HSWguzVr3SIRNoAjhjCocBAdHtim82kbjYM3Dq3Qt0NEXxM8EbhYC1KJSlX17jyJxBS1vHRhBntdFDNCI3zUPbGhoarro3rXP12N1scFycrb4Myge6i7GZe0sDjWdRCTSKVADuyilxlenEJfb5AnljkrhQoIFyx818hCCxm7X5mxY3RD3wms+53yj5Oyj/4ew5wEOSbp/LCoABAdHtim91iCFyONBMwXNE3JZlMZdLWjS0eGqZjcEPktz2HnnQBfuAVjqifSQ/lDWa0WRBNEU8JpPyOJ1lQNW7jWkpUwVP1lvAWQ6CgJfhMgjjhs4goAdM+UAA5JB7J07NUzCfhd7Ys5w6e9lETfKxT/mLJFjBTfq8fhuFqrGjPwwKjwEB0e2Kb6yOTeDKt+aXIpxo6OsQ+ZuMc1a7BrfFDWzEGh/OvCZWjZtRaL0tYxZTuJmtc4w7xOS9MCFyCba8Wqh4tUkS2WEt6d+h8YVuxJD7Xjilz4SLZD/pIVVsUZ57NEwEub3HuZ/5CVEmrPpS3l+FnSv9//nqX/VOInF+GEwOL7Q1JJlbcB0ju1a6bXtUPwpfAdHtim/b5wZO5F672H0vefXf7tdKQYVkDWLoDm1YWZL1bEPXl9HoCrjQT+tkGqp6qM9nvgVNIe0ln/zzDx7qo99ySIa8+2JHnCNp52v2g+NHI/O5C8GBCuKZ+9gudFM=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 15,\"totalTokenCount\": 181,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 112},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"CAkJabHRHcvwqtsP2KaMkAc\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiIB0e2Kb8A87l6fcJFqiyFOsaqJQbuIyvqWWGMyVLlvR5BOCmcB0e2KbzIGGc8QCp2X4zQ5F7dQvkx1zJbHigOjmr6JMhp1opsOUlDm2O34WqYMy1TooaTT5N/h3ufeU3dl5Ss2qP6omWLzzoF4kXUCbwcvIgTiqDayYrPfwHx93XC7rU1nG4aTBIMtCocBAdHtim/dvxkuVr2NRUIhqXz/yVDiYbflnMhp6AqlkPkqChqNrP6BOzT5kw9Vh6cx8NrTCTdd+oqM01fXQC+EuV4nD52dDrViwxVoMmiObnjvL1kdkMN+mlXsdwQMXbbZuZG0KwY5baJR5OKgTlXW7nOgzjYo2iEGk9g5V6jF6F0ZBCKMUWWcCoABAdHtim/3KIej0FWXxbVioSBF/JIkCmmTHOFTT+1/VNK1YKl7nZ6e6OarSZ9Q1Qam4bf5Aw4hg0JmRPI8UpB3SrFva3dkfHceyPIWBbjtmIEawNZaSnCv+oYXJGdQze8bUSZ3bD6HnDhju2eLNqRzVEAkYwCQPD8DjmAbGPdN4j0KhAEB0e2Kb0BS3VRBfKzWnObbM9W8DaK8rHpUWYE/gUfOEHEWQTT4cJe2ilhneXgGffnK24wYtqIbyGnbZnBcpkifQHhTJAz9tEAToRfckSr2qiDdyxlxtmuzLopPgjWLTO4S/hNAKKOrkcZkyvkfQaEPnvoDNutWb5GNLs8RkAkUeXTzlbcKYgHR7YpvgZXPWWUaxQ3ehM2VoAPQ6RV2cQHT+95ahkTE6PzT2PKJ/m5dgAohTAX7NEsG74SOFrdZWtnspq9T23ebHIyyxwyTbsmmzaxsPw/nEI2KpAfc+brA0lvP740peGWC\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 15,\"totalTokenCount\": 176,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 107},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"i6IdafXaGKePvdIPj5TpsQk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 2.276958458s + duration: 1.958855542s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 723 + content_length: 1605 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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"CiIB0e2Kb8A87l6fcJFqiyFOsaqJQbuIyvqWWGMyVLlvR5BOCmcB0e2KbzIGGc8QCp2X4zQ5F7dQvkx1zJbHigOjmr6JMhp1opsOUlDm2O34WqYMy1TooaTT5N/h3ufeU3dl5Ss2qP6omWLzzoF4kXUCbwcvIgTiqDayYrPfwHx93XC7rU1nG4aTBIMtCocBAdHtim/dvxkuVr2NRUIhqXz/yVDiYbflnMhp6AqlkPkqChqNrP6BOzT5kw9Vh6cx8NrTCTdd+oqM01fXQC+EuV4nD52dDrViwxVoMmiObnjvL1kdkMN+mlXsdwQMXbbZuZG0KwY5baJR5OKgTlXW7nOgzjYo2iEGk9g5V6jF6F0ZBCKMUWWcCoABAdHtim/3KIej0FWXxbVioSBF/JIkCmmTHOFTT+1/VNK1YKl7nZ6e6OarSZ9Q1Qam4bf5Aw4hg0JmRPI8UpB3SrFva3dkfHceyPIWBbjtmIEawNZaSnCv+oYXJGdQze8bUSZ3bD6HnDhju2eLNqRzVEAkYwCQPD8DjmAbGPdN4j0KhAEB0e2Kb0BS3VRBfKzWnObbM9W8DaK8rHpUWYE/gUfOEHEWQTT4cJe2ilhneXgGffnK24wYtqIbyGnbZnBcpkifQHhTJAz9tEAToRfckSr2qiDdyxlxtmuzLopPgjWLTO4S/hNAKKOrkcZkyvkfQaEPnvoDNutWb5GNLs8RkAkUeXTzlbcKYgHR7YpvgZXPWWUaxQ3ehM2VoAPQ6RV2cQHT+95ahkTE6PzT2PKJ/m5dgAohTAX7NEsG74SOFrdZWtnspq9T23ebHIyyxwyTbsmmzaxsPw/nEI2KpAfc+brA0lvP740peGWC"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": \"OK\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 84,\"candidatesTokenCount\": 1,\"totalTokenCount\": 85,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 84}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"CgkJaaLGNMegqtsPxZji8As\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \". I have the weather for Florence, Italy. The temperature is 40 degrees Celsius.\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 84,\"candidatesTokenCount\": 20,\"totalTokenCount\": 104,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 84}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"CgkJaaLGNMegqtsPxZji8As\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" \\n\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 84,\"candidatesTokenCount\": 20,\"totalTokenCount\": 104,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 84}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"CgkJaaLGNMegqtsPxZji8As\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The weather in Florence\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 189,\"candidatesTokenCount\": 4,\"totalTokenCount\": 193,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 189}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"jaIdafjSJqTyxs0PnYinqAk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 C. \\n\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 189,\"candidatesTokenCount\": 12,\"totalTokenCount\": 201,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 189}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"jaIdafjSJqTyxs0PnYinqAk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.4362325s + duration: 1.21722675s diff --git a/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool.yaml b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cd2d444cff9964098b5510b51fcd8ebb0d739399 --- /dev/null +++ b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool.yaml @@ -0,0 +1,137 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 826 + host: generativelanguage.googleapis.com + body: | + {"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"}}]}]} + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "functionCall": { + "name": "add", + "args": { + "b": 3, + "a": 2 + } + }, + "thoughtSignature": "Ep8DCpwDAdHtim9QdO0y9bZ65Rujicbol+wCUJKbtFVKI8R2aVL5g9KNn25HRk9RQTnn6Mf/bHwNDvm17S/NkwMNRHTnsrgsFhCnID3D3UUhs2a0PJAw2qr4I2JkLlDxSarHaYQL8FkzDJCyEfaKHa4wPEFCTQL4DYtVutBbO5/f8meUiUhZxBBuKshtXWlqO0ecRIKJ1UD+wMZ0BlFGdJGYoVVpYFlbk3/MJzmKzy21oDuzYLPSpHFi79QB6QucplXCYu37zxdYlzr6Hq5aGYf2Cw6qKr5j8F85I+zX5S0MPfVdK68nuPC4qb/qYGRUhMHzb05e13X1SotaSS8hZJo+u9pUXhwrSnNbSoVZEBKC+dSqoksI6YHm89pUKA94eC++gJ1ul/HHMHrF49r1wvAKO7EUP0TBCtemyZYtVSrh0TmIkucyU9pUCzNB375Kmox8qbARrUXdlHjCkdisVqJMIZhEn34dfNah7Uc/lQj975ZR5k0zetyhnUHG7E/Blv1Nezo8rB2n4HxhTrKKLyRDXl3dtt2fDSr5UvzzZEBEiQ==" + }, + { + "functionCall": { + "name": "multiply", + "args": { + "a": 2, + "b": 3 + } + } + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0, + "finishMessage": "Model generated function call(s)." + } + ], + "usageMetadata": { + "promptTokenCount": 161, + "candidatesTokenCount": 32, + "totalTokenCount": 289, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 161 + } + ], + "thoughtsTokenCount": 96 + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "Z6IdadLwMIDXvdIPwbrDyAY" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 2.545695292s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1737 + host: generativelanguage.googleapis.com + body: | + {"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":"Ep8DCpwDAdHtim9QdO0y9bZ65Rujicbol+wCUJKbtFVKI8R2aVL5g9KNn25HRk9RQTnn6Mf/bHwNDvm17S/NkwMNRHTnsrgsFhCnID3D3UUhs2a0PJAw2qr4I2JkLlDxSarHaYQL8FkzDJCyEfaKHa4wPEFCTQL4DYtVutBbO5/f8meUiUhZxBBuKshtXWlqO0ecRIKJ1UD+wMZ0BlFGdJGYoVVpYFlbk3/MJzmKzy21oDuzYLPSpHFi79QB6QucplXCYu37zxdYlzr6Hq5aGYf2Cw6qKr5j8F85I+zX5S0MPfVdK68nuPC4qb/qYGRUhMHzb05e13X1SotaSS8hZJo+u9pUXhwrSnNbSoVZEBKC+dSqoksI6YHm89pUKA94eC++gJ1ul/HHMHrF49r1wvAKO7EUP0TBCtemyZYtVSrh0TmIkucyU9pUCzNB375Kmox8qbARrUXdlHjCkdisVqJMIZhEn34dfNah7Uc/lQj975ZR5k0zetyhnUHG7E/Blv1Nezo8rB2n4HxhTrKKLyRDXl3dtt2fDSr5UvzzZEBEiQ=="},{"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. 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"}}]}]} + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "text": "The sum of 2 and 3 is 5, and the product of 2 and 3 is 6." + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0 + } + ], + "usageMetadata": { + "promptTokenCount": 309, + "candidatesTokenCount": 25, + "totalTokenCount": 334, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 309 + } + ] + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "aaIdadm_HNiCvdIPwrjEkAg" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 1.649148834s diff --git a/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ee048e4faa3720d2c6bb2a60a2268e78d6db5b36 --- /dev/null +++ b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/multi_tool_streaming.yaml @@ -0,0 +1,65 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 809 + host: generativelanguage.googleapis.com + body: | + {"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"}}]}]} + form: + alt: + - sse + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"b\": 3,\"a\": 2}},\"thoughtSignature\": \"ErwDCrkDAdHtim+tgyYiwTOKgDBZ5Psa/ivtDDfvnlqoGDEj97rV2/GvhSSnwedTysVM5tAb6zPepWfsdb2DQy7jdoiKr4XdeSCOUS5LrLlcfBYsfeYrCJv7eDxJMNRqh8yATI6m4HrsM8xmRv4r4T+ciSH6NVMBSRiTuq5+NbIlV1EYnedFeo6Bz76LYZhbeKg0bzOG+VsUQHmyzlevfzZGkJTcDNf16mnN6ncN3dnQEtKg3NCk2KB/zhAyXLRPxBCCYLgv70NKSPAmGhs8v4Qz3vRUCy8ikYN9XGTxPFyFepS/c1N9hWFeGOUerVCmLneXn/LaXHoD5d/w54Cz6EGetOskF9jdNnkZ9SDdAUCHmrcR69A84p/v+900Oxvt39e9KMvSTuar1K+XXuDX/ba6uQoi4ZStXZJKN/oCRmyKUKHUwsUs/1PAGIOgeizxETzC/ExIx4sVeQ7/aslTLP2Dt7842mwgP+TguCkpRmSccZGSqQ6lg+KMiDmqnfYf86Q5Vu5gjqm1o6Y9lRsgsec0ZW2l2+cCuIV1/jQxfSYI3L7lPRPkmmMCZJoXAYNLH1adCMil0Pfzl6rsRGc4\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 157,\"candidatesTokenCount\": 16,\"totalTokenCount\": 264,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 157}],\"thoughtsTokenCount\": 91},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"bKIdaeD9AuPUxs0Pk8v7uA0\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"b\": 3,\"a\": 2}}}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 157,\"candidatesTokenCount\": 32,\"totalTokenCount\": 280,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 157}],\"thoughtsTokenCount\": 91},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"bKIdaeD9AuPUxs0Pk8v7uA0\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 157,\"candidatesTokenCount\": 32,\"totalTokenCount\": 280,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 157}],\"thoughtsTokenCount\": 91},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"bKIdaeD9AuPUxs0Pk8v7uA0\"}\r\n\r\n" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 2.587839083s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1756 + host: generativelanguage.googleapis.com + body: | + {"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":"ErwDCrkDAdHtim+tgyYiwTOKgDBZ5Psa/ivtDDfvnlqoGDEj97rV2/GvhSSnwedTysVM5tAb6zPepWfsdb2DQy7jdoiKr4XdeSCOUS5LrLlcfBYsfeYrCJv7eDxJMNRqh8yATI6m4HrsM8xmRv4r4T+ciSH6NVMBSRiTuq5+NbIlV1EYnedFeo6Bz76LYZhbeKg0bzOG+VsUQHmyzlevfzZGkJTcDNf16mnN6ncN3dnQEtKg3NCk2KB/zhAyXLRPxBCCYLgv70NKSPAmGhs8v4Qz3vRUCy8ikYN9XGTxPFyFepS/c1N9hWFeGOUerVCmLneXn/LaXHoD5d/w54Cz6EGetOskF9jdNnkZ9SDdAUCHmrcR69A84p/v+900Oxvt39e9KMvSTuar1K+XXuDX/ba6uQoi4ZStXZJKN/oCRmyKUKHUwsUs/1PAGIOgeizxETzC/ExIx4sVeQ7/aslTLP2Dt7842mwgP+TguCkpRmSccZGSqQ6lg+KMiDmqnfYf86Q5Vu5gjqm1o6Y9lRsgsec0ZW2l2+cCuIV1/jQxfSYI3L7lPRPkmmMCZJoXAYNLH1adCMil0Pfzl6rsRGc4"},{"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"}}]}]} + form: + alt: + - sse + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The addition of \"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 211,\"candidatesTokenCount\": 4,\"totalTokenCount\": 215,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 211}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"baIdafSbGseSxN8P7IGBoAw\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"2 and 3 is 5, and the multiplication of 2 and \"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 211,\"candidatesTokenCount\": 20,\"totalTokenCount\": 231,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 211}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"baIdafSbGseSxN8P7IGBoAw\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"3 is 6.\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 211,\"candidatesTokenCount\": 25,\"totalTokenCount\": 236,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 211}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"baIdafSbGseSxN8P7IGBoAw\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 300,\"candidatesTokenCount\": 25,\"totalTokenCount\": 325,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 300}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"baIdafSbGseSxN8P7IGBoAw\"}\r\n\r\n" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 1.385585417s diff --git a/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple.yaml b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f689e7f44b34c062925e23e06d089d11c4b15e6f --- /dev/null +++ b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 202 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"Say hi in Portuguese"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"}} + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "text": "You can say **\"Oi\"** or **\"Olá\"**.", + "thoughtSignature": "Eu0GCuoGAdHtim/zutMjuEtbqFE0m3XHTgdm//ZDW7T5jsfXf8yWoYnJdjR3t52kdvNti1XtYOu1jAkcFlOJFxXFUtkO4rqxHjYAYNZuT6ONqFVaEmdfuYQYc6qk5qMRc24mbbUGM12zKY+JI1HMUV+Wa5YOtHNz96VFcRdI0DrZ7s8uSIrVV7CuV9+FkPRxfWq+tZ4gdqP5802+dBSwciDRAFLFCKCy8ZrpJIzcqmfGQPsbqiVBb3b8qtrlC2sSOHyHQklq+F9Jgkuka25MI2FSBah3IHaSYvtAz4YIXMbEoLVaRINy4+aPKjJvzwKAzva3EzNliJnb8N+fA2O/YdPDFqx2Mt+bb+2hl5buM6Xt7RO6RJ1fL1sSyVClETJGghUtIQd5mBON6Ts7Kpg468/wzU94Y/BMUSISITeZpipEG6BCM/cn7lhLK9DeWzGYRr5sYbUOMCBQhpbAVpzL0g9U4ySEhgTpR/+uVVYlPut77WYA/L9icnoBVf3+FovhSAKzx0C76p6Bp5SGR1abD5vb/2HeOTVaSWrJa9/tIYgiZNzZ777m9ymHUW1XCjjTPGGC97HaGA1jcwcryQ5FtG3IzaJjIIYpgKH6Fi3/yQlMS6xjFvb1ADoM3qz790L5HNUcX+9qfMpw91/aMDOGBTdaldH8poQkRLEB0kZwZ2yPdT2Y4RVaZCTn7MMtcGyp9gx7kuEiB3OfW2Sb6m3yC4n8fdGOfMoNUYeQsjavRpfQ+KzH+Fv9/QyTbMZKcVjfa1/dqJ8uRq9Oq/V6w7arhWLz5iJrtWMmDjwrwbNaOPCeUfBCINspvS+Q2qq5qu84lyd/3m7Bae/Uoz+VN2AlDwllUlMrd3cQ4e6Sp6Ibi+e7TPOF4xaOiCmPuLaqPEErZeNfzvAXQ6/ft8BGPOX835DQngZC70xgZnJqNSajVUl+i5P+hCxK58zFBPLswSCRaQHWd76hC3/Tv0CgsiuyNqfkpcLbT+C8E4TIkrbMsWEk3PZ4WAn/2+r/W3R+ox9pLYge+cx6/lz4oM4WKwCKHfipXmISKxqaTsVJaNJb/PIOdfEt+eVgxBzUill5exqksKQBn4wDDpy+TEQ1E5S1i+80XWumQBVlrDHIdYh3FROkK1n/P2GBS70sy9uScTKS8YJT2kfNcpuXQpnfHaoOpQ==" + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0 + } + ], + "usageMetadata": { + "promptTokenCount": 11, + "candidatesTokenCount": 14, + "totalTokenCount": 243, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 11 + } + ], + "thoughtsTokenCount": 218 + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "WKIdaZPHHfXzxs0Pn66hoAk" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 3.97765625s diff --git a/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dd97e00299d4d8b41114e80ad16837f0ff84c30d --- /dev/null +++ b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/simple_streaming.yaml @@ -0,0 +1,34 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 202 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"Say hi in Portuguese"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"}} + form: + alt: + - sse + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"You can say **\\\"Oi\\\"** or **\\\"Olá\\\"**.\\n\\n* **Oi** is more informal (like \\\"Hi\\\").\\n* **Olá** is slightly more formal (like \\\"Hello\\\").\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 43,\"totalTokenCount\": 361,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 307},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"XKIdabjbOtH3xN8P5NmBkQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\",\"thoughtSignature\": \"ErkKCrYKAdHtim/DFrUx3uJvLE4jfIqzN3zSWBVxI1G7XuJBmEeNZJO64cM2d2681b4nCpBG1uTmz4sp1T2cNjZNYYav3OngCEWzmvzUbZz5WAYbuZPWdjZ9rn6v9xRynSfQ+kXScHJzG0XUTQzc+2OyG1haLUL62AEGBbFg04lbjPAOoUpTpDHk8BI9cW0dhbeDsdr7UFVvN8vpIA83xPQW/yuky2/J4pl70dIkFEhfJjaU2V/Ie7yRSup66ZDH5KdU+Dl5JQ43I8lPcqqoLXcDfNxUUzg/WuMzQ3PqvnbBpl9ScKNHJlEhg7909xrKrBtjX82r7vNgIaNL+k+DnWF3VowUaAS5g4g48gWfVcYECQCZXABr8UyDqC7eFn/z41eFbRI3DsiEQFozW2bdwQnkj4uZBZDyDWWN6bWgUZ9H5nyO4ah8B15UjMiy+rSrvciGdSfcF2uFUZ+IMh/bsWQrWHIudXyktiAv+/45864l8wmmSmmP/hvK6sC6C0c1xDVVCrX0EJYuTxhqR+s+p4XGXkUqn/FUp/MmImN+UJnM8zYuSKTQw1mCtODBGw3OEVvwXtWT50gG7tfz84S4VwCTlN2SjyvpniNpHDp/2qbrsXmpzywbnWsvRDiqcSj1NcHWeTgIf5zzcL6NyiSIjThhbl621mXJFXg1o2WBPXNE5JCAJ1dVAxpVoAz2FqMPGK4JEmgMDGzK0uHIHkZwHT+afM+H8ruurXQ9qCb7PNO0Js0kL2kbC/38Qoq3q2O0A320bTzeTwCpw7eJhSw5UPsxj1HBUgIiKmUgeC8lcsdqenVsF+WqxkUkpWWdDhIby0ejqZq7Yfn9I4C58AZwMKPsVt+2iHmTTv4VtZ13PFW/v2Khz04Eo5rkw/NZZ4FQUw4y+/9W4hoos5YDXpXKWugm6EfpRSr7KYw3nkVwJP/bIk+9Ex0xWau6cT9l7fwdvYEfDGJOKwH/AJzPNLAcOXhejG4s1FxSOoCesuLKsrQToFb2IWrM5eYL46hMDObTg60sHuFEMIrQu6CY2IYJ+eFtjydoKAMaPyF5evILUN8P6j6wURLakoEdIDq20UIIj6AFjLurOgauZNqHLiqmvlDr4rJubHhbGGYav43Rlpxql2rowEgsu+MSLGIan5VG+WNhAn2Z3ClFW8hqB7B/tTRAJAbgwM+MivX4wn2bua6erXVO8dihpWIVpjjNDhmUcweTHdb7h6M3Q80Gy9Yi+UPUJXWpoMq9TD/Hj4/wnDHKFChyTfGBohzQQa1onlGzg7kx2zHTBEj/9j06Po+OPpWHNpARP7RUEQKmMPkSfJLdsquumxM9w7uNypJ+KsADTfGT300tL3R6NMbQiPleQ8zREvXgq90tEhXP9kWOQJoXkeAtI4+9CuBlDUR8CxrQoz/ADVDYj46NLmGFObrDra7hCFpHgqSfi26ucScFKLFqnCYMaCj2/TbVLiXMnMPHvToiXzuKHPGn/FG/fYFagci8SraaYAUQjQGWenIlKf1zN6MlDJyZBr4QIw+Es0DdQOC7opu3Cdekila7XGENkJlr3tDXu30mjSJ29gPlM10aXwFIwapKpVe7mGMJBzyb64z8W+2ZOLOvBPQykWC55q+6NjLokqnZTh+2edxteBMfKC8IZV5OQgU9x573llLo6+ylCdgDCsZ68doHznPrrExj3zlw3yqvcBBLpVw+wiGRuAR6ZB4AEGMYCucbmJo82RnLQT4xK37zk2teE6sUoIPKEJa0cePMfaouAaRagmUJ+ylNPFFLT0N+B74=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 11,\"candidatesTokenCount\": 43,\"totalTokenCount\": 361,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 11}],\"thoughtsTokenCount\": 307},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"XKIdabjbOtH3xN8P5NmBkQk\"}\r\n\r\n" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 4.484338042s diff --git a/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool.yaml b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..714bb2d986c842771f18e343c9db2776b2c32559 --- /dev/null +++ b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool.yaml @@ -0,0 +1,127 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 509 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "functionCall": { + "name": "weather", + "args": { + "location": "Florence, Italy" + } + }, + "thoughtSignature": "EvwCCvkCAdHtim+PQmLlXBFlyn5zkH9Ulj6upBtzURUlM9dI26vPsj3LG2Q4KeqoH5XyWdqCkF+ruALELNIQ27gg7Xp6EkWYYMBus01fmwUubUKhjIu0zV/3qpAfK44Zsg9QXONIVDKMwPJxDHd4XUIehDG0y1JICa9Om9hSdrcLcelx9wRMb79NsdBWO3JRwxAfaVlmtfnCdTRBfuQ1Vzs//ZxCQr9RHWnL9Z+ZXllJNvusWfUVEsyY288zIkOb4EJElnK7vto2gBY7vwlFsXg4JBjeBu9WLBu0Y3pQSZ35ktLDpO9W07OSDE57Id68JBtLxqb6XzxINYUdWTh2908VC6dnpEWSKN76uRq6G/5DVqUq5TGosYSvGsqRMLmEISxjy0g3j/foXQWeFMlLAG7Xn9sp0FHZraQ1AhlboTBW43uAJmJWmOLcti4JM/EQ0b1gc4heejJXRSjc6XOfvkczVBA4psJv4hgOXZvtoD5VwRD0WkOB5zMoo1MyqWI=" + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0, + "finishMessage": "Model generated function call(s)." + } + ], + "usageMetadata": { + "promptTokenCount": 65, + "candidatesTokenCount": 16, + "totalTokenCount": 148, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 65 + } + ], + "thoughtsTokenCount": 67 + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "X6IdacDzD7jZvdIP6qu5mQk" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 2.275361292s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1257 + 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":"EvwCCvkCAdHtim+PQmLlXBFlyn5zkH9Ulj6upBtzURUlM9dI26vPsj3LG2Q4KeqoH5XyWdqCkF+ruALELNIQ27gg7Xp6EkWYYMBus01fmwUubUKhjIu0zV/3qpAfK44Zsg9QXONIVDKMwPJxDHd4XUIehDG0y1JICa9Om9hSdrcLcelx9wRMb79NsdBWO3JRwxAfaVlmtfnCdTRBfuQ1Vzs//ZxCQr9RHWnL9Z+ZXllJNvusWfUVEsyY288zIkOb4EJElnK7vto2gBY7vwlFsXg4JBjeBu9WLBu0Y3pQSZ35ktLDpO9W07OSDE57Id68JBtLxqb6XzxINYUdWTh2908VC6dnpEWSKN76uRq6G/5DVqUq5TGosYSvGsqRMLmEISxjy0g3j/foXQWeFMlLAG7Xn9sp0FHZraQ1AhlboTBW43uAJmJWmOLcti4JM/EQ0b1gc4heejJXRSjc6XOfvkczVBA4psJv4hgOXZvtoD5VwRD0WkOB5zMoo1MyqWI="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "text": "The weather in Florence, Italy is currently 40°C." + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0 + } + ], + "usageMetadata": { + "promptTokenCount": 160, + "candidatesTokenCount": 14, + "totalTokenCount": 174, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 160 + } + ] + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "YKIdafKQMoC4vdIPquKD2Ak" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 1.575822583s diff --git a/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d792124c2e0d2389ede02769114fcc7e13c7fef1 --- /dev/null +++ b/providertests/testdata/TestGoogleCommon/gemini-3-pro-preview/tool_streaming.yaml @@ -0,0 +1,65 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 509 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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 + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"EpMECpAEAdHtim8rere5R73M3xFnVzAQ/SWKTJ6rbVa0wbXbF2KEW5iJtgQdfCxBJVRFzwaosCLNPuCRPFlCgwWM6UeGWtT+u6J+7uR4caEUrLLceIrVqOGnsis0sPowTQCatpjN0XMopVvu+o1eNXQUVl0EQmv5aGURtVQG8IRg4LhKFBXa/ZgNe7ODIMdTEYw/XDt/CaOpWsc1AJmbpj4sB0uSdk7d2BfKZUc8dbl8vduiq0LTLW0vWa5TUlgyAMLQqtjKU63YQsm4LHTizrlVNIOc7n0WBxdJkvmUzCoBtKhDkAsc2YQbjlq1PiLbQsL8I1gd6zXe0AZyXq/4ZviOsmE0pzeMgYmjqLE3fuvsQctWIrDzZoNZzydYD/PAXC12GH6W0SJd9Cqo7oia9f+sSHejvWog3ztheMh0Ut60PYSCSkytq6R26Utt9RLp4xZ1gwSjOVY4dX8eEnAYu03Q/OVsVbmRM6po5los4V+ir07w7fvi5X5LoKrO7vNx+SdQDaty0UzWmw8DxET82S/nPgXOQg6nj2VHUJyGICBhwAJjMMOanLPvcS53gNfkkW0znGXjCuyTGBuhN+ngAE/SZKr6kNP1Eq2cGMECe5YyPktrcnskV8ey6Q+OLa0fvVqWhCyqYP11D173JRgqnTvKLCkO6GXM3R2kcOP/nCDqalYfpWLUpeuyRnGaggM2My6NrR84\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"candidatesTokenCount\": 16,\"totalTokenCount\": 176,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}],\"thoughtsTokenCount\": 95},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"Y6IdafqZF-3Zxs0PsZuluAk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 65,\"candidatesTokenCount\": 16,\"totalTokenCount\": 176,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 65}],\"thoughtsTokenCount\": 95},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"Y6IdafqZF-3Zxs0PsZuluAk\"}\r\n\r\n" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 2.580842917s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1457 + 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":"EpMECpAEAdHtim8rere5R73M3xFnVzAQ/SWKTJ6rbVa0wbXbF2KEW5iJtgQdfCxBJVRFzwaosCLNPuCRPFlCgwWM6UeGWtT+u6J+7uR4caEUrLLceIrVqOGnsis0sPowTQCatpjN0XMopVvu+o1eNXQUVl0EQmv5aGURtVQG8IRg4LhKFBXa/ZgNe7ODIMdTEYw/XDt/CaOpWsc1AJmbpj4sB0uSdk7d2BfKZUc8dbl8vduiq0LTLW0vWa5TUlgyAMLQqtjKU63YQsm4LHTizrlVNIOc7n0WBxdJkvmUzCoBtKhDkAsc2YQbjlq1PiLbQsL8I1gd6zXe0AZyXq/4ZviOsmE0pzeMgYmjqLE3fuvsQctWIrDzZoNZzydYD/PAXC12GH6W0SJd9Cqo7oia9f+sSHejvWog3ztheMh0Ut60PYSCSkytq6R26Utt9RLp4xZ1gwSjOVY4dX8eEnAYu03Q/OVsVbmRM6po5los4V+ir07w7fvi5X5LoKrO7vNx+SdQDaty0UzWmw8DxET82S/nPgXOQg6nj2VHUJyGICBhwAJjMMOanLPvcS53gNfkkW0znGXjCuyTGBuhN+ngAE/SZKr6kNP1Eq2cGMECe5YyPktrcnskV8ey6Q+OLa0fvVqWhCyqYP11D173JRgqnTvKLCkO6GXM3R2kcOP/nCDqalYfpWLUpeuyRnGaggM2My6NrR84"}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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 + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"The\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 95,\"candidatesTokenCount\": 1,\"totalTokenCount\": 96,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 95}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"ZaIdaeuyDKuP28oPu5_O2Q4\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" weather in Florence, Italy is currently 40 degrees Celsius.\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 95,\"candidatesTokenCount\": 14,\"totalTokenCount\": 109,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 95}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"ZaIdaeuyDKuP28oPu5_O2Q4\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 188,\"candidatesTokenCount\": 14,\"totalTokenCount\": 202,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 188}]},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"ZaIdaeuyDKuP28oPu5_O2Q4\"}\r\n\r\n" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 1.789773542s diff --git a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple.yaml b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple.yaml index ec969bb3c3fbf5fe35629eb7bb40f9ac742b6fbe..dc1cf23ec047560f088c52ea05070e15dd80ff77 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple.yaml @@ -24,10 +24,10 @@ interactions: proto_minor: 0 content_length: -1 uncompressed: true - body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_01E4ctksfNxnHxb8NL7AzY7L","type":"message","role":"assistant","content":[{"type":"text","text":"Olá! That''s \"hi\" in Portuguese. How can I help you today?"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":16,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":22}}' + body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_011D8f9pw4KabWttPrkbaAL6","type":"message","role":"assistant","content":[{"type":"text","text":"Olá! Como posso ajudar você hoje?"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":16,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":16}}' headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 1.867139833s + duration: 1.980568375s diff --git a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple_streaming.yaml index 7ac3c3a076e49fbf1edccb0e6b61ae1c884ba3cc..870d04c894a6a25b27e9c10d305eefa2e6f20413 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/simple_streaming.yaml @@ -26,56 +26,38 @@ interactions: uncompressed: true body: |+ event: message_start - data: {"type":"message_start","message":{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_011vbTX9zC2NZRQEamT4cSJf","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":16,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":4}} } + data: {"type":"message_start","message":{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_013va9SBUhdmyiMNdWQdAJXr","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":16,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5}} } event: ping data: {"type": "ping"} event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Olá!"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Olá! Como"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Como"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" pos"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" vai você"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"so aju"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"?\n\nThis"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" is a"}} - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" greeting"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Portuguese that"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" means"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" \"Hello! How are"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" you?\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"dar você hoje?"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":27} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":16} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.338077792s + duration: 1.261146292s diff --git a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool.yaml b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool.yaml index 0eb74d89f73743cc11fde8e6478689b423fbdc1e..dc98cb0abfd1122cb2cabef5e3fec1b8f3626dd7 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool.yaml @@ -24,21 +24,21 @@ interactions: proto_minor: 0 content_length: -1 uncompressed: true - body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_013DoXQqRt9hn5cxD1GPCcbj","type":"message","role":"assistant","content":[{"type":"text","text":"I''ll get the current weather information for Florence, Italy for you."},{"type":"tool_use","id":"toolu_vrtx_01AbaFbEuoSmuk9UyZaC4byG","name":"weather","input":{"location":"Florence,Italy"}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":394,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":68}}' + body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_018rHJHvE1H6hfLm167nmkRj","type":"message","role":"assistant","content":[{"type":"text","text":"I''ll check the current weather in Florence, Italy for you."},{"type":"tool_use","id":"toolu_vrtx_01EKDu37P36gfuCEwCpy6fer","name":"weather","input":{"location":"Florence,Italy"}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":394,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":67}}' headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 1.495076667s + duration: 2.085536084s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 892 + content_length: 881 host: "" - body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll get the current weather information for Florence, Italy for you.","type":"text"},{"id":"toolu_vrtx_01AbaFbEuoSmuk9UyZaC4byG","input":{"location":"Florence,Italy"},"name":"weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_vrtx_01AbaFbEuoSmuk9UyZaC4byG","content":[{"text":"40 C","type":"text"}],"type":"tool_result"}],"role":"user"}],"system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}],"anthropic_version":"vertex-2023-10-16"}' + body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll check the current weather in Florence, Italy for you.","type":"text"},{"id":"toolu_vrtx_01EKDu37P36gfuCEwCpy6fer","input":{"location":"Florence,Italy"},"name":"weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_vrtx_01EKDu37P36gfuCEwCpy6fer","content":[{"text":"40 C","type":"text"}],"type":"tool_result"}],"role":"user"}],"system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}],"anthropic_version":"vertex-2023-10-16"}' headers: Accept: - application/json @@ -54,10 +54,10 @@ interactions: proto_minor: 0 content_length: -1 uncompressed: true - body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_01MrnUMp85dMAcyhkjGeX2we","type":"message","role":"assistant","content":[{"type":"text","text":"The current temperature in Florence, Italy is 40°C (104°F), which is quite hot. If you''re planning to be outdoors, I recommend staying hydrated, wearing light clothing, and seeking shade when possible."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":476,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":51}}' + body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_014QWCD9SGFBuL4dWvcDrX48","type":"message","role":"assistant","content":[{"type":"text","text":"The current temperature in Florence, Italy is 40°C (104°F), which is very hot. Make sure to stay hydrated and try to avoid prolonged exposure to the sun if you''re there or planning to visit soon."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":475,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":52}}' headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 1.353360875s + duration: 1.480864125s diff --git a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool_streaming.yaml index d731ab8729e2f36a61b47489a7741e3b64e05a0f..f74bc76b6500b2c678901d3c03d48c89b9386d5b 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-claude-3-7-sonnet/tool_streaming.yaml @@ -26,76 +26,76 @@ interactions: uncompressed: true body: |+ event: message_start - data: {"type":"message_start","message":{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_015uS6fGm1egYvRuSAr5jmF8","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":394,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":3}} } + data: {"type":"message_start","message":{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_01BskFKCoRmtNwwLEZceS2hN","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":394,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":2}} } event: ping data: {"type": "ping"} event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll check"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the current weather in"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" get the"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Florence, Italy for you"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" weather"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" information for Florence, Italy"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for you."} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0} event: content_block_start - data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_vrtx_01HCzehdpw6xDu3CDVXSFHFh","name":"weather","input":{}} } - - event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_vrtx_01Ko1dsGPQQd4y3nsTPLMQcM","name":"weather","input":{}}} event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"lo"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"cation\":"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"lo"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" \"F"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"cation\""} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"loren"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":": \"Floren"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ce,"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ce,Italy"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Italy\"}"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":1 } + data: {"type":"content_block_stop","index":1 } event: message_delta data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"output_tokens":67} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.281991291s + duration: 752.193583ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 895 + content_length: 898 host: "" - body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll check the current weather in Florence, Italy for you.","type":"text"},{"id":"toolu_vrtx_01HCzehdpw6xDu3CDVXSFHFh","input":{"location":"Florence,Italy"},"name":"weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_vrtx_01HCzehdpw6xDu3CDVXSFHFh","content":[{"text":"40 C","type":"text"}],"type":"tool_result"}],"role":"user"}],"system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}],"stream":true,"anthropic_version":"vertex-2023-10-16"}' + body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll get the weather information for Florence, Italy for you.","type":"text"},{"id":"toolu_vrtx_01Ko1dsGPQQd4y3nsTPLMQcM","input":{"location":"Florence,Italy"},"name":"weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_vrtx_01Ko1dsGPQQd4y3nsTPLMQcM","content":[{"text":"40 C","type":"text"}],"type":"tool_result"}],"role":"user"}],"system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}],"stream":true,"anthropic_version":"vertex-2023-10-16"}' headers: Accept: - application/json @@ -113,71 +113,68 @@ interactions: uncompressed: true body: |+ event: message_start - data: {"type":"message_start","message":{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_012cLcdjR2yjtxpzQjqjrHua","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":475,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5}} } + data: {"type":"message_start","message":{"model":"claude-3-7-sonnet-20250219","id":"msg_vrtx_01Lnb15G6n5yup7eiSG1MJP3","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":475,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":2}} } event: ping data: {"type": "ping"} event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"The current temperature in"} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Florence, Italy is "} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"It"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"40°C (104"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'s currently 40 "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"°F),"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"degrees Celsius in Florence"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" which is very"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", Italy."} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" hot. If"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" That"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" you're in"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'s quite"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Florence or"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" hot"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" planning to visit soon"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"! Make"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", I'd recommend staying"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" sure to stay"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" hydrated and trying"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" hydrated and try"}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" to avoid extende"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" to avoid being"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d periods outdoors during the"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" outside during the peak"}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" hottest parts"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" heat of the day if"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" of the day."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" possible."} } event: content_block_stop - data: {"type":"content_block_stop","index":0} + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":60} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":45} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 3.504416334s + duration: 1.308048041s diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool.yaml index 528842e25cffffe7225dde5597da5da4c5ca8a55..2391bc40edab503b1c97358f56860f61bb2a8289 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-flash:generateContent method: POST response: @@ -38,7 +38,7 @@ interactions: "b": 3 } }, - "thoughtSignature": "CqECAePx/16hu6jpQBsua/6D0znPjMbbAuwTIAxACow0BHlZjpuJ2bAGyr7Wo7paE6FNx84jcAd1AMLIJAWscUNukGCRiDORASgswHP16BSSB6jN5dLjTJ0UpUoxESXEW4U0iyrruAkortreKykTPMnW63wWjao8KQESbO/Q7g7WOQPGUzpmOCw9cvKt6I/DRZLjiJ1S8BmgEbc8ix2C4YBguza0iJ28V3ggewHiXumC3RxijchXLLkLx9Y5ww3XoJk1QaaWN3puEeWyVpEOQQJHa0pQVLYIp+IkQ0t0oe3jKDI05FBjn+h1lvbHoPuImyLtjUZFAMBqh76BWHQAYsfVUEzzSWplygLX0RP+NABj/9jDMK22/+DjBnBpEL1dv0lXvQ==" + "thoughtSignature": "CtQBAePx/16Zez8Umc39OZNkaQcoaJ1i+yLTUes4eYNcobNd2vH2Jza1Q9tqpUP3e9MCA7Az0IRM9hVbj63fFwx8AT9u4FhaQRdazvEkYMqe+jGLiO6yex245G4qobHLIydnzgPJA6OMCVsuxxjHM1QhmT31E5Qg/ZVeh6Fc6ZI3S+q3TC1+tNxGr2EBlWfWyfHIOtr2qsGfZSSVOaB9Wj1jY/alOSKrSFC0PiCGhvmMwnawJWlzYkshIfAssUetPp+bDW5grOJoKWATcF3kTFShItAs6Xc=" }, { "functionCall": { @@ -52,13 +52,13 @@ interactions: ] }, "finishReason": "STOP", - "avgLogprobs": -0.99647712707519531 + "avgLogprobs": -0.58420848846435547 } ], "usageMetadata": { "promptTokenCount": 60, "candidatesTokenCount": 10, - "totalTokenCount": 140, + "totalTokenCount": 119, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { @@ -72,32 +72,32 @@ interactions: "tokenCount": 10 } ], - "thoughtsTokenCount": 70 + "thoughtsTokenCount": 49 }, "modelVersion": "gemini-2.5-flash", - "createTime": "2025-11-03T19:52:55.484773Z", - "responseId": "FwgJaaXLHe2iptQP__zTsAs" + "createTime": "2025-11-19T11:04:06.032691Z", + "responseId": "JqQdabP_AfrJptQP15PtmQI" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.145860833s + duration: 989.592584ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1155 + content_length: 1465 host: us-east5-aiplatform.googleapis.com body: | - {"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. 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"}}]}]} + {"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":"CtQBAePx/16Zez8Umc39OZNkaQcoaJ1i+yLTUes4eYNcobNd2vH2Jza1Q9tqpUP3e9MCA7Az0IRM9hVbj63fFwx8AT9u4FhaQRdazvEkYMqe+jGLiO6yex245G4qobHLIydnzgPJA6OMCVsuxxjHM1QhmT31E5Qg/ZVeh6Fc6ZI3S+q3TC1+tNxGr2EBlWfWyfHIOtr2qsGfZSSVOaB9Wj1jY/alOSKrSFC0PiCGhvmMwnawJWlzYkshIfAssUetPp+bDW5grOJoKWATcF3kTFShItAs6Xc="},{"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. 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"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-flash:generateContent method: POST response: @@ -119,7 +119,7 @@ interactions: ] }, "finishReason": "STOP", - "avgLogprobs": -0.047055284182230629 + "avgLogprobs": -0.038081047435601555 } ], "usageMetadata": { @@ -130,7 +130,7 @@ interactions: "promptTokensDetails": [ { "modality": "TEXT", - "tokenCount": 76 + "tokenCount": 123 } ], "candidatesTokensDetails": [ @@ -141,12 +141,12 @@ interactions: ] }, "modelVersion": "gemini-2.5-flash", - "createTime": "2025-11-03T19:52:56.654104Z", - "responseId": "GAgJaZj2J4jK5OMPiMqt0Qg" + "createTime": "2025-11-19T11:04:07.021113Z", + "responseId": "J6QdafmkAeyAptQPvKrv8AI" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 714.085958ms + duration: 679.733ms diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool_streaming.yaml index 9005a838f9dcd61a0f542fb27848c929e13d8dfd..c4251a4ef15a4b01b83aea527299f5bef61ba950 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/multi_tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"a\": 2,\"b\": 3}},\"thoughtSignature\": \"Ci8B4/H/Xh0HHuf8Ru7QjMXo2RHOUO+nBLn9rEjliTSTnGhUal/7EJGfeSpbcsz7QwpgAePx/17hV3eTgsKDYi4eoO1k3AOXUaW5mNFggBN8YKwi6Ga/nnj72ASWbUY5cgHWwRNYw8G+7VHS9MxuWQTWZ3xjlxmHNxSLUmisj//l4PBElDRkyR+CPl27hn5Ep9V0Cl0B4/H/XsPIkOqYZ7ohYzyq8m+HL8z7tNQJnIIS+gZJGBoYlIm7BLKAFUCvEeOh4/LMuwo/vKDHkodZCkkWnt3RHJ4FjtOXzSU+/BnFCyd5UzTGlz5LgQP6r6l4fxMKpQEB4/H/Xnzg231l6QUr950FU1uyEo3+dRA2A6MOh9mpgx6oNTfVZG5LX2h9ZGr/SShaCbFMrY1xM8I9qUE6PpvELcN2yO4da8uIcSxtUsOL0qbLXJ3DDg1hta1CRF1ycK9VkcH2KrhQJ4VMcyTnNbBkzCnW+gQQBAL7IDSIYRa5F/m2ucBHeK+/MB3gDWmdHR7GwSpNgcouIQjblRCuo8XYwrqSato=\"},{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"a\": 2,\"b\": 3}}}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 57,\"candidatesTokenCount\": 10,\"totalTokenCount\": 146,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 57}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 10}],\"thoughtsTokenCount\": 79},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:57.649973Z\",\"responseId\": \"GQgJafXVJ6rGptQPx7S0-Ag\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"a\": 2,\"b\": 3}},\"thoughtSignature\": \"Ci8B4/H/XsVjmQllPB1vwXsit6Cy6bO83UTy/g2xrDRI+kS+lSc5zTqIPp2WuV1dFAphAePx/1778NrXCSJC9DjysS5FDbk2qa2fdkpGT8AKSg3Gb9z6oBbS7lqKRfgAiqvPKXwwxLplcnnJ3Eez3UYC+2NI+JSeeBqOhxEmH6qbFXdcQPyf7IY1BCdynZ37b4wNJApdAePx/1455hKMzvD1Dy3HayN6NX2qyXtP3OC+vwWXrjyA8J8U2TBMgsE2Rer1TmJDLu+LX2o2BX/ECsnXAIOV5CxYGbXhA0pa5PENJvWpKlKDNZhRHLDMFw4f+WZVCqUBAePx/17pAvxLAWqaxXNGe5Z1qiN/FPaqRhvnG4IAVlYbM8yniWCY1P6DLIMBQ7ocubcSFRDMaYW7Oh5/WVwBTQ9wq2Yyg2YaAjdi3h8Si8ujsXbxzSKMqHjYrhEfWmT9nxSnsyztHsPCnLL9SlnBxURfWaNJXG7r6cgf3r/tyRJ5X1ar/iH3dkjp58MubpJJaMx+H022YAPMnWmIvJ4J4vsrwoDJ\"},{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"a\": 2,\"b\": 3}}}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 57,\"candidatesTokenCount\": 10,\"totalTokenCount\": 147,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 57}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 10}],\"thoughtsTokenCount\": 80},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-19T11:04:07.904252Z\",\"responseId\": \"J6QdabyYN4qb5OMPr6PXcQ\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.348630167s + duration: 1.012000667s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1138 + content_length: 1708 host: us-east5-aiplatform.googleapis.com body: | - {"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"}}]}]} + {"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":"Ci8B4/H/XsVjmQllPB1vwXsit6Cy6bO83UTy/g2xrDRI+kS+lSc5zTqIPp2WuV1dFAphAePx/1778NrXCSJC9DjysS5FDbk2qa2fdkpGT8AKSg3Gb9z6oBbS7lqKRfgAiqvPKXwwxLplcnnJ3Eez3UYC+2NI+JSeeBqOhxEmH6qbFXdcQPyf7IY1BCdynZ37b4wNJApdAePx/1455hKMzvD1Dy3HayN6NX2qyXtP3OC+vwWXrjyA8J8U2TBMgsE2Rer1TmJDLu+LX2o2BX/ECsnXAIOV5CxYGbXhA0pa5PENJvWpKlKDNZhRHLDMFw4f+WZVCqUBAePx/17pAvxLAWqaxXNGe5Z1qiN/FPaqRhvnG4IAVlYbM8yniWCY1P6DLIMBQ7ocubcSFRDMaYW7Oh5/WVwBTQ9wq2Yyg2YaAjdi3h8Si8ujsXbxzSKMqHjYrhEfWmT9nxSnsyztHsPCnLL9SlnBxURfWaNJXG7r6cgf3r/tyRJ5X1ar/iH3dkjp58MubpJJaMx+H022YAPMnWmIvJ4J4vsrwoDJ"},{"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"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"text\": \"The sum of\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:58.993078Z\",\"responseId\": \"GggJabbOPKDM5OMPxdqygAc\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \" 2 and 3 is 5.\\nThe product of 2 and 3 is 6\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:58.993078Z\",\"responseId\": \"GggJabbOPKDM5OMPxdqygAc\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \".\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 73,\"candidatesTokenCount\": 25,\"totalTokenCount\": 98,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 73}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 25}]},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:58.993078Z\",\"responseId\": \"GggJabbOPKDM5OMPxdqygAc\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"The sum of 2 and\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-19T11:04:08.930164Z\",\"responseId\": \"KKQdafTiOKnzptQPke-o4AE\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \" 3 is 5. The product of 2 and 3 is 6.\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 151,\"candidatesTokenCount\": 24,\"totalTokenCount\": 175,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 151}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 24}]},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-19T11:04:08.930164Z\",\"responseId\": \"KKQdafTiOKnzptQPke-o4AE\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 713.590167ms + duration: 550.507042ms diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple.yaml index 11ca89abbe0ef711a64f47ac88a5de253457f238..b3d6e85017a1c0ba10e1f8324356d90d4fd9e5d7 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-flash:generateContent method: POST response: @@ -36,13 +36,13 @@ interactions: ] }, "finishReason": "STOP", - "avgLogprobs": -2.3644888401031494 + "avgLogprobs": -0.58062881231307983 } ], "usageMetadata": { "promptTokenCount": 9, "candidatesTokenCount": 2, - "totalTokenCount": 38, + "totalTokenCount": 37, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { @@ -56,15 +56,15 @@ interactions: "tokenCount": 2 } ], - "thoughtsTokenCount": 27 + "thoughtsTokenCount": 26 }, "modelVersion": "gemini-2.5-flash", - "createTime": "2025-11-03T19:52:49.131611Z", - "responseId": "EQgJaZuECPfyptQPiO7F0Qw" + "createTime": "2025-11-19T11:04:00.570529Z", + "responseId": "IKQdaaHpIuyAptQPvKrv8AI" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.398007208s + duration: 1.624110084s diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple_streaming.yaml index d2636bc1b49ae4098a35029a7e534d5415f5341a..d4b10d18ff30e406dee086d95df57b9469a2ed87 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/simple_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-flash:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"Olá!\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 9,\"candidatesTokenCount\": 2,\"totalTokenCount\": 37,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 9}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 2}],\"thoughtsTokenCount\": 26},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:50.051639Z\",\"responseId\": \"EggJabeTA8_PptQPo-GH8QQ\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"Olá!\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 9,\"candidatesTokenCount\": 2,\"totalTokenCount\": 37,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 9}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 2}],\"thoughtsTokenCount\": 26},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-19T11:04:01.771732Z\",\"responseId\": \"IaQdaZSNL_rJptQP15PtmQI\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.190780917s + duration: 725.084625ms diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool.yaml index f300f02ca769e1379fc4334d431e96b056395be1..961e84b47ca4a7b57e97a1f7782cf3ca77b1f128 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-flash:generateContent method: POST response: @@ -37,18 +37,18 @@ interactions: "location": "Florence,Italy" } }, - "thoughtSignature": "CqoCAePx/17/8Q8KZZMun2Jh8nZkCjH+u0w5GCukRd4aSFxz4PI0YFXB/lvok+cVkxL3Fv0ZrP45+NDbGDDT+4Gf7lNe21zmmu3xQWaXmR+/EaYhuaHiFj8icU2IzVr0ra22AJ2SQFJNMB5g5Uu1TSJsYD1IkrB4NnkyudqlctBE1400PoB9wOzxM5kNtWseTLDw0a3XPgh0sV82nkHOyt8ogFkqNwIovTrvqQ+9HB0bTGqYk5U2XikPiCRzjJ9/g3CRzydE5eg6oLn7E5qR4WD25xOcHBki9RxITWSglwG3tYYDI8s/UG7eNc6aDiX72LL8xwEQMwOT6DQUzQanoQC7nlIqnHXas2eiq1zCkS7O6HGfuuXtcz0euBKxndi/3ESgzzQGKY8rCa065Q==" + "thoughtSignature": "Cq4CAePx/17lfvNzeD1UgoF8F6LxiSlPe5DfakwGl5buoL2pFazz+R2IYIE4Z5S71KgiO9VbYj/6bJK5FBJm21GoJref0w1PDVF+/93xJylQhMB6ID/QCMDzRQfucel2hkwuhQscItWpTbvh5+/0NGY3Uo/bO5F4FLgrwmCRfqXl3EIkavxBOfk8Z4/H7SCd7/fYFvvTgCu+7ycBYyLYhvzYyGxTH7Ups0SWNaYueSPusvRa3FG8Y4BQKENgTWVlReJyuCHjyFHSxCtuDL8xEGaBE24ltsiN6qXw5F4uZyZndKskWLtdedDAjxOW/2bAwb5l9UZhfSmBDV4mHEz8JeMoejbUdSnBZk+hoahL6NhTLyEB6tHsnFqHC5bI4FOJmCgH6LsguTmD2Fmjf+QE5yw=" } ] }, "finishReason": "STOP", - "avgLogprobs": -1.3909281730651855 + "avgLogprobs": -1.5359557151794434 } ], "usageMetadata": { "promptTokenCount": 28, "candidatesTokenCount": 5, - "totalTokenCount": 96, + "totalTokenCount": 95, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { @@ -62,32 +62,32 @@ interactions: "tokenCount": 5 } ], - "thoughtsTokenCount": 63 + "thoughtsTokenCount": 62 }, "modelVersion": "gemini-2.5-flash", - "createTime": "2025-11-03T19:52:51.509145Z", - "responseId": "EwgJadmJH9nEptQP9fCJyQY" + "createTime": "2025-11-19T11:04:02.601478Z", + "responseId": "IqQdaYbbJNmDptQP7qyZuAE" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.300916167s + duration: 882.023417ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 722 + content_length: 1152 host: us-east5-aiplatform.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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"Cq4CAePx/17lfvNzeD1UgoF8F6LxiSlPe5DfakwGl5buoL2pFazz+R2IYIE4Z5S71KgiO9VbYj/6bJK5FBJm21GoJref0w1PDVF+/93xJylQhMB6ID/QCMDzRQfucel2hkwuhQscItWpTbvh5+/0NGY3Uo/bO5F4FLgrwmCRfqXl3EIkavxBOfk8Z4/H7SCd7/fYFvvTgCu+7ycBYyLYhvzYyGxTH7Ups0SWNaYueSPusvRa3FG8Y4BQKENgTWVlReJyuCHjyFHSxCtuDL8xEGaBE24ltsiN6qXw5F4uZyZndKskWLtdedDAjxOW/2bAwb5l9UZhfSmBDV4mHEz8JeMoejbUdSnBZk+hoahL6NhTLyEB6tHsnFqHC5bI4FOJmCgH6LsguTmD2Fmjf+QE5yw="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-flash:generateContent method: POST response: @@ -104,39 +104,39 @@ interactions: "role": "model", "parts": [ { - "text": "The weather in Florence, Italy is 40 degrees Celsius." + "text": "The weather in Florence, Italy is 40 C." } ] }, "finishReason": "STOP", - "avgLogprobs": -0.052264484075399548 + "avgLogprobs": -0.027842623492081959 } ], "usageMetadata": { "promptTokenCount": 38, - "candidatesTokenCount": 13, - "totalTokenCount": 51, + "candidatesTokenCount": 12, + "totalTokenCount": 50, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "TEXT", - "tokenCount": 38 + "tokenCount": 98 } ], "candidatesTokensDetails": [ { "modality": "TEXT", - "tokenCount": 13 + "tokenCount": 12 } ] }, "modelVersion": "gemini-2.5-flash", - "createTime": "2025-11-03T19:52:52.815110Z", - "responseId": "FAgJaYbgMe2iptQP__zTsAs" + "createTime": "2025-11-19T11:04:03.494403Z", + "responseId": "I6QdacOWHqrL5OMPtpzzmA8" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 653.623083ms + duration: 540.870084ms diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool_streaming.yaml index a65c3fcbdcc85684b9ba71b41e348a00f836e26a..4956ca65049eadef0a9f23e53b874e30e5aba654 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-flash/tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence,Italy\"}},\"thoughtSignature\": \"CiwB4/H/XoLNC0vlLlQ3Z7AvZDspjKBtqYC32OS0AJek8NgWRMLRDq4ts9ukywptAePx/158NrZYvvLkcnng0HhXE3aVsuj8O6ce8aXROHyLFjYQYiIjJAgM4MxhOzBQHDp/C/JlS8zbApRIUgzPBd18zn9EMHLvwyolL9htJZy6ckoZLN0HzzRf+TqsUsqOIzocYOMGZLYPiJ23bwp8AePx/15vctC0EUe65l6jBI220nF0o5F/rDOw3aAdJHyCeih0qGsGqI9Qwt6+iMntlZmV1dQVsxp4i7/zlMOk7HTDidrEL1D19rpdU3Pr/Enz3rseqqHOvDEXBriVho6sVuezQ7vxbu9HG25eW9NHZdvbgjycgYHgvs1fiwpDAePx/15sY6z0zjbVURUGT5nXTP1esG1077pS3yRV4Eo1aXR/bGDQwcweH9JZeudUwS5HcTOOgXZqKfS90YnxxlIKKQ==\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 28,\"candidatesTokenCount\": 5,\"totalTokenCount\": 84,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 28}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 5}],\"thoughtsTokenCount\": 51},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:53.713190Z\",\"responseId\": \"FQgJaebDK46IptQP5u6mqAI\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiwB4/H/XgPBx7H41mQWWTneSxzTQCyc0wzScVKc5AIn3b8TgdZFbTC1d2qUdgptAePx/15mCGBnWhulJd1gjHhny9mo+yzbH7tj5jIXAk1vLBp/plv9Qndwx+68CtQ3eZQa82W27zN7rJWw8Q5FW3NDGOiyXnfKXLOGKQ1x5+iF6wqe1Ec/nGhHEwB9t7NlhMWdtibPkELCfMhomgp6AePx/1608eQCMND2Pl/a47/lzL/nrECGx9ZAjsU+/4UHzTGH6vxQRmwNDZYqhrBcSxC2VA/ocT1F3eP6wMj8xDTWBHddDiA6WimCaXKT+aGRbnIXQfjhtOadLyNcCtea/7ny7CvrmsrTjJ4BfjToI87NtfObamCGJgIKVAHj8f9e2NadgSaLliJnkuWSr5p9PHqLP9pI0Fos4xq1pTJU3X4ar6fcLqymxxXfqgFmrcIWRkDiDG0N8LDtk1hsA4kZThlWIEvrGiLYFpx+HCqTTw==\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 28,\"candidatesTokenCount\": 5,\"totalTokenCount\": 86,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 28}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 5}],\"thoughtsTokenCount\": 53},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-19T11:04:04.229621Z\",\"responseId\": \"JKQdafWBDrrIptQPxeKNkA4\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 780.705833ms + duration: 945.3105ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 722 + content_length: 1237 host: us-east5-aiplatform.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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"CiwB4/H/XgPBx7H41mQWWTneSxzTQCyc0wzScVKc5AIn3b8TgdZFbTC1d2qUdgptAePx/15mCGBnWhulJd1gjHhny9mo+yzbH7tj5jIXAk1vLBp/plv9Qndwx+68CtQ3eZQa82W27zN7rJWw8Q5FW3NDGOiyXnfKXLOGKQ1x5+iF6wqe1Ec/nGhHEwB9t7NlhMWdtibPkELCfMhomgp6AePx/1608eQCMND2Pl/a47/lzL/nrECGx9ZAjsU+/4UHzTGH6vxQRmwNDZYqhrBcSxC2VA/ocT1F3eP6wMj8xDTWBHddDiA6WimCaXKT+aGRbnIXQfjhtOadLyNcCtea/7ny7CvrmsrTjJ4BfjToI87NtfObamCGJgIKVAHj8f9e2NadgSaLliJnkuWSr5p9PHqLP9pI0Fos4xq1pTJU3X4ar6fcLqymxxXfqgFmrcIWRkDiDG0N8LDtk1hsA4kZThlWIEvrGiLYFpx+HCqTTw=="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"text\": \"The\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:54.512780Z\",\"responseId\": \"FggJaYymH6DM5OMPxdqygAc\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \" weather in Florence, Italy is 40 degrees Celsius.\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 13,\"totalTokenCount\": 51,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 13}]},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-03T19:52:54.512780Z\",\"responseId\": \"FggJaYymH6DM5OMPxdqygAc\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"The weather in Florence, Italy\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-19T11:04:05.175922Z\",\"responseId\": \"JaQdabLeCoqb5OMPr6PXcQ\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \" is 40 C.\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 89,\"candidatesTokenCount\": 12,\"totalTokenCount\": 101,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 89}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 12}]},\"modelVersion\": \"gemini-2.5-flash\",\"createTime\": \"2025-11-19T11:04:05.175922Z\",\"responseId\": \"JaQdabLeCoqb5OMPr6PXcQ\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 710.076125ms + duration: 520.063542ms diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool.yaml index e7ed9c800423357ff74f98f4cbc660d74a6a36c1..c05e87a09ad02c2b6c479039e98fde805973b4fe 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-pro:generateContent method: POST response: @@ -34,11 +34,11 @@ interactions: "functionCall": { "name": "add", "args": { - "a": 2, - "b": 3 + "b": 3, + "a": 2 } }, - "thoughtSignature": "CvQCAePx/14NVLo2aFENXN4pX/kIk4bZ+IIn9SuGEcAodTztmaxrh2n1PlLJ2/ahqKl6yf4+5ePV1sDDDPThVhBFNHHlpI4V64pGAIpFRkpvz/Xr9FNvIf/6q6sCfpEOv0YAZs0tbFI9uWJkENhgaTd7iJBKIxlKCyWxIMtIez4bV7QTk0I7sQriQojCQgN+IK0Gmuy5GI5OUSyrfjjz6FOnNc4fNAy+05QgKHKuCBCXSeu5pB15zKV5XQFC5JhwL46h0nvW+h21F8OzQnKLMyRZoZauHd7xJXStNn3Hs0KTSgeuDgzEG9KbMd+xUHQST0mI3Ve2Uj25yVmSp/na4/LhuVM/k7ad2IkmDfhPDbZKiF6rKb1ScPgAFp6FxOyLATAWg3kv1sVF+LdeeS6Of+4xJpS/gB/DGNhfvupvaIxo6N/UTKys0NdIIVUcQiVO8zsfQ9MlUhhzxN01qOVis1gnmEw1ou+S30yHwlSe2F15fX/5crr1" + "thoughtSignature": "CukEAePx/15QJY0aW7MHjQUB+ypu3XOoG34numgtrxgqkyaR0fEZ6GidH4rlWetcv9trdN9jcp+uPvzLT6T24tPBx5XFJdZJn1ZtouXhZhcPHqTcl4a10cV5aL21bSWLls81NkGLTKqs1cAvaERIxIBcgAnw+IyilHbLMii3/axH5VzzpKkfcutk7k/1E0en0cp4HxV49f1jIGA3UrUWTEd4F9ntyCONE4gwOZSAmGJj/ZQv/O4dM2cWehyIgzGhlZ/Wg6cd9kQHU1FCgWBRSgAWmMKhq81PdeXwOBqPC25fyGjba2jRUN9+o1LalYwTK19XDy62YIaNa3XBkouKTyLisalJG7rs6Ch/5oBGWkOCgrIumkAFV1dkqiFpFEcZO++RLblx3yaTIltm0RAD2cohnwXe80RXek7V6Z07fIT9C7SLcFPyl9NIYTnWzT1AI0YLj3J7BK1BFzjRpVsuXE7tWp0uRzVdR2Up/iZYoMuFKJEDx3oqOBlEMFlKytCWU8+c9NgRKEkOlDzyf033XU0kth6YNlXab08xkxwPSVQps+pqyuIYaGvtZncB6lpnGznQ/x5x33Td6/0xgLH2A+QVNME/GVIEXIGOHvVQ09WTKRYAYLxWFY3U+ybXUh5gLaTa2bEuF588YQUL0fIka8KiMUbBvRi78QRWAEQNks/Z/zFNhmMzseiOSfAuhBZ3rlGsvSc676kIWziYC/kq710p5DQP0jTFbPV1InSnqToaXFY766vK6yjZJ8FVHlqRM+YK6g5pxpmJu05TS1V1xYCu+g2o7lQVtCZI1O0ELqnZkU8ESk2kxtw8qrU=" }, { "functionCall": { @@ -52,13 +52,13 @@ interactions: ] }, "finishReason": "STOP", - "avgLogprobs": -0.84448261260986324 + "avgLogprobs": -1.2367894172668457 } ], "usageMetadata": { "promptTokenCount": 60, "candidatesTokenCount": 10, - "totalTokenCount": 163, + "totalTokenCount": 241, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { @@ -72,32 +72,32 @@ interactions: "tokenCount": 10 } ], - "thoughtsTokenCount": 93 + "thoughtsTokenCount": 171 }, "modelVersion": "gemini-2.5-pro", - "createTime": "2025-11-03T19:53:25.624359Z", - "responseId": "NQgJaeeNJsKN0ekP4f-yiAg" + "createTime": "2025-11-19T11:04:37.627146Z", + "responseId": "RaQdacqjJrCI0ekP8tCGkAk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.020324083s + duration: 3.051268875s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1155 + content_length: 2005 host: us-east5-aiplatform.googleapis.com body: | - {"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. 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"}}]}]} + {"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":"CukEAePx/15QJY0aW7MHjQUB+ypu3XOoG34numgtrxgqkyaR0fEZ6GidH4rlWetcv9trdN9jcp+uPvzLT6T24tPBx5XFJdZJn1ZtouXhZhcPHqTcl4a10cV5aL21bSWLls81NkGLTKqs1cAvaERIxIBcgAnw+IyilHbLMii3/axH5VzzpKkfcutk7k/1E0en0cp4HxV49f1jIGA3UrUWTEd4F9ntyCONE4gwOZSAmGJj/ZQv/O4dM2cWehyIgzGhlZ/Wg6cd9kQHU1FCgWBRSgAWmMKhq81PdeXwOBqPC25fyGjba2jRUN9+o1LalYwTK19XDy62YIaNa3XBkouKTyLisalJG7rs6Ch/5oBGWkOCgrIumkAFV1dkqiFpFEcZO++RLblx3yaTIltm0RAD2cohnwXe80RXek7V6Z07fIT9C7SLcFPyl9NIYTnWzT1AI0YLj3J7BK1BFzjRpVsuXE7tWp0uRzVdR2Up/iZYoMuFKJEDx3oqOBlEMFlKytCWU8+c9NgRKEkOlDzyf033XU0kth6YNlXab08xkxwPSVQps+pqyuIYaGvtZncB6lpnGznQ/x5x33Td6/0xgLH2A+QVNME/GVIEXIGOHvVQ09WTKRYAYLxWFY3U+ybXUh5gLaTa2bEuF588YQUL0fIka8KiMUbBvRi78QRWAEQNks/Z/zFNhmMzseiOSfAuhBZ3rlGsvSc676kIWziYC/kq710p5DQP0jTFbPV1InSnqToaXFY766vK6yjZJ8FVHlqRM+YK6g5pxpmJu05TS1V1xYCu+g2o7lQVtCZI1O0ELqnZkU8ESk2kxtw8qrU="},{"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. 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"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-pro:generateContent method: POST response: @@ -114,41 +114,39 @@ interactions: "role": "model", "parts": [ { - "text": "The sum of 2 and 3 is 5, and the product is 6.", - "thoughtSignature": "CqsNAePx/16/pqADpCNjDOOvLZbYVBpeVUlFAyTZKsEyT8DVHG76t20d/hKlJfZ4NIr1Oc0V+kQ/fv+znM8rYTOTxQ8+lc31vZigNu93zEG/4WYYKo/Knnd0xvX9edO3P4rqe5QnaN93gnAsZVbDamxyJ7m5rx4gvHOA3A1qsfQaeWvYfXnwOy/KEs98QpHi7o0RMZIdiJM0jbqaE3n47pWdVeiV7BpFkJ+nLvykhUFQx7Bkx3ilBqddXdubQZdoln0oK4FRcTDOPbGg8/bFRkCJDRaBk3a0yVRa4AbfYghHx+v2HPiksngtCmbOUBcItJXz4CO71QkXKmFKT9FdBYeYEjf6pOwXpmhvdy8rQnywhJ2kI7I7aCUOe8iKuV7EyZHHOdUyz5KN5tmXcJKYn2BlY9sFsdjtxm1KYwS8JBiz98gqrkrjl6VSQvLX9u3lZB8oj+iTbw1lDJGyzGhQBD9YFAkhWrsBWwvIVdGa5t9FyNsQ6De/twjoI0ocX9oZb5TAnqeHLtUeHieamR6P3b82dMhDbZ0aAQueeeirI4SauaekhBtA9sj9NzILaTwbEHIdQC2rdQoAknjfmRkWTnuU4z0MhxVAcMcNqLDqRJbm+SXJ+XU8njKs0ohHxw/Otalaw5SxDqYq5SNZytGCUGCYf27C4uBC24NtB6n3Dwgm/3JD1EkMtL9isL0EVwkm2Ii3BFANk/AH2iiePw6SxFdChEfuHPtSGHA4jxT4wRWLkd2V5BK7+ZM6QPmwc6caH0J041X96xyt7bbaQtIf81vt2B2ANggSTPZ+chVAA2PWgkOlNcT+h/Tts1fgsWLUcya0gDL7ICMZG/EuA3TheiILeL6zwTBNWMjozByGTchimLao+lxDaUvZ+CwQFxDuTH/QTaYBGk3n9RXktdxwcAnP6n7Nyww7YfHx3JGpuYwY4aV69hCqkew+zbKEkJTwewhewxbRrB17YevUV+HK2c3vODT7ZgwAqgEdmByc+bCPwaj8UPpqhqvnPNAt9Vk6zHT/7S0o2ondpGuQ5EHn3WH83QgEWVC5AfHbP3d/l3o+xa7VHSfmomz5ESC2vTtvp06bIbrmxTnK3/I19m2VOECTPuE5zGDiPWo/EK0KGXJroTus2qObABwcVTyB/PevaKTllAQoAgeOS1M49xRHNA7jkKkWxVYrB/HzcKERlh8KJFlY3VeA5/oY24lax3GL0Ov7nUnn0o85nTN+4kWCcTlY6LZspr3kV43C2DW0X9hbcELPSV+d4m03JLpQLg+Hr35BMRCCPcDuOnmRVpuqqrxYOJQGz/DO5rBDY4yG0d41YQANlUEzBC3T5aHAflNUMEfFhYvwPb27NPF7c135C+WsIf8MJx27ILllURqhbmtgkxhWLPqlVY+hV4OTzHqnCncf+ztsLGp5Fi/KPD0txLU5v3nTOO8TgMu6AwikMpK9+ceLvjEpqrGtcB1ReZVnOeYKvC21OElIRlkz9n8KJIFqVd35LJA09ycQ74ZeIyraEEMWqKd+0/wpsmEBmnOJJhZ55pnilrUG+hovKrWhwyE8IuC2OzHnw8NcZ2IInCO89rnWFqf/NcSu9fEuMoK1ER0HTQKSyxCHm2C8024UooKjntWFO+65EcBms1KKedjfph5XRdFkM9ZqqCK0EwI21prrs55zNe3mAk+makMVfw8SgPNqrwck6d+yg6iAqnQIWs4d0iSxsuJTTVCWrxcLXEMI24XI+dIU44N2B3ApJOo54irAcFircjnpH0d3/qlG4+3qZXpuZFHIbSMrnIW7Jopgu8VOqomNeW8CEWWArKzcajx77PVbn6esYuFGN5ofCWJ+prfkxmmcxKnaYf0g/oTEfiTjbrYDDTnUngtGfDDvdrs1opJtAUpnnPWPp9sbWlxK4tfjUwOEexuJ5deHgXBYmXN8ox/89S0MTR3DulbMf/wgWVIkflRsvs2mWFOPmP/+kv0bf9IXUyUzW8oS+MqjPNLZ7PMknePMc3MFYpDpLLnsYqAWknSFUPWAbNQw+pLcUrZNgAM/xHI1HzhCQ094k+Bb1knP7i8yUJcLXew/DKHuSSclmtNdmoqf8s7uj7iUoxs8V+weGseCodm9PMtaEx25bIlBP+dgE8DVsoySvUWni4VtEis4pUTGQ7gVqgMkagYFDvW0F1ZL5BFxbAL9LcS0r+LbpH3WIfpdjTCI5/IxjpAcNaZ6vAbmVcFbTYI8zykO5DeZYdjqmFpAMSucEvBNWiRPa6ABcDkyA7eTAb148GE8VuPSDXWW" + "text": "OK. The sum is 5 and the product is 6.\n" } ] }, "finishReason": "STOP", - "avgLogprobs": -1.8039343984503495 + "avgLogprobs": -0.17488816579182942 } ], "usageMetadata": { "promptTokenCount": 76, - "candidatesTokenCount": 19, - "totalTokenCount": 573, + "candidatesTokenCount": 15, + "totalTokenCount": 91, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "TEXT", - "tokenCount": 76 + "tokenCount": 245 } ], "candidatesTokensDetails": [ { "modality": "TEXT", - "tokenCount": 19 + "tokenCount": 15 } - ], - "thoughtsTokenCount": 478 + ] }, "modelVersion": "gemini-2.5-pro", - "createTime": "2025-11-03T19:53:27.675592Z", - "responseId": "NwgJaYieKbGC0ekP-bXkSA" + "createTime": "2025-11-19T11:04:40.692907Z", + "responseId": "SKQdaaulKqWO0ekPgvO5sQY" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 6.285962458s + duration: 1.02390475s diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool_streaming.yaml index fcdb46ab7c746dec86052d0ad5a95531eeb296bf..0c4f0b2926a69a347370d0973cec34db1e6a2368 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/multi_tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"a\": 2,\"b\": 3}},\"thoughtSignature\": \"CiQB4/H/XlX6NEE2oZemlkg67NxoKoJB5NoayjE5vi7trpqjHVUKXgHj8f9eB6K+z0Pl4dvATaGSyM3TPl0Ss2E68unSJJBQZlzT3epePny9LoODM1eSIS30esNvQYFWw8+AKSL4Dh7TrAF/wAXObu0B5EAxiisuNdpDpSNvoEmPYL8XwWEKawHj8f9ePJLfhHJqWosCkZwiGo/yuq3rNlyAYM+RpSTaT8sZ6TqgG5pqp8tzahjrBVMe8zc1I303Xj0fNeYyIK4GyXzva+kUzYv/Itnc/EEDDFHb9CnOsb7Q9UDiVIvbyn6Q0BIHHWtoJ8pWCocBAePx/14/qMNWbsiLE2J6ETDqka11adZo0yr8opBcpZqrrXLW0LCllKWrOucvFDJR2MrF+gO4RBZaR0xqT1bUPacWsYCD9fym+k2O/6mTQQCZr0dQv2z4ebrTpIJ3B3EgS90RToimlDHmUi6mv3sco9MHSOu+Cw/hFR5RCYodgJLNqsg5Bu/ECisB4/H/XqsC8CxNVguMHOF29sfs0UjX7aXTUL2oH5fq9qd3jukcEs2WH04x\"},{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"a\": 2,\"b\": 3}}}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 57,\"candidatesTokenCount\": 10,\"totalTokenCount\": 145,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 57}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 10}],\"thoughtsTokenCount\": 78},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-03T19:53:34.206944Z\",\"responseId\": \"PggJaeDQDNOM0ekPpsvo4Qk\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"a\": 2,\"b\": 3}},\"thoughtSignature\": \"CjYB4/H/XqxbQHp2lO9C6z3WWzvVvCiyYUrbBx1L6sQ7hZMExUrufaOgtboKjNVDxYTfY4AsVGcKagHj8f9e1baijGdlfKMfiyGh7mqF3XxfqA9oBZ0mq80e35Kg/CFJiNoFvmmg5vzmSNFq+VLsp92Hw1SCypKySEiF01T0znZgyHN0XwoHeKXAgKk1zFd/Mh9qSsLSC/TPC4vMzjL0qu8Y9RwKZwHj8f9e76FXbccQAPVDxI0QWNsv8dAlgeOaMF1nWU5bouU3cBMwhHFlxz3vz6Ke7XSUiaRYCKz02ZkAd+nxIhHQCCdsl+UUxeybFhfcnmXkIt+zCNFE6SN27CGNDksDumieTr1ZuwIKmgEB4/H/XirqiC8E/xdsBnuN9R4FskbNkWDsLZEenVvz5z3xEAYNGZQpWrw11Wbh/djAiI+HLKgR7VNL7wIbCLO9Jp49wXmNYQg07zeT08rxomsPAHzQAx2TbhoYlMyQSgh/P2aV9yQyGoqaed6NWw0LcKH6RADevMvjfsSxSqb7XHDd7FsSlz+khkGU+gAPSc/rWKBIIz5HakAkCqYBAePx/14T3qNkdp51GdNccS6BIdTKyfkJyjEzghaYr/+sX9aMa2nEpZRrkFj2j6lhorejLvuTBzKDiFQzebD+cTO6ajefAsMsvlO/4+QQ6oF/DviC/T/DIV5N2sf4FbC2qdiR+rfeplH3OYy3XYVlVhjlDc/ruvla0lMhRjlSHscPCCI4mBzaMRlgfWC3rGlrat2Mvw/Vpfg8U5t0vyxsS/mu+BWgzQ==\"},{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"b\": 3,\"a\": 2}}}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 57,\"candidatesTokenCount\": 10,\"totalTokenCount\": 176,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 57}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 10}],\"thoughtsTokenCount\": 109},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-19T11:04:41.912108Z\",\"responseId\": \"SaQdaezVN9aD0ekPxJfk-Qg\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.962946083s + duration: 2.471145375s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1138 + content_length: 1956 host: us-east5-aiplatform.googleapis.com body: | - {"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"}}]}]} + {"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":"CjYB4/H/XqxbQHp2lO9C6z3WWzvVvCiyYUrbBx1L6sQ7hZMExUrufaOgtboKjNVDxYTfY4AsVGcKagHj8f9e1baijGdlfKMfiyGh7mqF3XxfqA9oBZ0mq80e35Kg/CFJiNoFvmmg5vzmSNFq+VLsp92Hw1SCypKySEiF01T0znZgyHN0XwoHeKXAgKk1zFd/Mh9qSsLSC/TPC4vMzjL0qu8Y9RwKZwHj8f9e76FXbccQAPVDxI0QWNsv8dAlgeOaMF1nWU5bouU3cBMwhHFlxz3vz6Ke7XSUiaRYCKz02ZkAd+nxIhHQCCdsl+UUxeybFhfcnmXkIt+zCNFE6SN27CGNDksDumieTr1ZuwIKmgEB4/H/XirqiC8E/xdsBnuN9R4FskbNkWDsLZEenVvz5z3xEAYNGZQpWrw11Wbh/djAiI+HLKgR7VNL7wIbCLO9Jp49wXmNYQg07zeT08rxomsPAHzQAx2TbhoYlMyQSgh/P2aV9yQyGoqaed6NWw0LcKH6RADevMvjfsSxSqb7XHDd7FsSlz+khkGU+gAPSc/rWKBIIz5HakAkCqYBAePx/14T3qNkdp51GdNccS6BIdTKyfkJyjEzghaYr/+sX9aMa2nEpZRrkFj2j6lhorejLvuTBzKDiFQzebD+cTO6ajefAsMsvlO/4+QQ6oF/DviC/T/DIV5N2sf4FbC2qdiR+rfeplH3OYy3XYVlVhjlDc/ruvla0lMhRjlSHscPCCI4mBzaMRlgfWC3rGlrat2Mvw/Vpfg8U5t0vyxsS/mu+BWgzQ=="},{"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"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"text\": \"The sum of 2 and 3 is 5, and the product is 6.\",\"thoughtSignature\": \"CiIB4/H/XkgskiftxblvQtKnaPUHwvpnvRtARLh1flSf7S2BCl8B4/H/Xkgf7tGXREzzma36SRJHlASZky6tFTEZfTo04rNp3O304Z4XJKxvetB9Apc4LJlnPR4kLT3Hq04gT1iI7WQTAY2JuYBzy2brHXtjxJz0KudJW4/N1hqXWRL+QwpxAePx/14hN0ASU+jC3AIyPntWG7uCSqldtzR1LcaoiDZinJI9wWVAn35Xp2fncHkXwNw1evHWVBz0YpiCN480PTCDoc0UNUb1VBWuGsWEIf6fpZEtnV8/GICelQcKKLar6OGrFoVdLL4jz2sBuK9jr6YKowEB4/H/Xto+8y0rvZp0VUCldJa/91+1OuLOFzut+CXNb5M62mCr5AJB65XVbO21IABwGOFDl3dPDP38ZcAceJpkmpAX/7WeucrqmoFffvuC477sQDEmHVBLzxKruLsjqAYLoqBM8n1KnY8CZX8P3ZrTvT/oIXJ1LQFjnT2x4tK9V37cCdL/Lawvyy7fCeIk7tWRD8zXRrOg28Q00ML0W5jthnXTClwB4/H/XgOmDHX55PIa/4SMObXQ4OEckzh9abY8hlOro32dOQ15cW0Qfeosx7ObdN/adp4/VSs6wg65b3rh/PXEZlyVnIeI44o0YwQIXwHQkrEqqrlBUf9N0wC9HQryAQHj8f9ewEmxVrUbCU9E761sRSfvV7/XNV/cid6fx9wwpaYK2kc3eK0r2aLIq2L6EwiGf9pFb8hNJnhn7/vnfGagzjadqVxFt8n3/dKh84IFkkZgTOcn7SqBf77pnHtn3SUpmf/r4ggmG++SlPaOsEQjVZvc+2Y7PHQ0keXv0tE8hs8ZpTvDC00cq8xdc7tImJu/z2G0bwYv4x0kndllQZVlqcNQs0mGHJr+5Zilxf5xh0RDCNs8WvyqZiFTbnWu76tHM1wO2XtB6TXdEs3RReOXX8qmdQAM2NLVhjvaCEVmTmBp0HRCwx+eMPVRa1zYxrpwCucBAePx/148F/6p2sv6iMgFQBXFqLOA+OE5FUNm4eUqZWNZYStFTQbI4A6ANxXPvbcbAv7DtY61cHZDhPyrkp9zLSo5zGA7fols0Dk9tz6C6SwdzcGWOkG4SSyNQsgmJmSYY7S4mm5e+hXmPg4N/yjyIUMa6kDPxfrPpDIqMtvXh6dVt4IVrWdjC7unM/9vB0OW4s2TMuyyK089iPonII2TxR0bx8aYH0GU3tjFWlszfdEQUQYuoMPlMAovvj7nPiE9cUV+706GXcRNvYesvq/dACB3aWoBGmT3l42D+JlCWc9vWcwFCamxCvIBAePx/17Noj7zoFFWRobA84QHd65l4kLllJB9IAzxynk/2eYYoJe5ybYGCLaWzw/vuEnOQ4/y9dBLRgqxEfo+a3QEWPXWS4snWJX9tG5f0ZuODH77uEqTV3saT25LN4Y0K9b0/tQBBheR+ohkG5r/DJKALIMNGSKfYetMssNOtx4up03sNJymzp2ehf/kj//G5Yq975i3VHerCihiPwq0jNzXLx04giKUkiaM9D9kvSmbp0UnBaQGZvWg+/YXzcx1T+5wur1GURYRX4T+sO0h0JMtHzz3loL4DCdMgIknHkG//knFjSjOuYA4O9r+4gLmslQ=\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 73,\"candidatesTokenCount\": 19,\"totalTokenCount\": 345,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 73}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 19}],\"thoughtsTokenCount\": 253},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-03T19:53:36.159221Z\",\"responseId\": \"QAgJafXbCeGA0ekPtcmwmA0\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"The sum of 2 and 3 is 5, and their product is 6.\",\"thoughtSignature\": \"CiQB4/H/XgEAff7RDml+8hx/1vk6IUdWokgmFVPH856Slu3zxmUKVwHj8f9e0iELx1VVsnz2CSRw1K0XNV6ScsQx9SkmpZPl5TIhANatKRSUmuKstVbZUBc/aAi9bBMR913yy474PxR9Vf20Bt+bD+sKQ2DuCUSMQeeKNtYoiwpZAePx/172xjNlka1OXW00nDDuriJX6ldv83VQ/bby5CMLN3+/K5MpNE/tlci8CT+l7YY9YMNPycjWX9p05JezAtkTeQnWmGdDycRpY9WzRz+AsoO7N3xQEcQKlwEB4/H/Xr61E3Q0KGZahZ7tuVVGq7wHbYO4/VfTZ6DuQTW3Fpu8xPEKnmWxKNpihVxV/PzfN748f6defVwCng7ZfFkXJzRmBnx5Q1evgyF0X4v1xtLyFy/sIwbtRqFd2zNKpQuPLq1AfsMAyR0nCtpLPumK7mQrn5OztVFcpa7jiOPZslDZXn+FeIaueokQt/4d0L9OPwNL\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 73,\"candidatesTokenCount\": 19,\"totalTokenCount\": 160,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 73}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 19}],\"thoughtsTokenCount\": 68},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-19T11:04:44.373725Z\",\"responseId\": \"TKQdad3nFpeI0ekPpeWk2Ac\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 3.375502417s + duration: 1.575863208s diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple.yaml index 20f979c7473a07d890556a2b7c789423f82a7c9e..82a99cb1be1befdca9cd5402ca730d032b0a797c 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-pro:generateContent method: POST response: @@ -31,18 +31,18 @@ interactions: "role": "model", "parts": [ { - "text": "Of course! Here are the most common ways:\n\n* **Oi** (This is the most common and informal, like \"hi\")\n* **Olá** (This is like \"hello\" and can be used in both formal and informal situations)\n\nYou can also combine them with \"how are you?\":\n\n* **Oi, tudo bem?** (Hi, how are you?)" + "text": "Of course! The most common ways to say \"hi\" in Portuguese are:\n\n* **Olá** (pronounced *oh-LAH*) - This is the direct translation of \"Hello\" and can be used in any situation, formal or informal.\n* **Oi** (pronounced *OY*) - This is more casual, like \"Hi,\" and is what you'll hear most often in Brazil.\n\nYou can also combine them with \"How are you?\":\n\n* **Oi, tudo bem?** (Hi, how are you?)" } ] }, "finishReason": "STOP", - "avgLogprobs": -1.3811639073383377 + "avgLogprobs": -1.1641908612167626 } ], "usageMetadata": { "promptTokenCount": 9, - "candidatesTokenCount": 83, - "totalTokenCount": 811, + "candidatesTokenCount": 114, + "totalTokenCount": 1001, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { @@ -53,18 +53,18 @@ interactions: "candidatesTokensDetails": [ { "modality": "TEXT", - "tokenCount": 83 + "tokenCount": 114 } ], - "thoughtsTokenCount": 719 + "thoughtsTokenCount": 878 }, "modelVersion": "gemini-2.5-pro", - "createTime": "2025-11-03T19:52:59.997761Z", - "responseId": "GwgJaYHzPNnEptQP9fCJyQY" + "createTime": "2025-11-19T11:04:09.768454Z", + "responseId": "KaQdacbzLpTEptQP6pORgAo" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 9.378146209s + duration: 10.878821375s diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple_streaming.yaml index 4cc01b799705afefc94a4c7ea0290b9f6f058d68..ba0ac436e65c034dc2fc263daeb3b3d5da271c49 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/simple_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-pro:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"Of course! The most common ways to say \\\"hi\\\" in Portuguese are:\\n\\n* **Oi** (more informal, like \\\"hi\\\")\\n* **Olá** (a bit more formal, like \\\"hello\\\")\\n\\nYou might also hear people greet each other with **Tudo bem?**, which means \\\"How\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-03T19:53:10.259251Z\",\"responseId\": \"JggJabPpD9KK0ekP6b_N-Q0\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \" are you?\\\" or \\\"Is everything well?\\\".\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 9,\"candidatesTokenCount\": 74,\"totalTokenCount\": 733,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 9}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 74}],\"thoughtsTokenCount\": 650},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-03T19:53:10.259251Z\",\"responseId\": \"JggJabPpD9KK0ekP6b_N-Q0\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"Of course! The most common ways to say \\\"hi\\\" in Portuguese are:\\n\\n* **Olá** (This is the standard \\\"Hello,\\\" and it works in any situation, formal or informal.)\\n* **Oi** (This is a more informal \\\"Hi,\\\" and it's extremely common, especially\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-19T11:04:21.427607Z\",\"responseId\": \"NaQdadeMGo6C0ekP1u_dqQs\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \" in Brazil.)\\n\\nYou might also hear:\\n\\n* **Bom dia** - Good morning\\n* **Boa tarde** - Good afternoon\\n* **Boa noite** - Good evening / Good night\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 9,\"candidatesTokenCount\": 106,\"totalTokenCount\": 815,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 9}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 106}],\"thoughtsTokenCount\": 700},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-19T11:04:21.427607Z\",\"responseId\": \"NaQdadeMGo6C0ekP1u_dqQs\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 7.995516459s + duration: 8.8158165s diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool.yaml index ad189c61500844ff80da07e100f85c22b37613f5..53a50143234a49253496292666851172a06cdf40 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-pro:generateContent method: POST response: @@ -34,21 +34,21 @@ interactions: "functionCall": { "name": "weather", "args": { - "location": "Florence, Italy" + "location": "Florence,Italy" } }, - "thoughtSignature": "CowEAePx/16C696DNWj4PuxMNS0zO6v+tdCJF1yJnn07eZuEPLPnvQ6p+oyw3hrynhBTBfnV4DLp94IKgX2qrApBR+CmZ3tqxhvwAG3luoBPWFlXTHfTGClpOrLI3Un76DOTzl3LCtmclum3o8kXE4V5PmRCeO2WXfLnwdy/hxs86ksrxyN6Y5edf1q/9tfu4PIJU+DpsJ7dNO6VZ5Lg0+FHxmVbXJq6Gpe/0FlwCXqolzyPeKMfhcTFUQtjr99pmS4rHWLDIF2ftwUBWzZembLj24OF+vWikxaWRcojZ5rh3KTluf+czMQWbGmmZUOsuRiOd84J/n1HDkqJ9RRGXSOrbiHpRasvNaMbLG6ufvkPSKm++DYe+tVmx40dwbr7hStfhAgKyNcBjRctIj9lHFlX1jczygVAxsv+6DK6UjEgZNWKtzkecZTzJWCzwLoQqpa56DD9eiMvq2Btfw47SxRkRTbQTOyJvPGVPBqaJksU2qOOprUdCqVCcxbJJfcFcVrTRiz1TNVTs89U1JiWm71RBJqXQBgLYYfryqSJ6E6lAlejy+7nc0q6YPleHC+4K3XyL2I5Q5HUwoEjEHnMCYAe+J68ztkjRablCHICIWJI08O+Ii9hgF9wIEkoZlA2A3deHYWfDh1mMjdZEZ2IibwroGaRaSq6AOJUyfWL9GgJb3/OnNWhpw6MlLV0Ol4=" + "thoughtSignature": "Cu4EAePx/14ljyE7z5hE6T9t7Cpe3xNFuB93gWa2T9NLfeE459sJp1VDMgbMx/6eM/sTYTOGkK/KU5UiVl+Kc5sQB3S6DYZfyn0K/yJmKxcXH27PwGXE7mBs4u45F3Tb+7mQHr0E5LroPO8LXN4J/UFb6g977nMHeJFXFxuQWU+tqtRy7gHRF+5ykdRmzHCkjHiCxuMO+KlJbU7PvX76b1seSG47Y+jaa/saPxnVSV1tLpTV+N6jujTYPcsgY/0+zzyERBve0PVpbGTlD2BBGOaOCG+6C0fQjS2kqgIceGWhzwfbAbl+LvaruGqmjx8lGLcXcOlbtKOlZtPQJg8gyIHGG1JB9Ufg5XD94MZ1ie4z+WCsfqtigiKKu6ndLSsycnntb1XLEhhAh+aoSab+MJf83SWnM7hvNCwLzIt7AFyWLKEDPW2sOYBtIyvR1RSCUEZqcbEwnsLdt4vzTVDsktoSpKAybdnN9MZ58z8AXsYhhumOCOxTn4mZvMXd6UBAmcOafK3awfh8CWrEc/+l1PBzsYWMepHXxEiYk53uXfz8eUTERXe9snKacpDiZTjiljFvtxMUSFXrcUjGL9GgH+2aQ9d4tunJ6sObwLodMJlYTrLNMIbEcKehmW4vEJ56ETT+6J9CfxB2SeQmfbLMsrUCmcY3yaP5qwNx6PQc/Wwi2lrYWec70EopPuOIT9/Yo/QcPTlqhsm7QrMLfflMtmGkqTUBUFOCOovA1ZzLhz+k+QsZNBjaGs62AXlgW5Y4779WMgoTOyFWdDAld6kVOOzHjHACVEfIdMlpSnbLQytA+Ri7GwoxxFv1TXlmYSXZXQ==" } ] }, "finishReason": "STOP", - "avgLogprobs": -0.95030345916748049 + "avgLogprobs": -0.74591360092163084 } ], "usageMetadata": { "promptTokenCount": 28, "candidatesTokenCount": 5, - "totalTokenCount": 155, + "totalTokenCount": 180, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { @@ -62,32 +62,32 @@ interactions: "tokenCount": 5 } ], - "thoughtsTokenCount": 122 + "thoughtsTokenCount": 147 }, "modelVersion": "gemini-2.5-pro", - "createTime": "2025-11-03T19:53:18.064499Z", - "responseId": "LggJafP3A62G0ekP9tjQmAk" + "createTime": "2025-11-19T11:04:30.222222Z", + "responseId": "PqQdaY7IDaOA0ekP6aHL2Ac" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.300412708s + duration: 2.247443792s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 723 + content_length: 1580 host: us-east5-aiplatform.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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"Cu4EAePx/14ljyE7z5hE6T9t7Cpe3xNFuB93gWa2T9NLfeE459sJp1VDMgbMx/6eM/sTYTOGkK/KU5UiVl+Kc5sQB3S6DYZfyn0K/yJmKxcXH27PwGXE7mBs4u45F3Tb+7mQHr0E5LroPO8LXN4J/UFb6g977nMHeJFXFxuQWU+tqtRy7gHRF+5ykdRmzHCkjHiCxuMO+KlJbU7PvX76b1seSG47Y+jaa/saPxnVSV1tLpTV+N6jujTYPcsgY/0+zzyERBve0PVpbGTlD2BBGOaOCG+6C0fQjS2kqgIceGWhzwfbAbl+LvaruGqmjx8lGLcXcOlbtKOlZtPQJg8gyIHGG1JB9Ufg5XD94MZ1ie4z+WCsfqtigiKKu6ndLSsycnntb1XLEhhAh+aoSab+MJf83SWnM7hvNCwLzIt7AFyWLKEDPW2sOYBtIyvR1RSCUEZqcbEwnsLdt4vzTVDsktoSpKAybdnN9MZ58z8AXsYhhumOCOxTn4mZvMXd6UBAmcOafK3awfh8CWrEc/+l1PBzsYWMepHXxEiYk53uXfz8eUTERXe9snKacpDiZTjiljFvtxMUSFXrcUjGL9GgH+2aQ9d4tunJ6sObwLodMJlYTrLNMIbEcKehmW4vEJ56ETT+6J9CfxB2SeQmfbLMsrUCmcY3yaP5qwNx6PQc/Wwi2lrYWec70EopPuOIT9/Yo/QcPTlqhsm7QrMLfflMtmGkqTUBUFOCOovA1ZzLhz+k+QsZNBjaGs62AXlgW5Y4779WMgoTOyFWdDAld6kVOOzHjHACVEfIdMlpSnbLQytA+Ri7GwoxxFv1TXlmYSXZXQ=="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/models/gemini-2.5-pro:generateContent method: POST response: @@ -104,39 +104,39 @@ interactions: "role": "model", "parts": [ { - "text": "The weather in Florence, Italy is 40 degrees Celsius. \n" + "text": "The weather in Florence, Italy is 40 degrees Celsius.\n" } ] }, "finishReason": "STOP", - "avgLogprobs": -0.077328896522521978 + "avgLogprobs": -0.023431075470788137 } ], "usageMetadata": { "promptTokenCount": 38, - "candidatesTokenCount": 15, - "totalTokenCount": 53, + "candidatesTokenCount": 14, + "totalTokenCount": 52, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "TEXT", - "tokenCount": 38 + "tokenCount": 183 } ], "candidatesTokensDetails": [ { "modality": "TEXT", - "tokenCount": 15 + "tokenCount": 14 } ] }, "modelVersion": "gemini-2.5-pro", - "createTime": "2025-11-03T19:53:20.397608Z", - "responseId": "MAgJaaiiGNGE0ekPn_2gsAo" + "createTime": "2025-11-19T11:04:32.497194Z", + "responseId": "QKQdaaqsHomA0ekP5JSJ8Qc" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.349412417s + duration: 1.2568785s diff --git a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool_streaming.yaml b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool_streaming.yaml index b03b6da16541c483e8ea7ff40bdd689bf64fcfdd..49f489eb9f5781c37552fbe2c5298013c6589100 100644 --- a/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool_streaming.yaml +++ b/providertests/testdata/TestGoogleCommon/vertex-gemini-2-5-pro/tool_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiIB4/H/XhZZB0TWHec65qEVyQd4IhQI1EuGj8UuZOSqmXpwCmUB4/H/Xp7XOoeqoXHg6gFPm5mPOWzYFWJ8qbgh7Tt5LXBCcVzseHowg0EXsdXs1ZK97zzIHdvtxQ0OpQYwD3WFq5gRglkFSLs83xgOUTBMC3ayrFTlwFeYVk6Yf3zRXDIqeyaY/ApjAePx/14PSFyzAMtm0iEc7+8DX+XQEoCQqdWmqMeNEkpg/1x5S24YbebsFyqTN4BBFPffReNltuHil4h3adPMjAJiK7d/CpwB8reGhx/+7CV7557Mzlq4xEXCljbbQm9ftvB8CqcBAePx/17y3TuQan7rDijjgOrPi36IXyaun+bR/oPcv+Xuv7aWlNa2VmUwhy3jwZ2rzeoxmVtjAx4Fqima1/56KFNufuEtStUZNXsMo1EcKEiIVIMoJrGD+6lsahyYM+M0gmbMnh6gG4fFXv2h4VMK8WW/V5Gctk0CovjA4l3xMrsFw8eWvAdJILs559N+Na8kK5NFItZmI3Q6wDXphCMacV2dLVgvKSsKqAEB4/H/Xt1bMyb5Lf3GLBshtvvq4UeI3DskQ87pM4Tn7Z0xVysuXLUBcWCtEwkzLDCLIQwpiW69GuulFU1mNNofFhzk/xcLApFnJ/b55sqEkJ31JU4EtSz1flNY70fkLDJDmwRXZ2MCFNE22SK0ndOv8rDPhOvAQ7uCC73sAkoQQTzLkCU+pAuAizzx96N2cijmEPM7LbcshBvg8NGfWuU/5OGcU2Xq1NcKNwHj8f9estCUriipiaQSNt2sVM8cx3ngVIK0dYpOZDb2Pb/JjqODMCWctM/PvdJDQE0MgUng/Rc=\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 28,\"candidatesTokenCount\": 5,\"totalTokenCount\": 140,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 28}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 5}],\"thoughtsTokenCount\": 107},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-03T19:53:21.976448Z\",\"responseId\": \"MQgJacDMO_eS0ekPq9DjiA4\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence,Italy\"}},\"thoughtSignature\": \"CiIB4/H/XuGEqIkixg/vsdLNO/XLdMRIZWrA4iDLpx8bp1ChCmUB4/H/Xoj6y7XCdrBliXjSjdFbjGTIHnTA9YwnccwE2dLTxHzOJ92RLCPgzO88hXs1xOzNXD8+/BC4WYDIxscHvvQevTaThD9T9w2ZR+yCElxo+PwMgDiuPFGHkB+XEtVivx1chApjAePx/14yHfyzssNIJ5Kw9cHYnXQl1hlVSRM0suf+tqfI+vE5FCVa7mhohZRmW36oYdjWkeKEIKALgBBr5C5Q+MZujY9w1b+jW+Dah66ucWpODv1LOlet4qMPuRwr/zAZ/iRSCqoBAePx/16kFfr13j/F3N5RIbe2LZPv1Jz49ZsxKJelffFaZMMCxlLIgAi+cSEQejQj3J7nehUSvpi6e6Q29QOdXZn4s089OPoZ4wvnRU4BIU5RC1OUZGrAmPv8kocrjkGr/pXTEjQ1mirmG3OX74GA+ISPTHFclQZVREd9QNp1wRsFejJ9HKVTd8f9jOhfuUuWOSBw8jW1MpSvQ4lb5rkHVogo5qVirprIFbEKrQEB4/H/XpvI9HymzllORqZ25uT8VLEfc0qPs61CgMxYMsfgL0asvIcdSB02N0pXYmiRDLjLR1T1Pkh8c/L7M0G7PTvtoNjPMzkdz0msb3Odf8LiLQWtyMbiPwjxGU7s8rsnN65To+VKIl5pyNxtyIThgA4haz1f2V6ygnu/JT1TFUd31YH2je7q1Olg9rgyy6X4Pp7mKToTqnt3yIjSU7PAbirotUM6T6kZz7tEkgqRAQHj8f9elrIUctW0pfELICfLw6h2P7DLspahCrZm2AOGGJfKoe7WA+aMM9LakL2teH+QOSmoeoRNQuBJUwe9l8dMGPEUcGixd/iyxTyKs0krpQsHlsxK3iGbuAcqNXNJxgCS1DpbW81yZ7pOFgPjnRFnD+/ctSGHBMwIffEaPruRkbE1HCCBVh8DE5kHeRJ5jK8=\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 28,\"candidatesTokenCount\": 5,\"totalTokenCount\": 164,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 28}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 5}],\"thoughtsTokenCount\": 131},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-19T11:04:33.920749Z\",\"responseId\": \"QaQdaa2ZOKKA0ekP7dGKsQc\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 2.198163459s + duration: 2.54737625s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 723 + content_length: 1728 host: us-east5-aiplatform.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"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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":"CiIB4/H/XuGEqIkixg/vsdLNO/XLdMRIZWrA4iDLpx8bp1ChCmUB4/H/Xoj6y7XCdrBliXjSjdFbjGTIHnTA9YwnccwE2dLTxHzOJ92RLCPgzO88hXs1xOzNXD8+/BC4WYDIxscHvvQevTaThD9T9w2ZR+yCElxo+PwMgDiuPFGHkB+XEtVivx1chApjAePx/14yHfyzssNIJ5Kw9cHYnXQl1hlVSRM0suf+tqfI+vE5FCVa7mhohZRmW36oYdjWkeKEIKALgBBr5C5Q+MZujY9w1b+jW+Dah66ucWpODv1LOlet4qMPuRwr/zAZ/iRSCqoBAePx/16kFfr13j/F3N5RIbe2LZPv1Jz49ZsxKJelffFaZMMCxlLIgAi+cSEQejQj3J7nehUSvpi6e6Q29QOdXZn4s089OPoZ4wvnRU4BIU5RC1OUZGrAmPv8kocrjkGr/pXTEjQ1mirmG3OX74GA+ISPTHFclQZVREd9QNp1wRsFejJ9HKVTd8f9jOhfuUuWOSBw8jW1MpSvQ4lb5rkHVogo5qVirprIFbEKrQEB4/H/XpvI9HymzllORqZ25uT8VLEfc0qPs61CgMxYMsfgL0asvIcdSB02N0pXYmiRDLjLR1T1Pkh8c/L7M0G7PTvtoNjPMzkdz0msb3Odf8LiLQWtyMbiPwjxGU7s8rsnN65To+VKIl5pyNxtyIThgA4haz1f2V6ygnu/JT1TFUd31YH2je7q1Olg9rgyy6X4Pp7mKToTqnt3yIjSU7PAbirotUM6T6kZz7tEkgqRAQHj8f9elrIUctW0pfELICfLw6h2P7DLspahCrZm2AOGGJfKoe7WA+aMM9LakL2teH+QOSmoeoRNQuBJUwe9l8dMGPEUcGixd/iyxTyKs0krpQsHlsxK3iGbuAcqNXNJxgCS1DpbW81yZ7pOFgPjnRFnD+/ctSGHBMwIffEaPruRkbE1HCCBVh8DE5kHeRJ5jK8="}],"role":"model"},{"parts":[{"functionResponse":{"id":"1","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://us-east5-aiplatform.googleapis.com/v1beta1/projects/fantasy-playground-472418/locations/us-east5/publishers/google/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\": {\"role\": \"model\",\"parts\": [{\"text\": \"The weather in Florence\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-03T19:53:24.181679Z\",\"responseId\": \"NAgJaa-LC--B0ekPkrjFqA8\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \", Italy is 40 degrees Celsius. \\n\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 15,\"totalTokenCount\": 53,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 15}]},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-03T19:53:24.181679Z\",\"responseId\": \"NAgJaa-LC--B0ekPkrjFqA8\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \"The\"}]}}],\"usageMetadata\": {\"trafficType\": \"ON_DEMAND\"},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-19T11:04:36.481439Z\",\"responseId\": \"RKQdaZ-xHa6B0ekPlJO-oQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": \"model\",\"parts\": [{\"text\": \" weather in Florence, Italy is 40 degrees Celsius.\"}]},\"finishReason\": \"STOP\"}],\"usageMetadata\": {\"promptTokenCount\": 167,\"candidatesTokenCount\": 13,\"totalTokenCount\": 180,\"trafficType\": \"ON_DEMAND\",\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 167}],\"candidatesTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 13}]},\"modelVersion\": \"gemini-2.5-pro\",\"createTime\": \"2025-11-19T11:04:36.481439Z\",\"responseId\": \"RKQdaZ-xHa6B0ekPlJO-oQk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.139946417s + duration: 803.423291ms diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object.yaml index 551687a567c9a69407b47b716dbe1322514829ae..6ff9f0fd13edbc46f749fc30cf35cdb5e3707dfb 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -42,21 +42,21 @@ interactions: "usageMetadata": { "promptTokenCount": 38, "candidatesTokenCount": 41, - "totalTokenCount": 218, + "totalTokenCount": 230, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 38 } ], - "thoughtsTokenCount": 139 + "thoughtsTokenCount": 151 }, "modelVersion": "gemini-2.5-flash", - "responseId": "stsRaZqEJ9qO28oPiaHWwQ4" + "responseId": "yaIdaduGCfahxN8P3p7vwQc" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.554350125s + duration: 1.690439333s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object_streaming.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object_streaming.yaml index a9e9e05a27aeb3663a159d49b821f2567f31d84d..52dc75f196b38ebeb806140609033ad7aa22f6fc 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object_streaming.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/complex_object_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\\"author\\\":{\\\"name\\\":\\\"J.R.R. Tolkien\\\",\\\"nationality\\\":\\\"British\\\"},\\\"genres\\\":[\\\"fantasy\\\",\\\"adventure\\\"],\\\"published_year\\\":1954,\\\"title\\\":\\\"The Lord\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 37,\"totalTokenCount\": 205,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 130},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"s9sRaeWODKqYvdIP4_6V6Q8\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" of the Rings\\\"}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 41,\"totalTokenCount\": 209,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 130},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"s9sRaeWODKqYvdIP4_6V6Q8\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\\"author\\\":{\\\"name\\\":\\\"J.R.R. Tolkien\\\",\\\"nationality\\\":\\\"British\\\"},\\\"genres\\\":[\\\"fantasy\\\",\\\"adventure\\\"],\\\"published_year\\\":1954,\\\"title\\\":\\\"The Lord\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 37,\"totalTokenCount\": 210,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 135},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"yaIdaYqFMfuDvdIPn_iEyAk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" of the Rings\\\"}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 41,\"totalTokenCount\": 214,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 135},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"yaIdaYqFMfuDvdIPn_iEyAk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.408184334s + duration: 1.379188208s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object.yaml index 13cc2c9e1027070f8dd98d13eac26a1dc7c89150..4ee78db35126c751a2c2b95edfefb289bf8d91e1 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "{\"age\": 30, \"city\": \"Paris\", \"name\": \"Alice\"}" + "text": "{\n\"age\": 30,\n\"city\": \"Paris\",\n\"name\": \"Alice\"\n}" } ], "role": "model" @@ -41,7 +41,7 @@ interactions: ], "usageMetadata": { "promptTokenCount": 20, - "candidatesTokenCount": 19, + "candidatesTokenCount": 25, "totalTokenCount": 127, "promptTokensDetails": [ { @@ -49,14 +49,14 @@ interactions: "tokenCount": 20 } ], - "thoughtsTokenCount": 88 + "thoughtsTokenCount": 82 }, "modelVersion": "gemini-2.5-flash", - "responseId": "r9sRaffqJa-jvdIPwMT46A8" + "responseId": "xqIdab_LEP7hxN8PyeLZ6Ac" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 1.129109875s + duration: 1.1166025s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object_streaming.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object_streaming.yaml index fddf50af755441d88db58e72372af73778efe411..0f1c4b51ead92c23f72aae3865e87f2a27083451 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object_streaming.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-flash/simple_object_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\\"age\\\": 30, \\\"city\\\": \\\"Paris\\\", \\\"name\\\": \\\"Alice\\\"}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 19,\"totalTokenCount\": 138,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 99},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"sNsRad21He_hxN8PlPed0Qs\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\\"age\\\": 30, \\\"city\\\": \\\"Paris\\\", \\\"name\\\": \\\"Alice\\\"}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 19,\"totalTokenCount\": 133,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 94},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"xqIdabK5MLfbvdIP6NWWuQk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.556089083s + duration: 1.214252541s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object.yaml index ea767a1ff6f0f319966074297eee1e989c72ec92..6d1dd36b08c48313d859b9ad6b2ae01ae9326bed 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "{\n \"author\": {\n \"name\": \"J.R.R. Tolkien\",\n \"nationality\": \"British\"\n },\n \"genres\": [\n \"Fantasy\",\n \"Adventure\"\n ],\n \"published_year\": 1954,\n \"title\": \"The Lord of the Rings\"\n}" + "text": "{\n \"author\": {\n \"name\": \"J.R.R. Tolkien\",\n \"nationality\": \"British\"\n },\n \"genres\": [\n \"Fantasy\",\n \"Adventure\",\n \"High fantasy\"\n ],\n \"published_year\": 1954,\n \"title\": \"The Lord of the Rings\"\n}" } ], "role": "model" @@ -41,22 +41,22 @@ interactions: ], "usageMetadata": { "promptTokenCount": 38, - "candidatesTokenCount": 78, - "totalTokenCount": 352, + "candidatesTokenCount": 84, + "totalTokenCount": 195, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 38 } ], - "thoughtsTokenCount": 236 + "thoughtsTokenCount": 73 }, "modelVersion": "gemini-2.5-pro", - "responseId": "v9sRad3jAc_7xs0P77zDwQE" + "responseId": "0qIdaciCFffPvdIPp-ycyAk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 4.027611625s + duration: 2.813791334s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object_streaming.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object_streaming.yaml index 9adeb839977f64d2be3beee0791aae3b6b5efb7a..5a8200d8f07a1f240e0295981dcc8e771b1a4982 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object_streaming.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/complex_object_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\n \\\"author\\\": {\\n \\\"name\\\": \\\"J\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 14,\"totalTokenCount\": 419,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 367},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"wNsRadCzOKX6vdIPva2A4Qs\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \".R.R. Tolkien\\\",\\n \\\"nationality\\\": \\\"British\\\"\\n },\\n \\\"genres\\\": [\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 38,\"totalTokenCount\": 443,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 367},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"wNsRadCzOKX6vdIPva2A4Qs\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\\n \\\"fantasy\\\",\\n \\\"adventure\\\"\\n ],\\n \\\"published_year\\\": 195\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 60,\"totalTokenCount\": 465,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 367},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"wNsRadCzOKX6vdIPva2A4Qs\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"4,\\n \\\"title\\\": \\\"The Lord of the Rings\\\"\\n}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 76,\"totalTokenCount\": 481,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 367},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"wNsRadCzOKX6vdIPva2A4Qs\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\n \\\"author\\\": {\\n \\\"name\\\": \\\"J\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 14,\"totalTokenCount\": 188,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 136},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"06IdadTyD9b9vdIP4ITmwQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \".R.R. Tolkien\\\",\\n \\\"nationality\\\": \\\"British\\\"\\n },\\n \\\"genres\\\": [\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 38,\"totalTokenCount\": 212,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 136},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"06IdadTyD9b9vdIP4ITmwQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\\n \\\"fantasy\\\",\\n \\\"adventure\\\"\\n ],\\n \\\"published_year\\\": 195\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 60,\"totalTokenCount\": 234,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 136},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"06IdadTyD9b9vdIP4ITmwQk\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"4,\\n \\\"title\\\": \\\"The Lord of the Rings\\\"\\n}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 76,\"totalTokenCount\": 250,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 136},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"06IdadTyD9b9vdIP4ITmwQk\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 4.864529167s + duration: 2.114800584s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object.yaml index d130b2eb4f6f179487b6e625c8dfa63b3af4cdc6..ec328ed4bbde8e8849320f30df9333dd9e3f8077 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -42,21 +42,21 @@ interactions: "usageMetadata": { "promptTokenCount": 20, "candidatesTokenCount": 28, - "totalTokenCount": 109, + "totalTokenCount": 112, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 20 } ], - "thoughtsTokenCount": 61 + "thoughtsTokenCount": 64 }, "modelVersion": "gemini-2.5-pro", - "responseId": "ttsRacXtC86PvdIP1Zjy8AE" + "responseId": "zKIdabLLD5GavdIPxvbZkQ8" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.077859292s + duration: 1.691421375s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object_streaming.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object_streaming.yaml index df99b2303543aea48320b4701e08b3c1b5dc6dae..ac82ab49ab8ecc7c7cb236f1c59a37543cf2b8f5 100644 --- a/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object_streaming.yaml +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-2.5-pro/simple_object_streaming.yaml @@ -17,7 +17,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.34.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse method: POST response: @@ -25,10 +25,10 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\n \\\"age\\\": 30,\\n \\\"city\\\":\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 15,\"totalTokenCount\": 189,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 154},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"udsRabusHJH_xN8PppGAiQ8\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \" \\\"Paris\\\",\\n \\\"name\\\": \\\"Alice\\\"\\n}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 28,\"totalTokenCount\": 202,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 154},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"udsRabusHJH_xN8PppGAiQ8\"}\r\n\r\n" + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\\"age\\\":30,\\\"city\\\":\\\"Paris\\\",\\\"name\\\":\\\"Alice\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 13,\"totalTokenCount\": 296,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 263},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"zaIdafuIG7KlxN8P_d3JsAg\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\\\"}\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 14,\"totalTokenCount\": 297,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 263},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"zaIdafuIG7KlxN8P_d3JsAg\"}\r\n\r\n" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 4.791360833s + duration: 3.282518084s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object.yaml new file mode 100644 index 0000000000000000000000000000000000000000..266c4c9d12ad7ce1a85a84afcbcde2e6b920811b --- /dev/null +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 817 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"Generate information about 'The Lord of the Rings' book by J.R.R. Tolkien, including genres like fantasy and adventure, and its publication year (1954)."}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000,"responseJsonSchema":{"properties":{"author":{"properties":{"name":{"description":"Author's name","type":"string"},"nationality":{"description":"Author's nationality","type":"string"}},"required":["name","nationality"],"type":"object"},"genres":{"description":"List of genres","items":{"type":"string"},"type":"array"},"published_year":{"description":"Year the book was published","type":"integer"},"title":{"description":"The book title","type":"string"}},"required":["title","author","genres","published_year"],"type":"object"},"responseMimeType":"application/json"}} + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "text": "{\"author\": {\"name\": \"J.R.R. Tolkien\", \"nationality\": \"British\"}, \"genres\": [\"Fantasy\", \"Adventure\"], \"published_year\": 1954, \"title\": \"The Lord of the Rings\"}", + "thoughtSignature": "Ev0RCvoRAdHtim8IbVoKzHu9DSiZ/yt55YYnW37+8kYX3lqSg5uk5kw71CkPqWhKJ6AXQFWon5dBWqSD3do+jhJx+yGDcyRxHiJgqVozeb24Wxls8TyIQyU9WftAzMoSm6wnO2paOtm9DV7a/cIiy4UIHTQecWF+GBxPgfUyuxWiFXsQ6w8ixovCvhboL/toE9JYcgLsLRw8hdBV8XhrDNu5Si4CkQi5Us5L1GqWLFcIk0Td5vlTWp0f51BFStujmDDtE/MDmuOgx1KO14TUddgZuYUxOFpizG433SSfCz9/eOT9FWWwga36siLgp525fLJ+2FbXOu08UIKWZVW/Gp2TCeDTj1AWYC6QqcYCBdWVy3pqKseEtXkxt0bTyKFbBGwTiklH+LrMmvN5AyDVYKdLV/Qc35T/3BrCPKQyBUyJK6aIkDP2i0sY7yHRfjTSiy1Bbj+h27AcwKkr533nNMNPPYK9goQtRtjrqOUXIA6g9ryIx2TsFOPJyi08MSIyCK/fM4ojpg477f7yRaKRd0x5BcV0tt9L7280AvEBhTs64XUorFgoT6J+WDZAJ+FQYL0VWDUkQkTu6u7BfmH9Fjc2q0YE/jxNK64Wmgmm57xT6vSrVhnUFgKsCN/M+nMbf5n3fSx6FENHZ7ZhbUu1AsiKYxwZL8S9B0WaQkws7au9BlUa9HW5kMcf0y5AzgiqHiTpJXqdAfs/vxm6nIDj/Fmz7ZjH1M2/8EM1PxRHN8MzCZ4WfSv29bh8+PC+neQXsBuJ/LYPEyWcOOlFLtJ4X3PGqoUgUsgOJaqgKaWlySy6wghS5sq8xC73zt7cbSurryteHGW46xl9MezT6ngEvNbi3rSXBxu6dSQMJAJ9ZXQqX+x5MS6UiLn3N0IboiqleHhiYNPNM2zHHFudTo/nRoAav0gu+b1PHn9njPiVxMlQ3gttPN/z+hNLvO56JE27tWxVQE+/ZpjRRRlgJ2chuAgBMA50EWYFGnqyNOer44nGtUcr5xgUEJV8YbUbUgEPGLN/QXa2nElR2+oCqbvax8hODOu3lji6o1ozq9PPzHDxVf8kjVkxULM4DtRiCgvXkzHlAOGov+PyDOIETE7e4U9hIG8vbHcAaHPymoy/JiyIqtb4qI7450oMlUAi08PmiQnmKlKHxYmTXo46M5R2i83evkVHE6rdCmwaxd5iIwTeNUj4/CtUPCiEUVSmYUqkYgTuQl4jZLuNyJzyiriYHSgTwUYbHS5yhkdhY3n6pNJf+aEWNLViIF7rpfU9BWGKXat5206gavvuGfxaz4e+fbb44atFAeJ20YJX1SOm5nlLDKOeMVmHhlqW3422UD8bqgdSBG+Elqm48h1o7rw+iVFpyxdveruFJ9r8ZFIhYKYHCmSyszhmRcwcmqjGbGHXBtujvcAzeu/b8N9YiTK9AEnR1IECZfmD+/+T2TpecfCNMZamFFB0Jx7OiManf36NJyZJ5+3JhrkSQTKqlFn/IhKbn5ThP36Yp32mza4GvzheboTmktmoUD6c5TLJ6g6wcLqTb6pxPvCBBsqICt3zVE6Y8DrursqfLsEFjFx73VGwlaD0DgsVvSA7Ty5bEaVTiiRg5ZuEwXaOxr8FEDPLCYp/uyO/H5MnXb8b3NMJYWmSSeXj0T8a8DQ0SvX8B2J9zQUT2ZSTVhpw8uULAKtortAL5NF7musMoUvPIzhAXkE9u9zK+CA9H5Lj/jl5dC9Uou2UDHWk1D76h23tmvU5fbih5w9V1cAwlqAHTlW6AEWlmSDYaHDj9h1C/FkAMOOc0L+26mAt9SEzGJ89YTdIte57ZeKHc1JiaXN4sVoc1A7wuDbrjooEE+DTgKQbUoiWX2KVoszYfBdhANiJX/sfd5rkfZVCFT0l07QLltwzOi6YFWN2gIyV3/pvOU8Pubdi8eQvxPel8wPUNS0N6n6S74D6A3ue5pJgeAVxl55sOXOyotGjAIqIEWWWrf6yW9ie+0p3YurQYlXWhjdOOnXnxtngSqq0mi0skN4TrU2kwov3IWgL8PTDPyRv//wMlP1VynzF74vZrqUxxrdursAZpnGURZSA3Ev7ROHCu2N3lIQ3KarPjD+MjLDxVaEqgBeLVIA35hSjKuRxmiUocpO97I0VlrTQj8ugaZBXw0I9kc2esaeUIbRDeRf2rqKiqH1b8yyGZiBD94MVo/PnDhNMd5waw1yhY+vcUk9Pq0+Vv5qplF7APVoDY+3I0Bd8c8ccM9x8FT5JYg7GNyz+LzRLs5GMoKrd5pOC1WbAebR51fpkCHyi76UfSGz2ST9Z9NCu9oY2imLH5RFWsxHwk4DRrhDKek7cT4ZuBNldK1sAA908ihhUvRWI+4itTlC0K/+GNMnbEUKf3DEX0zOPOVzPeWfmdD3On62u9PMDMA3rTn22IgOH/7eXFVMRuKFCgW2/8CIrKlq4CdoPMm+vwH603ExycKvFbvdtBJD1BSbHaLhui4YRsOzcoco+iYAQQnc03H7FzNAyPJ6XudCBCf79XV32CpSlM5rsURW8pYfKnzWpN0NPDmYNsRVTCZzJAc+G5dBiYDt551jXUZGrv9eK5aAXmhksbTst7cKz50kHjZrP33s2q410ZF2wu4scnOFxvBJeb1bl1xKH4lWMrSAi85I2pfZvbMriJzWcDjoGBNWaHHYe/4qLCS2iuQKOzzIGT2IUVPH656aF3q4HcQpcPCUaixihrEp/GRU/pGv+2jkemdCYf9SxtuCaECCZyQN9JAh8+BZHKUh5yO/XqQoj+uRjzDdIBA0gBh9lyvRXXLN6chQ4bd+DxpxXnrjf373YYBNbLp5t+1oDbrrO/PYrKz1p1CUXAUkM/KFLW3E08ZQ19HNirif+edyCKB/CQQtw05vWZkngTXdwbOsvGhLY3jXoOGCrqNOQrewWCHWFmjf2JxTXaaeEi3fXyX0VPTDrjuHpz7barc9z/xfkDj+bm0aIStPrRYfT7eB1IAAQ/fu13Aa1wRac/vHrZAZFAa13/8aHgUjCnu1w+YQF0wB8vIB+0QHjolPdvgv4L79Uf/jxsfN4TyLW1yPnGs9bL0vt" + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0 + } + ], + "usageMetadata": { + "promptTokenCount": 38, + "candidatesTokenCount": 51, + "totalTokenCount": 747, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 38 + } + ], + "thoughtsTokenCount": 658 + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "v6Idae2xKIDXvdIP097RmAg" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 7.5885605s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object_streaming.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..431dd334272560bc4b8ef5e5adefe3f567145047 --- /dev/null +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/complex_object_streaming.yaml @@ -0,0 +1,34 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 817 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"Generate information about 'The Lord of the Rings' book by J.R.R. Tolkien, including genres like fantasy and adventure, and its publication year (1954)."}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000,"responseJsonSchema":{"properties":{"author":{"properties":{"name":{"description":"Author's name","type":"string"},"nationality":{"description":"Author's nationality","type":"string"}},"required":["name","nationality"],"type":"object"},"genres":{"description":"List of genres","items":{"type":"string"},"type":"array"},"published_year":{"description":"Year the book was published","type":"integer"},"title":{"description":"The book title","type":"string"}},"required":["title","author","genres","published_year"],"type":"object"},"responseMimeType":"application/json"}} + form: + alt: + - sse + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\n \\\"author\\\": {\\n \\\"name\\\": \\\"J.R.R. Tolkien\\\",\\n \\\"nationality\\\": \\\"British\\\"\\n },\\n \\\"genres\\\": [\\n \\\"Fantasy\\\",\\n \\\"Adventure\\\"\\n ],\\n \\\"\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 54,\"totalTokenCount\": 564,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 472},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"xaIdaeu3AtWNvdIPo9-nuA8\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"published_year\\\": 1954,\\n \\\"title\\\": \\\"The Lord of the Rings\\\"\\n}\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 78,\"totalTokenCount\": 588,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 472},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"xaIdaeu3AtWNvdIPo9-nuA8\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\",\"thoughtSignature\": \"EqMPCqAPAdHtim/qoClpB6Fl4IGbJM4ZYPxj4nlVArCL0UhKPbeG9D4l+wRoKuaWH96pLNpqU3B78AkB4JXsx0XKp8xv/Rz+sKgDqBAuMgV29GQc9flyvyX5T2fYEpnxFz+HiVtPrPhUeIM3WcEMNQdbmrAgCgBgYP7m5BxWQImTWtCYN7tvsMS9Sgsiz8nGRhe3Pj+AtWLSwCSwgSbO+7eCEZlLAovg24jIUvvzGk0nT82DRxpaQZNb4iZVLd8wKYX2lkBv7VEAyq/H6X34lTa4Ok9Jcpdns6c3j9oiDZmCwROfHoOGOs+bk35jEnrYWgdx8v8jS6yachQnwGQcnVkvdMCHzVXd7EaelY4YcxDQU72NYzpACmq8+1+3uFQj/22iHIqhGwuwaVScRxOKRp9+Y37acOkQFOtzsWlU7wKdlO95HcFtIp3gv1lyowYRKXMUKD0mq9dHl/xWL1WFL+moYgvmZoxounnm3n49TNdkqsfT5A+XyLyqUmcuyFOV0EXRaQBeazuK6smO8Knw6ZH3vElq7RoE1vvnclp5ghh2yP/5rWAyz8VtpJE46jPjt6yiifez5todGl2A4BK29U3mQIJqBS5JrdjAwK288aEsP1raBA6Je4Hef3S6pPUohBeLW9WFzZxjvmZ4De1rCByUSBj7oJaq8o//y1ng+31C0VXUlahuv79GfJcTlevo3Gy2EV+gLl5nLio+W3qURFeojrfGxwAQpNegaKjzr8LwSPX1rjY3dEJncNjUeB8DcLvCZ+vFXWF68/SWZw6q8mRSXtrADxUtlKx1Guus8fa3FhxdpGPlXdK36HaZWPfa3Hi2gPtZmq8rD4z55R4I+KSNW8jkjsE23v8dXrAcGnFcCs3u/FVvwnX15PDGWVs5rLwB33x5QJ5fZa55fgr4BO6axSSEa4EAhEthSXZ0H5XW1k3fAP1+pGWA2udfRJDOXRX5vMzZIsWWnwICG0rfj7akPPEkbXS+8z7KO6AlCGxjJoxBqS8fStoaCQ5pEvYUwNjLcpwtjeCAD/2LvRG2ZmOvtG3/RUPjYEuiQwc0tee2lLXCeNPv0G692XUUpe8ZVSXkLX5D9dPkq4aRZuv0JSuuZWWhkZIgjyvTns5ba2ISfLD6o1GNhTWhYDSi7LFg4Gc0k1lvtiIE94rNafAPrWmNFENxq2J6dFac7coG8mX3rakHQ/5azvW38DwlKh3vYSFg2oIanK1+4Pc4kBmQ/hscN1/2J2RXoqv7l52IXg0m6e3mgpis8TTYpvkCu7jRKnfRe5z6o13VmlW6jvwzUC/DBU/3n4rH18mlvb2ZjKiRjmZYWMyzc0cJNjR9K8ZZhPm4YRLzpeTuaisZvZXonSBJn1UCsrun3OFSyOn/aPr/+f0i86rRvK0SAjDw6LM80Xy/Mm7wnqRPkR93VXf9CRVyz7glt4ApcGkSbwkePFcsTEXq16wDIi6YgI8i9MZpb0lkCxzWTmyR2Oh3JWm8CHMf5OLM+lFqszPmyc0LOZdUcEM/M2sHt/SuSLtxnjtJ5Q6TemZvkctTugA6KzKPkeClzVlOYohJnVhqyo0pO2UZkhhWbmJ8BvLma3xKbs1dpTG0WpsWRiXoxcMBczYBoQWbbiJfp7UMCSicJuhzXJHsL/ANdbdWvw90ah3h26OBrRH+UCdZwumsLtfJGXUTkXYVpjrMrq0dEiuZ8mARDKpTi+CE9fhHBMJ68x2Ki66ZstG5mwgvJMx/vvjXECVCtBj4azL02PwyyPsWzNbT16KJILh3fbFkYEiBpjG3VHa2U8fqMODZgZ+zmC3q9HG2QK4IPqieEmdkEfMaShWdqit6YTR+BXIVkpm4SiQ0FIPYp64U9mfB1xVJrqqq60i/nVfGVXUtfsw7b7BtCoWvHexSUt/JPxV7c/0YHSah22cn7beBESS0QBNR0H85EfAhttq1koKF7DK3ribCvaWv4jtmPnDKLpfORdSnffvAMAm/U4JpcsIT5Hx5Q8BiWUnvDfOuFpONy3QuRu2ri6W4idVYEw7iF7ZWVQWjmUM9EPQ72uKnvmp0R7PKc3i5rYbJ/2IXoXkNkbOshw5Si82HhuBkgnROyY4bIHNyM9SGptzH31wGfkI698F07ENT7VP7hbuti7+kYv0AsA7ofYULyOAzFDJ/0uRHuQHZm50AbscWjZ6/Rh12f4qkeyCaYgs5G3bb7SkFVdCNw5csd01QmUIrds3nw2wZQpSkbsfI1HL84UV6x+wqo05NmUP4ZrU4SZ367Io2QnZ9e7ZIQBQLjuNapCSBhJ5M+E+f3my+He4lFU5JxP4B84pwmlYqWT0kO7Xo+APWDFRC9xmysK4YfMtJyBtmOvZcuM5BTRg8NMknr2DN5z9Q4Mc6ZUy7+Wt+9i5+bMD27+Xjl8n+9sNL0AFJuU/dhHYNDMm7MvXRpUOSV/9gne3eRkxKdHSWqnGwCSaB7KwzJYYxc7SPpI1GK/HpQWZGOvdvLF1g+WfgU2kqs7y31vLrzxLiZU28RVLo9bbV9thVzYld8gCc+8jp7jqFN9/H1ndS8KBRpxsluUs3YOmqNEQ7X8EBFmDmj0knu8lCf98B5lt1wf8QPH5AWV0ZBk4BFwY=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 38,\"candidatesTokenCount\": 78,\"totalTokenCount\": 588,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 38}],\"thoughtsTokenCount\": 472},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"xaIdaeu3AtWNvdIPo9-nuA8\"}\r\n\r\n" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 5.357591083s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e1f143aaf41f081f15c09f7ac9cca3efb2433334 --- /dev/null +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 499 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"Generate information about a person named Alice who is 30 years old and lives in Paris."}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000,"responseJsonSchema":{"properties":{"age":{"description":"The person's age","type":"integer"},"city":{"description":"The city where the person lives","type":"string"},"name":{"description":"The person's name","type":"string"}},"required":["name","age","city"],"type":"object"},"responseMimeType":"application/json"}} + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "text": "{\n \"age\": 30,\n \"city\": \"Paris\",\n \"name\": \"Alice\"\n}", + "thoughtSignature": "EvQDCvEDAdHtim/cb1dWV6U1RcEIEknDD+tQ7jQ1cgOCFASlsLpobD0ejF9JGoUh6SZgWrjo54SGYwoEHM2DTRHS5UV44kUrVhIqPkXIsxhNZJyjplQsuL0+JJ3jriwV7dMSx3N6sFeTMzmFWrjzIXWsIG/S6yscqlMp9awgUisApHJXiQmTHsfCh4kxHdLsCuCl+WFrxYRTmGpsgNtgYhNFFw5xUAFtzSocFvlIepFglzOI4ccIrXEn32g2n0bgvq6CX4p2aBDRAcdRztxlblo0cUSRjDPQCsj4rRMpY2yeSI+PIXwsD+w8Vfy4sjGBafSh4bRnoQhc0U6SFRnEKaVxiZhoeWKhSc6usmjcuQDSR8mMFvVul8lsY3vPgn/KC/QCrlIwVYBsLMbhhsG9/LAeijGFzuYRX75D4pVvHxxWyEgdbvHrhT1wVmNJz01F+ZzwrtdWZjMiojhQAMWL8V9ujfQcrBG5JA2oRK/K18fW67seVo2BB3t0Us/jTTULNIqtp7mFz2JaK659n8YOe4IsMXHcQJmFxF793KNGdsQpkyACW9zENV+Idjh7zeABKrpXjmKgJ3wpdhQirzbwNuJG6gphCLDdUUeUUvjSQACjwvtJ0DWdLbJU65WEaBVTLf+hig3mEpwMANItd2caBaU7+fXFBH4=" + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0 + } + ], + "usageMetadata": { + "promptTokenCount": 20, + "candidatesTokenCount": 28, + "totalTokenCount": 183, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 20 + } + ], + "thoughtsTokenCount": 135 + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "s6Idaf6qKo-7vdIP1aSIwAk" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 2.925005834s diff --git a/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object_streaming.yaml b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0c9c62a6be98a9b6e3a6cce1a06b2af0f5ac3ea8 --- /dev/null +++ b/providertests/testdata/TestGoogleObjectGeneration/gemini-3-pro-preview/simple_object_streaming.yaml @@ -0,0 +1,34 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 499 + host: generativelanguage.googleapis.com + body: | + {"contents":[{"parts":[{"text":"Generate information about a person named Alice who is 30 years old and lives in Paris."}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000,"responseJsonSchema":{"properties":{"age":{"description":"The person's age","type":"integer"},"city":{"description":"The city where the person lives","type":"string"},"name":{"description":"The person's name","type":"string"}},"required":["name","age","city"],"type":"object"},"responseMimeType":"application/json"}} + form: + alt: + - sse + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"{\\n\\\"age\\\": 30,\\n\\\"city\\\": \\\"Paris\\\",\\n\\\"name\\\": \\\"Alice\\\"\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 23,\"totalTokenCount\": 426,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 383},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"uKIdaYWJBMmNvdIP66uD6Ag\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\\n}\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 25,\"totalTokenCount\": 428,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 383},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"uKIdaYWJBMmNvdIP66uD6Ag\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"\",\"thoughtSignature\": \"Es0MCsoMAdHtim/2g80u7MPzJwy/NBB/OVelAlwSxB95f65Celfa1/NHwKSg6XCbZHl/bLY0pCOBkUqKWnCRwQ9jZ0a18hccEucQRd7QQVf4YrPw4w/rXtiu4kVwtuuuRCoRl/A+bCTu+e70RKHqemiAfvNf+DepnpF9H9vz3BzZ2PXKSgZaOT6PswiM9xXmC6Qv22HN1uxYBVZaDmZGRLmQCqQbgNSXX1+oTcLYue8zNeyhZLtowrJtqSAWnriTV6zda6ANPwhh0V0ADVUgj1wz1/OAHqE5qdHbX5+ksRAjieI4s/Ea6eDRzURdo17+i1zHtH2ajpe1rsMVu1Ft4ng9eQJQXG+dw00jPoENwoO41cc6cOktVOiVNRszlQsJlt3SjZFzfQMJr9UdYHD3awzA1SSvPyQ9WKEUuJDKK3akyfi30frITn9ZxNcXQ91fEiZ8GWLn1oZCKMss7rdkyJ0pfwobASs4CBaqFsZ/6lzAhH0eR3IzrHD3KxJniSfazd01Br0sfJnEUa/GbDSPybRhboleJMsiw7E9kwdEwdUcGbh0ZFxb/6tMN6s165S6v+I3TI28aBw89HzzHFpQv9WGl2V/R2SxUNvNDQPydB68G9LXjnUNBU18I7VSXACvtuqONA/o3r7oBr5VF/WzqwiWODzOpmpB0zkFloPYCNc633dmThxuMyU0N++tlGwtZkTfzh+8Y1Scba4YrPUvLp0AvxDKnu2Hs71/qc/w2fl9c0Ihz5ilIFEZlxDJNfqX4Zzmij6gxq7DwbbHKPeHdQ2sWv7XTK/HvjDA0FvKFVtGX4w3z4T8MFg7Uqe1lk26MmepSdkcJ8sjsI0yOZfWngYCgYN0L5HqqqCd9JbqCbnQmfRDXxtYEOgMehMD1q8xtiM8J24LcTYZSBEUWxbWrwWSAkmIJcQPJjl9TzfwfBwu5j8OQ7JluZPOw9+1vke01kojvz1mTkPD6T5EumJTi3YdaP563UzKxfy22dlwn5JRx3gNbY7C4/oJkQ9mEz1xo636lnTGhudULavmxUT6v2Q1Hb8A40D5arzQbYI5aufB8kG9oqj7TGFY+lQDuzZN2GA3TW2Qu366VryHMiqDYUjsbeglJbkzNa/d0W7MI9v/x5kO6KgwUa3PufEt7fvUzGNBTL8G8ekh4/ayEjwTkEJx/DGoIb8NtBE4ckM2KOBSY0yEiU6WeH1GQabkb3u6kaXbgIq+B3/t+UuuFHzM6CtBZYjYw/WB4x4Xo1yGALD+IJhO7eG8cYTzmVDPQQb815SrPyoqJ2Dz9FcqxOSymDjcz37NpKJ9Y0phpUNeQR/yaVHa8UPEB0kzwLTpqtj1zDPQKEHdnhxv1iVpGF09gqx4myqVMU3W4jnpDGtaqKSinxmY3AeOsb9vKwvWHXO52MITYOTAQ6fO8IKYimiwLQGVrEGRoEnSHYGLLK0YIGGXLfaatcOMbj8yQcmkbfIip6iRu/qtZnBXD54X8A6Uus7B2CgG9yNGg0k9DLll3yRV2eofFmARP4K8cDYAttaRsuifmcyP5Wf3gduuuIWZZFeINn9ee2+AnPXPU40ukWHyAi5j4Vud2r410QW5856Gtq31wwIEVZ1h8gspZrmiofR3j2Ly1Rj/F/gFt9npHZqRFwMtRf2/mdIEa3RUZnQiv2zx1EdM5magJxMrwJiQ+P+l/ggFAzBTTGLRUg5bQR9wU14/y1Xj6zC5YVqKL2GXNRyzOZzP/kWXNiXVAPJRKOGCULKbVWEuCZeCrCGU8a7PWy2iqC6nr8eCZGKKc1qeHIhCbQmYt0qBGveQIerIs9QempHjLcMFg0ERQxNi1v++uCGjLQgzGgPV5IOEsvuwhVP9SPtx/Dp25jwgsymz67c0goB1RcBkdtWdLcYj9kZNoUWw7R6Jo+7RXLyWbZQ6IrO4Ux5BrmiGfmzeUIBAu6JEisxmaSSy0O36PfiK4VmTmr0kRBwTck8/LqLa8ap+D+GApMkYylH/7MhNkOH1816sZYqmu/i8HnqflJjDwbSLxKQowA6cB1y0GbKTsLa9MWav05l9NjSpUajsPPlKaFra6CQyIjLAoC6CtGKZIaaesofEq3xIVG0C7NHVt4iIEuoqizhJi2JZwZDGp5PXNxwSRrR4M6nSTw8TeiSnvFo=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 20,\"candidatesTokenCount\": 25,\"totalTokenCount\": 428,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 20}],\"thoughtsTokenCount\": 383},\"modelVersion\": \"gemini-3-pro-preview\",\"responseId\": \"uKIdaYWJBMmNvdIP66uD6Ag\"}\r\n\r\n" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 4.351121s 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 3067441c29c5372530ff9c097be5c5b88e8a2cc7..bf96a0f089dea40bc8a95a1b9ce41e1b0c0b61fd 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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": \"**Obtain Weather Information**\\n\\nI've determined that the user is requesting weather data for Florence, Italy. To fulfill this, I'm setting up a call to the 'weather' tool. My approach is to pass \\\"Florence, Italy\\\" directly as the tool's `location` argument. The execution of this should provide the necessary forecast.\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 54,\"totalTokenCount\": 104,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 50},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"VAgJac7_KP-Cz7IPkNbj8AM\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiQB0e2Kb8PlQ1xttw+62OLkdtWjI6TWRZh8b9qS/VT05kd8Ha0KZwHR7YpvQf3lmZCOuET4YbFxLuwXLuMu3HZ2jzf18ygViyHTycSgWJpj6wLv7fsIPOgDAClIM50cArZ8SL14unjA0SZr0bC83cRVkr366deJ57t7woE7NbmDRvvC2Ww7Zp4dwBQQM/8KrwEB0e2KbxifnDjOKb7MjLsifVm/yX34wfvONANctV/pHkix8Inu0T4R91HZuuddKV2hA7wsdJc/Z5Lq77aDDMcVCTiXo4+6ua+J7zdMa/CrarF9xmYX60MaQU5/BkoCsGY5YEuyiL3GsnRqI/YZYUZjVihthA+pm2scVOAKSL9JvDvccxrLMhgbAVe3J/vXtzqrwKKnOMSDmY6N5l2hg0yPPTBR+GW2/kK8KvOo5xzK\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 14,\"totalTokenCount\": 118,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 50},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"VAgJac7_KP-Cz7IPkNbj8AM\"}\r\n\r\n" + 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" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.941407333s + duration: 1.213771542s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1214 + content_length: 1286 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":"CiQB0e2Kb8PlQ1xttw+62OLkdtWjI6TWRZh8b9qS/VT05kd8Ha0KZwHR7YpvQf3lmZCOuET4YbFxLuwXLuMu3HZ2jzf18ygViyHTycSgWJpj6wLv7fsIPOgDAClIM50cArZ8SL14unjA0SZr0bC83cRVkr366deJ57t7woE7NbmDRvvC2Ww7Zp4dwBQQM/8KrwEB0e2KbxifnDjOKb7MjLsifVm/yX34wfvONANctV/pHkix8Inu0T4R91HZuuddKV2hA7wsdJc/Z5Lq77aDDMcVCTiXo4+6ua+J7zdMa/CrarF9xmYX60MaQU5/BkoCsGY5YEuyiL3GsnRqI/YZYUZjVihthA+pm2scVOAKSL9JvDvccxrLMhgbAVe3J/vXtzqrwKKnOMSDmY6N5l2hg0yPPTBR+GW2/kK8KvOo5xzK"}],"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":"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"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": 132,\"candidatesTokenCount\": 4,\"totalTokenCount\": 136,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 132}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"VggJad_YM__Uz7IPzNqI8AY\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 C.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 132,\"candidatesTokenCount\": 12,\"totalTokenCount\": 144,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 132}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"VggJad_YM__Uz7IPzNqI8AY\"}\r\n\r\n" + 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" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 830.511167ms + duration: 1.488522583s diff --git a/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking.yaml b/providertests/testdata/TestGoogleThinking/gemini-2.5-flash/thinking.yaml index f48d1dc16c9a99ab3f1aef9b34c09cb7086aea7c..0eb5727e17f7cde8e29fcce8ae6ac344d2ed693d 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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "**Processing a Weather Inquiry**\n\nOkay, so someone's asking for the weather. Specifically, they want to know the conditions in \"Florence, Italy\". Right, I get it. The `weather` tool is the perfect resource for this. I need to make sure I supply it with the correct `location` parameter. Let me see, that's straightforward enough: \"Florence, Italy\" needs to be passed directly to the `weather` tool as the `location`. That should be all it takes to get them the weather information they're looking for. Easy peasy.\n", + "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", "thought": true }, { @@ -40,7 +40,7 @@ interactions: "location": "Florence, Italy" } }, - "thoughtSignature": "CvYBAdHtim+r4pwvSzMD/Aa47oeAg6vLs//D5qB7buLxjadu+G2D8/R0OG5BbKoIl9STM65l/6ETZA5NxOxaKyEQmKQK9Wg319kKYLoWyA0vVr2lOa+yEDCNHam2FzEUpS/+5xL/AcTIuk7LGTdGdzf306tz8cOGvt5grdEIzl3G5xAaT/YIp/0mboeKkLS5gMRFibvX+q7/QuI49iNfzO6UPD3O4il9yeue8JsN1zjuVP7O0qbThAiMKQaFBJ/7XzRTwPY6mlKCaYS/SWB3vo3Vd/5eeUOZj1WQymKNt9WQHeGjOChZEBRdoyUTsIJNULD3rwuDgim+" + "thoughtSignature": "CvYBAdHtim9qsdgUovUUbgAa9oML5LNXaG6UCnPcGzw1zOO0g3lKC3BMnvd5uNr1Dbu4iv/D1RFKhdpNvKq36C4OgfmARWRVkb6SCFEB2HliZgcq0eH24m1h1Wc3TgGsGNTm4Ppy61sth++CxfYNEZLnw+7xD/VhRMJn5a6/faKS4+MGzsH63NHx0DYdfpFpMytkoCa551Aunb8VOPy9KG2auvUT5KfWqf32mrjbeRhe3ngFDM7gBzYq/1AiVyQVluHSlvmHQ738klIpV7rZelCWzr+QgcPrc+T2MjHoXFtQQ5W24CHqHdW+ViYmcgpQT7QIM/1qCohh" } ], "role": "model" @@ -63,28 +63,28 @@ interactions: "thoughtsTokenCount": 51 }, "modelVersion": "gemini-2.5-flash", - "responseId": "UwgJaZTvAoidz7IPpOCG6QY" + "responseId": "o6Idaab7Kdj9xN8PsaeMoAU" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.398826334s + duration: 1.776984417s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 764 + content_length: 1118 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"}}],"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":"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"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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": "UwgJaYDyOaThz7IP97CwgAc" + "responseId": "pKIdafytEKa_vdIPwLzvqQk" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 952.694ms + duration: 586.682167ms 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 8132c3c17a78e9885c89830aaf48d068df7ddb8c..e5122d3c1316d393f5bccd9416190576ba23d824 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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": \"**Determining Weather Location**\\n\\nI've homed in on the user's request. It's a clear weather query targeting \\\"Florence, Italy.\\\" This directly triggers the `weather.get_weather` function. The key is the `location` parameter, which is easily set to \\\"Florence, Italy\\\".\\n\\n\\n\",\"thought\": true}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 54,\"totalTokenCount\": 121,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 67},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"hAkJaeFW9IfPsg_C9c2ACw\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather\",\"args\": {\"location\": \"Florence, Italy\"}},\"thoughtSignature\": \"CiIB0e2KbyCfx1Z1RKkF6sHVGHTNjP3RfJVvbB2c3VXwURzoCmcB0e2Kby2As26sswW6FC3Viyj7C4KCMGBg0CzeZ1exOmHoBI+beWVEQkkJjaWIt+tahvCbytKtiCVbpMiJ1ahWtYv3H7UEahkL4PAJB51RVdijk5/p5wQzrivdSZNfJlPNVha/wuXpCocBAdHtim883J+t+t3gG4ZOoZFXa1/m37O2QO0ZCVjKsZjwrjFopVJ7pDBX5NlY0c8dBtV7d03eyYr1B4mrQX7Mzn69/qZdzXwl0TyD50iYlY/7gnkz5UvVpViDaP6/iolbtHL26EjN57L81KT97tdda/SwEqwVJuN38QQOHXC2Ku6u2TFpZUd2CnAB0e2Kb5HwqXMp8QpDRCrUG60zY5e8lY1jQWgHZjfXe0k6uZ+VZIMm3oZFG/PyhwRYm4vPNqWwurROkBxPwqrLGmoEb6fYn6Cs+5zKhHoiRdis4hyeqDc9pCUmruG7ts3D5CYlgJI7Z1/Wa+zI8act\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 54,\"candidatesTokenCount\": 14,\"totalTokenCount\": 135,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 54}],\"thoughtsTokenCount\": 67},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"hAkJaeFW9IfPsg_C9c2ACw\"}\r\n\r\n" + 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" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 5.630713958s + duration: 3.008202292s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1310 + content_length: 1302 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":"CiIB0e2KbyCfx1Z1RKkF6sHVGHTNjP3RfJVvbB2c3VXwURzoCmcB0e2Kby2As26sswW6FC3Viyj7C4KCMGBg0CzeZ1exOmHoBI+beWVEQkkJjaWIt+tahvCbytKtiCVbpMiJ1ahWtYv3H7UEahkL4PAJB51RVdijk5/p5wQzrivdSZNfJlPNVha/wuXpCocBAdHtim883J+t+t3gG4ZOoZFXa1/m37O2QO0ZCVjKsZjwrjFopVJ7pDBX5NlY0c8dBtV7d03eyYr1B4mrQX7Mzn69/qZdzXwl0TyD50iYlY/7gnkz5UvVpViDaP6/iolbtHL26EjN57L81KT97tdda/SwEqwVJuN38QQOHXC2Ku6u2TFpZUd2CnAB0e2Kb5HwqXMp8QpDRCrUG60zY5e8lY1jQWgHZjfXe0k6uZ+VZIMm3oZFG/PyhwRYm4vPNqWwurROkBxPwqrLGmoEb6fYn6Cs+5zKhHoiRdis4hyeqDc9pCUmruG7ts3D5CYlgJI7Z1/Wa+zI8act"}],"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":"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"}}]}]} form: alt: - sse @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 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\": 149,\"candidatesTokenCount\": 4,\"totalTokenCount\": 153,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 149}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"hwkJaZnjD6GsmtkPo_HziAg\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \", Italy is 40 degrees Celsius.\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 149,\"candidatesTokenCount\": 13,\"totalTokenCount\": 162,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 149}]},\"modelVersion\": \"gemini-2.5-pro\",\"responseId\": \"hwkJaZnjD6GsmtkPo_HziAg\"}\r\n\r\n" + 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" headers: Content-Type: - text/event-stream status: 200 OK code: 200 - duration: 1.976438916s + duration: 1.696688208s diff --git a/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking.yaml b/providertests/testdata/TestGoogleThinking/gemini-2.5-pro/thinking.yaml index 93242cca0cdb27ff16348419fffec589ad227668..1237887cf06ee5b0dc714e2145c0d6b888936f95 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.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -30,7 +30,7 @@ interactions: "content": { "parts": [ { - "text": "**Thinking about Weather in Florence**\n\nOkay, so I'm trying to figure out the weather in Florence, Italy. That immediately makes me think of my `weather.get_weather` function. It's the perfect tool for this task. I know it's designed to give me the current conditions, and that's precisely what I'm after. Now, the `get_weather` function, like any good API call, needs specific parameters to work. In this case, I need to provide it with a `location`. Luckily, the user has given me exactly what I need: \"Florence, Italy\". That's perfect. Time to feed that into the function and get some weather data!\n", + "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", "thought": true }, { @@ -40,7 +40,7 @@ interactions: "location": "Florence, Italy" } }, - "thoughtSignature": "CpUCAdHtim9UGVogupwPjEF0fV0+J6hlvZgmWKm2F8vODxdWDQn0sHeqH52T3A7eVFc3qq1mgbgKexwBwUY+LaJS6qmkEp/BQp+YhKn+KkADS5m9uSkVYtQHrSpr6w1PXOeZHKL9S4fda1Tw3wp486PgTNd0UI4P0XI0aJOWzT6QY4Zq54e7xt2Ju7+hocGRFBPS9nZbMajRNZW5rgelw9MWeLAed0Kl+7gxL931NKSOf7pN2VJR8QYo8V5bSy7NKSE12qFRb0HeHJW62RSO9CVDzjljtN8mFMgEdmAJOYZ902x19NzAZRTLs+/shIW1llcXc2kEllhblFKzRoKpFRI65l4iLIjS6HhG5zyqthmp9c6girWfRQ==" + "thoughtSignature": "CpwCAdHtim+0FmI+WFq9+osYttd0V3wq5L6xpmfD+s3Xy+iz1L6F5MmUgDo3Vop462ydmq46DgqFSLYj33RAcxmXMnfJMnqdDbLkR00eT6FtPNKk1HxBIDg+d8nxH5LBRnQ4+/Py4nOa4oMiTfNaOuMpZZnIyJBRLFSOw0ZQftvmXoKCB/hZEW6dYve3wxGH+o4BZ/sdxO/3IdPhk2eRlcieDEVN/F4Fg1xAmdc/60inB/SsuSIMRRKHW/48nlCOwlJbbTRI9FIhtqLkDwjXMMWxwovwhstRb4+frvLsOIsBNQk+q5MByNI+waAOxhSVVvHChLh9vQTM4xZ0g14GGZ6SbLz+ujRWdPYjN1ON25uMX00ZTwM2S5K8IZUeJsM=" } ], "role": "model" @@ -53,38 +53,38 @@ interactions: "usageMetadata": { "promptTokenCount": 54, "candidatesTokenCount": 15, - "totalTokenCount": 133, + "totalTokenCount": 135, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 54 } ], - "thoughtsTokenCount": 64 + "thoughtsTokenCount": 66 }, "modelVersion": "gemini-2.5-pro", - "responseId": "WggJafeCDKugz7IPnKO9kQk" + "responseId": "qqIdaZ73A_ClvdIPvJaP0Ak" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 3.181730208s + duration: 3.080074125s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 764 + 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"}}],"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":"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"}}]}]} headers: Content-Type: - application/json User-Agent: - - google-genai-sdk/1.33.0 gl-go/go1.25.0 + - google-genai-sdk/1.34.0 gl-go/go1.25.4 url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent method: POST response: @@ -100,7 +100,7 @@ interactions: "content": { "parts": [ { - "text": "The weather in Florence, Italy is 40 C. \n" + "text": "It's 40 C in Florence, Italy. \n" } ], "role": "model" @@ -121,11 +121,11 @@ interactions: ] }, "modelVersion": "gemini-2.5-pro", - "responseId": "XAgJafLaKoiFz7IPguH2iA4" + "responseId": "rKIdaY5egY690g_byfO5CQ" } headers: Content-Type: - application/json; charset=UTF-8 status: 200 OK code: 200 - duration: 2.508655625s + duration: 1.95741725s diff --git a/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6e9c8bd55b128e2d48d64dd33dbb5491b51a97cf --- /dev/null +++ b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking-streaming.yaml @@ -0,0 +1,65 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 550 + 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"}}]}]} + form: + alt: + - sse + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + 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" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 2.532721041s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1478 + 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"}}]}]} + form: + alt: + - sse + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?alt=sse + method: POST + response: + proto: HTTP/2.0 + 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" + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 1.537615041s diff --git a/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8d6a343f9fec02a4226ef3e087fe2d02f130144f --- /dev/null +++ b/providertests/testdata/TestGoogleThinking/gemini-3-pro-preview/thinking.yaml @@ -0,0 +1,131 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 550 + 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"}}]}]} + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "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", + "thought": true + }, + { + "functionCall": { + "name": "weather", + "args": { + "location": "Florence, Italy" + } + }, + "thoughtSignature": "EtMDCtADAdHtim/Qznjl3jYdbqtczyFkf1sarL7CYPmwkwMTU8qifm7AQe1i21NWqWvbSGT+KG/NkCBhcC0Zc8MusHqgFm2Iw+2TP0Ckp8nL5k+1G7jffxPRKsXcyq/6jvRtGvcxb199vZTNapt2/vYas7tEOZahNr/Xiuic7yVEcEEQD8Vdsp9qgRy8qu4RO1nc8Q5cnbd8fOEKfjusde2ehpTA47PUNhhIWlLBEGeMOowAoaEf9/W7cMxlg21omQYaYiIVgvI1qi2U/4nSOKDBlTA2N0LDuygPTtRsz2ZMwJGC8CIrrCW0apY1X2QcgO+s/9tNurJp/D9tiIFnwRXT8q7V90nAng9dSqHrChr2jvr4n3j5wgbvHnqLJouCKR8ME+leQZUHefdJyHeXNSjv9Rzs7cqiaUgWR7Rn11BQld3Q/myVqq7/r0LI/IchztYQVKDvE0XXbc0o8x4cfQTmtdlSwcAQxE5OG6sLNoRPAJmPfkwlppeHwNGG7ntkCKX/nG/o40w2OyFwk6WnkyNhnqTiA5knDyP51fnOiwKhFYxtDa7f2WdUPsILiJjqT7hDjtYTCnYvuWgTvqkaRtfLWES9QIVVZP63zK6PDFQLtLp8kd0=" + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0, + "finishMessage": "Model generated function call(s)." + } + ], + "usageMetadata": { + "promptTokenCount": 65, + "candidatesTokenCount": 16, + "totalTokenCount": 189, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 65 + } + ], + "thoughtsTokenCount": 108 + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "mqIdabO3C5S3vdIPuPm34Ak" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 3.163927334s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1414 + 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"}}]}]} + headers: + Content-Type: + - application/json + User-Agent: + - google-genai-sdk/1.34.0 gl-go/go1.25.4 + url: https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "candidates": [ + { + "content": { + "parts": [ + { + "text": "It's currently 40°C (104°F) in Florence, Italy. That is quite hot!" + } + ], + "role": "model" + }, + "finishReason": "STOP", + "index": 0 + } + ], + "usageMetadata": { + "promptTokenCount": 201, + "candidatesTokenCount": 26, + "totalTokenCount": 227, + "promptTokensDetails": [ + { + "modality": "TEXT", + "tokenCount": 201 + } + ] + }, + "modelVersion": "gemini-3-pro-preview", + "responseId": "naIdabjfC4HhvdIPo9CWoAk" + } + headers: + Content-Type: + - application/json; charset=UTF-8 + status: 200 OK + code: 200 + duration: 3.0175995s diff --git a/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool.yaml b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dd06f30e1cb5920c14bbb78fec467605f71eae3b --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 857 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n{\"id\":\"gen-1763546723-krpNoMGltmXXMt7QEkBX\",\"provider\":\"Google\",\"model\":\"google/gemini-3-pro-preview\",\"object\":\"chat.completion\",\"created\":1763546723,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":\"**Contemplating Dual Operations**\\n\\nI'm now zeroing in on the core requirement: simultaneously executing addition and multiplication on the given numbers, 2 and 3. The key constraint is to invoke both functions in a single go. I'm focusing on the mechanics of achieving this concurrent tool usage.\\n\\n\\n**Refining Concurrent Tool Calls**\\n\\nCurrently, I'm working to consolidate the add and multiply functions into a single step. The task's essential characteristic is the simultaneous use of both tools on the provided inputs, which are 2 and 3. My next iteration will involve generating the necessary tool calls to achieve this concurrent operation.\\n\\n\\n\",\"tool_calls\":[{\"index\":0,\"id\":\"tool_add_Rr5wzukrmPeay1Ei7Ab0\",\"type\":\"function\",\"function\":{\"name\":\"add\",\"arguments\":\"{\\\"a\\\":2,\\\"b\\\":3}\"}},{\"index\":1,\"id\":\"tool_multiply_XXecV033QPQiOE0Pid5S\",\"type\":\"function\",\"function\":{\"name\":\"multiply\",\"arguments\":\"{\\\"a\\\":2,\\\"b\\\":3}\"}}],\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"**Contemplating Dual Operations**\\n\\nI'm now zeroing in on the core requirement: simultaneously executing addition and multiplication on the given numbers, 2 and 3. The key constraint is to invoke both functions in a single go. I'm focusing on the mechanics of achieving this concurrent tool usage.\\n\\n\\n**Refining Concurrent Tool Calls**\\n\\nCurrently, I'm working to consolidate the add and multiply functions into a single step. The task's essential characteristic is the simultaneous use of both tools on the provided inputs, which are 2 and 3. My next iteration will involve generating the necessary tool calls to achieve this concurrent operation.\\n\\n\\n\",\"format\":\"google-gemini-v1\",\"index\":0},{\"type\":\"reasoning.encrypted\",\"data\":\"CiQB4/H/XgkUpJU4QU+IXqZeUmdE5p7/0hlWhrR4hblxPtdT+FoKdgHj8f9eh5vsZhTaF6ubhhFu/tYEEcc2uRhpehbecLT49gx/k4uXNEMWcVIdnlyUmOWB5mUoL0TCRHLXcs/HdbUgt41TfJiLLFzsIJOu6WLLRD61pEKXNg8lbOqbNiy4QZxvpkO/VQlLtZ8I8AG6t7POSFnSbkcKgQEB4/H/Xhyqc6U/uyqEYFlwSKlzmYP4plvxiZjznGbdk2NT0Y5MDaX5uoswUPa5h/UUJIZmwjetqYrdlaIV/fKL0wYLkhwLz51xSwe69yKSxN1AitfEFr9damnf2jh+YFMUwvyqPqFsf8evKGTk+6+WkRnY0zgqSN0yYtisjd1ZbrEKlwEB4/H/XhaCkzS66UWyWnxYNwislAPQrh1thGB58ALOZYxbWJNrKoXEpt7auCwEDEnZjRV7hAFGX1F2F5oRbAmgeBy1HRmJmE7MmV4KzQlHQlwYGVPNxohvIFu50Jws53+NYzAhMD+UUdXyvwWstIptgJVeTcbuXnALvn4vKn/7AZJeK0NlqY7q7UBxw4dfuz3nDfGdBjhXCm0B4/H/XifuvCQ5OYGkaUmlT1nvCLsMJXtVldGe2kiFTfZ8793EUQ2a4WT9sFP3t9KYr8rgzndHYCLFKJF/lDCM0wCj5YJbWbEGsJGVw1LAAem8tni/PV6UNHYhbqjsINkibaXkIo4L2rpb3xWICiwB4/H/XhQxGpYF/1hitRT9RPbq3fdS67vM/tDkwalkD/0eZiDq089xuJx/FA==\",\"id\":\"tool_add_Rr5wzukrmPeay1Ei7Ab0\",\"format\":\"google-gemini-v1\",\"index\":0}]}}],\"usage\":{\"prompt_tokens\":60,\"completion_tokens\":128,\"total_tokens\":188,\"cost\":0.001656,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00012,\"upstream_inference_completions_cost\":0.001536},\"completion_tokens_details\":{\"reasoning_tokens\":110,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.777893792s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 2966 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_add_Rr5wzukrmPeay1Ei7Ab0","function":{"arguments":"{\"a\":2,\"b\":3}","name":"add"},"type":"function"},{"id":"tool_multiply_XXecV033QPQiOE0Pid5S","function":{"arguments":"{\"a\":2,\"b\":3}","name":"multiply"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"google-gemini-v1","index":0,"text":"**Contemplating Dual Operations**\n\nI''m now zeroing in on the core requirement: simultaneously executing addition and multiplication on the given numbers, 2 and 3. The key constraint is to invoke both functions in a single go. I''m focusing on the mechanics of achieving this concurrent tool usage.\n\n\n**Refining Concurrent Tool Calls**\n\nCurrently, I''m working to consolidate the add and multiply functions into a single step. The task''s essential characteristic is the simultaneous use of both tools on the provided inputs, which are 2 and 3. My next iteration will involve generating the necessary tool calls to achieve this concurrent operation.\n\n\n","type":"reasoning.text"},{"data":"CiQB4/H/XgkUpJU4QU+IXqZeUmdE5p7/0hlWhrR4hblxPtdT+FoKdgHj8f9eh5vsZhTaF6ubhhFu/tYEEcc2uRhpehbecLT49gx/k4uXNEMWcVIdnlyUmOWB5mUoL0TCRHLXcs/HdbUgt41TfJiLLFzsIJOu6WLLRD61pEKXNg8lbOqbNiy4QZxvpkO/VQlLtZ8I8AG6t7POSFnSbkcKgQEB4/H/Xhyqc6U/uyqEYFlwSKlzmYP4plvxiZjznGbdk2NT0Y5MDaX5uoswUPa5h/UUJIZmwjetqYrdlaIV/fKL0wYLkhwLz51xSwe69yKSxN1AitfEFr9damnf2jh+YFMUwvyqPqFsf8evKGTk+6+WkRnY0zgqSN0yYtisjd1ZbrEKlwEB4/H/XhaCkzS66UWyWnxYNwislAPQrh1thGB58ALOZYxbWJNrKoXEpt7auCwEDEnZjRV7hAFGX1F2F5oRbAmgeBy1HRmJmE7MmV4KzQlHQlwYGVPNxohvIFu50Jws53+NYzAhMD+UUdXyvwWstIptgJVeTcbuXnALvn4vKn/7AZJeK0NlqY7q7UBxw4dfuz3nDfGdBjhXCm0B4/H/XifuvCQ5OYGkaUmlT1nvCLsMJXtVldGe2kiFTfZ8793EUQ2a4WT9sFP3t9KYr8rgzndHYCLFKJF/lDCM0wCj5YJbWbEGsJGVw1LAAem8tni/PV6UNHYhbqjsINkibaXkIo4L2rpb3xWICiwB4/H/XhQxGpYF/1hitRT9RPbq3fdS67vM/tDkwalkD/0eZiDq089xuJx/FA==","format":"google-gemini-v1","id":"tool_add_Rr5wzukrmPeay1Ei7Ab0","index":0,"type":"reasoning.encrypted"}]},{"content":"5","tool_call_id":"tool_add_Rr5wzukrmPeay1Ei7Ab0","role":"tool"},{"content":"6","tool_call_id":"tool_multiply_XXecV033QPQiOE0Pid5S","role":"tool"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n\n \n\n \n{\"id\":\"gen-1763546727-n3yus1LOuR5HXnN0YHRi\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-3-pro-preview\",\"object\":\"chat.completion\",\"created\":1763546727,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The sum of 2 and 3 is 5, and the product of 2 and 3 is 6.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":246,\"completion_tokens\":25,\"total_tokens\":271,\"cost\":0.000792,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000492,\"upstream_inference_completions_cost\":0.0003},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.828258792s diff --git a/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool_streaming.yaml b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..83bd9cb9ff0e4354c2bd1ea1eafa11dc37b8d7c1 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/multi_tool_streaming.yaml @@ -0,0 +1,81 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 894 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1763546729-jK1aeMuI8GK43IJd8TkJ","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546729,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":"**Calculating Simultaneously**\n\nI'm structuring the code to run both operations, addition and multiplication, concurrently. I'm focusing on ensuring the `add` and `multiply` functions are called in parallel, as instructed. My next step will be to verify the parallel execution works as intended and then check the output.\n\n\n","reasoning_details":[{"type":"reasoning.text","text":"**Calculating Simultaneously**\n\nI'm structuring the code to run both operations, addition and multiplication, concurrently. I'm focusing on ensuring the `add` and `multiply` functions are called in parallel, as instructed. My next step will be to verify the parallel execution works as intended and then check the output.\n\n\n","format":"google-gemini-v1","index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546729-jK1aeMuI8GK43IJd8TkJ","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546729,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"reasoning":null,"reasoning_details":[{"id":"tool_add_UUaBEsZzO32E0mTPWBH0","type":"reasoning.encrypted","data":"CiQB4/H/XnAwaObJs/UHDkvpR2+9+jMNYdJYOEGoRvWFcj3rqWsKewHj8f9ec2BXB5/CHJY2tbAF2joRDykTYPX85xh1S7LSKBw/SpSri3Y8qUkQjdDpogRjUYFe4PWCuZXttjwMrQ7LbYZgLsbSWNnCo7ObETXAsb2PcGsPq2nR4sevZXoEA9ZWKZbFaxZ3r8ZOK9wV2MQm+WXbkaGZSMf2pAp4AePx/17Ii4UcjG/22OZT8kNkg2RI8OBuSDp9BHSmPswVuxRjJRWMi/HU9WGRnJi0vYixjChledG6apY+SzEwBqxDz+mHFY3MYGQmn4SUB379vKP8YdyiJdhgqjcB4Q6PtHJic06IMk5FCIueAvUP64Ij37RTTZufCooBAePx/17l/jZE4GbgvXhPqM3E3qtLqJ+WJ+cfTrmuXWyKKQVT4opjvNonxhs4Kwm0xudfVBIM6fFoPCclQx7+E4WD4+1eQqMHnU9mQWBMhfCRS4hliO9zZJrO3txN4uEF5JbaBXwHiX1yu4mvZ5OIkQWOM2xHqjY/TMq5qD+PSNQL0W26r9y8/Nhr","format":"google-gemini-v1","index":0}],"tool_calls":[{"index":0,"id":"tool_add_UUaBEsZzO32E0mTPWBH0","type":"function","function":{"name":"add","arguments":"{\"a\":2,\"b\":3}"}}]},"finish_reason":"tool_calls","native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546729-jK1aeMuI8GK43IJd8TkJ","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546729,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"reasoning":null,"reasoning_details":[],"tool_calls":[{"index":1,"id":"tool_multiply_qxw1ym6Mwm8U9MPesjJJ","type":"function","function":{"name":"multiply","arguments":"{\"a\":2,\"b\":3}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1763546729-jK1aeMuI8GK43IJd8TkJ","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546729,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":57,"completion_tokens":83,"total_tokens":140,"cost":0.00111,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000114,"upstream_inference_completions_cost":0.000996},"completion_tokens_details":{"reasoning_tokens":65,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 4.1319125s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 2438 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_add_UUaBEsZzO32E0mTPWBH0","function":{"arguments":"{\"a\":2,\"b\":3}","name":"add"},"type":"function"},{"id":"tool_multiply_qxw1ym6Mwm8U9MPesjJJ","function":{"arguments":"{\"a\":2,\"b\":3}","name":"multiply"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"google-gemini-v1","index":0,"text":"**Calculating Simultaneously**\n\nI''m structuring the code to run both operations, addition and multiplication, concurrently. I''m focusing on ensuring the `add` and `multiply` functions are called in parallel, as instructed. My next step will be to verify the parallel execution works as intended and then check the output.\n\n\n","type":"reasoning.text"},{"data":"CiQB4/H/XnAwaObJs/UHDkvpR2+9+jMNYdJYOEGoRvWFcj3rqWsKewHj8f9ec2BXB5/CHJY2tbAF2joRDykTYPX85xh1S7LSKBw/SpSri3Y8qUkQjdDpogRjUYFe4PWCuZXttjwMrQ7LbYZgLsbSWNnCo7ObETXAsb2PcGsPq2nR4sevZXoEA9ZWKZbFaxZ3r8ZOK9wV2MQm+WXbkaGZSMf2pAp4AePx/17Ii4UcjG/22OZT8kNkg2RI8OBuSDp9BHSmPswVuxRjJRWMi/HU9WGRnJi0vYixjChledG6apY+SzEwBqxDz+mHFY3MYGQmn4SUB379vKP8YdyiJdhgqjcB4Q6PtHJic06IMk5FCIueAvUP64Ij37RTTZufCooBAePx/17l/jZE4GbgvXhPqM3E3qtLqJ+WJ+cfTrmuXWyKKQVT4opjvNonxhs4Kwm0xudfVBIM6fFoPCclQx7+E4WD4+1eQqMHnU9mQWBMhfCRS4hliO9zZJrO3txN4uEF5JbaBXwHiX1yu4mvZ5OIkQWOM2xHqjY/TMq5qD+PSNQL0W26r9y8/Nhr","format":"google-gemini-v1","id":"tool_add_UUaBEsZzO32E0mTPWBH0","index":0,"type":"reasoning.encrypted"}]},{"content":"5","tool_call_id":"tool_add_UUaBEsZzO32E0mTPWBH0","role":"tool"},{"content":"6","tool_call_id":"tool_multiply_qxw1ym6Mwm8U9MPesjJJ","role":"tool"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1763546733-tGHMAwoxWJIfDs5dnbLf","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546733,"choices":[{"index":0,"delta":{"role":"assistant","content":"The","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546733-tGHMAwoxWJIfDs5dnbLf","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546733,"choices":[{"index":0,"delta":{"role":"assistant","content":" result of adding 2 and 3 is 5, and the result of multiplying","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546733-tGHMAwoxWJIfDs5dnbLf","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546733,"choices":[{"index":0,"delta":{"role":"assistant","content":" them is 6.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1763546733-tGHMAwoxWJIfDs5dnbLf","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546733,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":108,"completion_tokens":23,"total_tokens":131,"cost":0.000492,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000216,"upstream_inference_completions_cost":0.000276},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 1.800347541s diff --git a/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple.yaml b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c7a954f6ee3247ecc439c21b9e8dc65c5a362417 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple.yaml @@ -0,0 +1,33 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 202 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n{\"id\":\"gen-1763546701-sBf8rH1mDRj14OloJK1h\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-3-pro-preview\",\"object\":\"chat.completion\",\"created\":1763546701,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The most common way to say \\\"hi\\\" in Portuguese is:\\n\\n**Oi** (pronounced like *oy*)\\n\\nYou can also say **Olá** (pronounced *oh-lah*), which is closer to \\\"hello.\\\"\",\"refusal\":null,\"reasoning\":\"**Pinpointing the Phrase**\\n\\nI've zeroed in on the user's need: a Portuguese \\\"hi.\\\" My analysis quickly identified the target language. Now, I'm working to compile the appropriate phrase for various social settings. \\\"Oi\\\" seems to be the informal winner, but I'm checking for more formal options to make the final answer complete.\\n\\n\\n**Refining the Greetings**\\n\\nI'm now zeroing in on the best ways to present the information. The original query was for \\\"hi\\\" but I realized that Portuguese doesn't always distinguish as directly as English. \\\"Oi\\\" is the clearest equivalent, and I've included \\\"Olá\\\" as an alternative that is also common. I'm focusing on providing context with pronunciation for each word, and have decided to add a brief explanation to give the user even more helpful knowledge.\\n\\n\\n**Delivering the Greetings**\\n\\nI've determined that \\\"Oi\\\" is the most direct Portuguese translation of \\\"hi.\\\" Furthermore, I've incorporated the pronunciation key, noting \\\"Oi\\\" sounds like \\\"oy.\\\" For completeness, I've added \\\"Olá\\\" to provide an alternative for the user, similar to \\\"hello.\\\"\\n\\n\\n\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"**Pinpointing the Phrase**\\n\\nI've zeroed in on the user's need: a Portuguese \\\"hi.\\\" My analysis quickly identified the target language. Now, I'm working to compile the appropriate phrase for various social settings. \\\"Oi\\\" seems to be the informal winner, but I'm checking for more formal options to make the final answer complete.\\n\\n\\n**Refining the Greetings**\\n\\nI'm now zeroing in on the best ways to present the information. The original query was for \\\"hi\\\" but I realized that Portuguese doesn't always distinguish as directly as English. \\\"Oi\\\" is the clearest equivalent, and I've included \\\"Olá\\\" as an alternative that is also common. I'm focusing on providing context with pronunciation for each word, and have decided to add a brief explanation to give the user even more helpful knowledge.\\n\\n\\n**Delivering the Greetings**\\n\\nI've determined that \\\"Oi\\\" is the most direct Portuguese translation of \\\"hi.\\\" Furthermore, I've incorporated the pronunciation key, noting \\\"Oi\\\" sounds like \\\"oy.\\\" For completeness, I've added \\\"Olá\\\" to provide an alternative for the user, similar to \\\"hello.\\\"\\n\\n\\n\",\"format\":\"google-gemini-v1\",\"index\":0},{\"type\":\"reasoning.encrypted\",\"data\":\"EoIOCv8NAdHtim/suOdn1ujhrFG3R8JW2tDAAtgDNqX7cm0DqHCcE8txaRuUWah/MAsJ4rXLjh/w2fxpCu3fJHQDzn1ke7Zw6XkJiLtd0TdkVsylaDopnvZAvCYN91iFa2yUxxCaqc7UQYl0/ITgP8wIC4nrctK8PaHNtKSGfEg/vHibO+JstyKy1sKGMa5YVbyng+jUFezJAMqRIsCMYJ+Ga/HPeWUcUa/fKbUFSrHkGkXxbpNZRj2QaBy6u1MtOWtqwwBr+jdfKeewMoEczbg7XSeUduj60FVks3aVqEGZr18V9tg69CGEcjic0I8onA6AMnTUdzthEZastOZZByKbPM1F8VjeEwrGctcgFMK8NtXnp3npULV9XFCLW6/1wqe6xjl27NG3+YqBI/CS5C4rm5j1qJFVH+JWrJDOh1BlEeVP0NgRyih9lYVsDueCtZaIKU1Rj8meOjN0cc3M52ZGdFMIxEZzseHV/dMpF9pgVVlc5kI80banUxQRwQRWdX419Dlj+JQZ3sBihzdPtaXK5BK6KNUjcHZsKAAeXlrImePWSy4Cp9RX4/q7RRlUmU+n8REG6EC2agtSltotyOBN9RDKLja1ODmg4cE8T6O/FSfTpbpKUMJfuqFG84/EglfEAXueededzlskAkLibN/Kt9xNAUz6pNsUOVhGN/8ORdXUU6GzAxuupw2YA8+sbmx4kDvGS/iSM1M5rpUB7tWvDBLymiYqjbNUb+6GZmIchWD0hbd9P0hwPCcTX2tzGMENPHyJrvGadi4QlKoCnuZlNiqwy2TcFfgdR4y1js14DqEcWOMF5G62GFwAdLdivbvsUWiY1S37GPKbZzzdxMKYKby4qwqluvTLELlOa60/yr05xQ36nyWQB3NhRIFg9drRrsOw+276iVYzbHAfARThi8dDwA+W8TQZ2wkM/HIVkLjh55hRai6cGaFkiui820NhmPkLbpmLsYsV+DPpHU7sX/zJSXbZqvfKhSFv+zScDAo2EvUFpEIXbFdJ1U/sJ4G9BAEkwFdlXXdKxQ6xWO669x5nHjcu7RcC0tzRAuewrO5s6/qA6Q6w7eB6lniAiCp/rTssJRbnI5sNu4yLcx+GudUVBHt8fGoIGJCumzYDPllhq5G1rSpmAQ5FKiN9pVfEnezVxg6NAszWQyP2mN5p9svdWDcd59CxEfnisafxWwj2OIaIzrq5sTluJTnlzEMuaNmIV7O0GjmDHwgOzyM1xzJ4lhsfZ2O+ejwOIHD9QuThKxUWIWJQt2edSdwmbDXofqDzCt1/MT0q7xMaGjvLXIMXmgp9HdFPKmStHueys/JP0dCIc6cIYDXeqcxqQ6py+Zk2R5Mn8t8Kxz47a6ScxDw1YAlYgaMPqhTTnLVmd1Y0/m6EmKcWRiEp6N/wr3pvGLeDQvqY6LkFiWpz4VNjnkQySWYciQoOz/PTtTZqlRMbNzDt0s4aebxqKKApmWXaoCV6ouGz8nPt/zL6pbPrdz8zPyv/tm40YTnzkJhgUO34aOWdkpPeuWVLdz80Ey1s3MImUq2gSJ0BA9RFDfl/jSHmTfaQ75sgKevBJAikomBlDbW7RFAMVKccxLsCaS3jgrA+K8EtX2y4I0aEp9NU/o/hx3zO82SPhpb4MfTSbQElRNPZiTA4jwyRIxRLXs/MFWWS2LbE5WiPkTdzFgyWSwHkN1ykVBYFbSPGCApLZKjMzbSp8x2HgLrziAuObhPgKR2+Pa/rNIbKJfM8ytENpPx8x2UFIwI2ZDRUz9rFJ+maDDRkQ0pmcPZepA74wvdce6+gsRTtJPbjv8hhqE/l1IfcCIn8SdzASXaKuSknV18XnmTBaGAXIk8YN6no7O1xUAy/x5C7xhJBDtUZtpYHek1cW5VAJYUs5BqhDXaGWAxhw277ybNA21Gl5MVmaf4P163qCmvNuapISCFWfDEYTbNTImZkJtg5KExI641U7JBmJ8XJNItVfVxT69fcTCglW665lFqkV6cmfVSudA8XySr0sMm/pfOIXCnBODPXd6QBR7MjY7uJwynM+ZZoly1K640K+70TIU4iTRIvP9hQ2m3R+F1kTdRGOLwqvfhyj2E24JgFcS6ZuVnan8llQp56jxHAchAX9VEl60RQmOzcECzOynKCZaZA3YH+72pYxDhu5WrK/mG4BmL3miYMsofIkXi/ZvYsMC3XjL+hYiL1tttt8E0eCWY73Wd2437jkM/4vMTrrJO99rqr4ERktB/FvChaiSFHHjPFQL3LAXgd0knyCqWC4yh6EPEYQuUfLI2YuGrIrpGjtecHBTvvcU/c2lVMWBvA2M/E4lX8dhKvv+5WcpfE1ZQ33f6mdLGbiWR8Z9jK2o8To/5cVAiD0jVmJ1aR2ZC9WH/oLw9+kbMSiamT\",\"format\":\"google-gemini-v1\",\"index\":0}]}}],\"usage\":{\"prompt_tokens\":11,\"completion_tokens\":460,\"total_tokens\":471,\"cost\":0.005542,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000022,\"upstream_inference_completions_cost\":0.00552},\"completion_tokens_details\":{\"reasoning_tokens\":414,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.918398667s diff --git a/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple_streaming.yaml b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bca71ad4d6b2129040a330111079aee255308b85 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/simple_streaming.yaml @@ -0,0 +1,44 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 256 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1763546708-WlSEiEPr7nn7Uso3yUg7","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546708,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":"**Considering the Greeting**\n\nI've narrowed it down to the essentials: \"Oi\" is the go-to informal greeting in Portuguese, and it's perfect for a casual \"hi.\" No need to overcomplicate things!\n\n\n","reasoning_details":[{"type":"reasoning.text","text":"**Considering the Greeting**\n\nI've narrowed it down to the essentials: \"Oi\" is the go-to informal greeting in Portuguese, and it's perfect for a casual \"hi.\" No need to overcomplicate things!\n\n\n","format":"google-gemini-v1","index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546708-WlSEiEPr7nn7Uso3yUg7","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546708,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":"**Refining the Response**\n\nI've decided to include both options: \"Oi\" for \"Hi\" and \"Olá\" for \"Hello.\" I've considered that context is key, but providing both will give a richer response, especially for learners. I've also verified the pronunciation for clarity.\n\n\n","reasoning_details":[{"type":"reasoning.text","text":"**Refining the Response**\n\nI've decided to include both options: \"Oi\" for \"Hi\" and \"Olá\" for \"Hello.\" I've considered that context is key, but providing both will give a richer response, especially for learners. I've also verified the pronunciation for clarity.\n\n\n","format":"google-gemini-v1","index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546708-WlSEiEPr7nn7Uso3yUg7","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546708,"choices":[{"index":0,"delta":{"role":"assistant","content":"**Oi**\n\nYou can also say **Olá** (which is more like \"Hello\").","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546708-WlSEiEPr7nn7Uso3yUg7","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546708,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":null,"reasoning_details":[{"type":"reasoning.encrypted","data":"ErwJCrkJAdHtim8y6vZPaBmPFxd5WcUQDT37XvDgtHy40D9ssC7Q5sBYDgvpMpDHsKIr9sAd+1fDRUXMgbG7K2vqZu985V9uTI35JWXsj5xAuwToyGe1vRObteKgBxXeORFcBFPL5banYDBJTZ61ggeQGsw67asE5pJMGcxTprujlpCJlvbGoJ9FNJATG2qHMW6XouPgkDLmlwodUjGM2DrV5tBKqJX6DhlA1Ofc/+GdlPtxOeQFsgLBpjFH5E+gvqwpJT5UrC6niF+hcRZGzLADjiJwlNUsYswb60CuVwpXFZ3gf+Zt9d/AzyC8o3xXD9m9haNB1uy+/67YtmB6768175bV/r579EQyQLQVrOANQPP9zQTDqxGM35+zmF17ITgpLzy7wwzGjjEvqsE4qGcfbPV8wGPreIuUa4Ur3unuVxthjrCw53FOpwljSJyep/qH2ibynSYj/dqtsWADwlkJaHaWGJviMTPZnGtuk1HEQkbrZJR1V6+A9eu67DKfCvsmymy0ZAxFQ9doD9gDBsXuGcUQWeG16k3kKzU70CFJEFO3SMtH1g5+yK6kV+zlmdbZRH6Ci32cMBSCUjGKRkyfkHEXQQ1u3Xlxgch3ZVn+0DeER2hCE5JE1PG8dUUs0IuLDvm2ogPCzHyIW3MT/bpamjBrOnlvXmvOVCJxiRHFNX8e/R0ymn/sz1sa8OaI+dJ7MZWUuBWdpQky1Wx9UrqMgMSFeo3PB8BDOp33RHQ4t2Ttx8nnmVt8UvHlizzQm3Xhcm7osn4G+MORhhr2l70sJgTE+Ha1I5e4H2Ul6r084IPcfzfk/QJsg2a8leLudrrq4bi0eNhGhSFvnVgMckXoaAZrE/qIILsJW+TOuvd64/+322HiFg7AWzyrGkfo2Jam1CJRIPBGvjhoLe8NA0vBzD2159i1Bn1rWCgBsk06+usdl59K9Z3Eb/WsZ+TPM5UWNoIBGfvyDNIF6M7iun7dtECLcAMim9f2Gs5sp++MBzWITxrGy2IuIjGinmNCgSbJ0Y6tQi/vgo4LGWOJb0MwAG6jc4/0GdaT7dYz7tiHPyTSB9J2qQAgFbV2E7TVpLs4aVC71Kn+4KXULEt4DPR5XKAb66/y9QZciFGYU0cExkgbGZK5Yabpva/xYln/sEW2mLKVy6xDMrKxPcIBnAHumFL3BBkl1cwCSU2JjgeW47yLvId5oPn/odD98zjOrnE1tn9iUlP5zdmNqVEBE5DRw4GQ+BESrkhlI29cxRvpIR1E9ne2IntlYXYXZ3gltf4lf9CCeSHG3nDi0lmPTX7ucaR4zjLhvF/Stl/KjAEAcQGx+9kPCSYQgRyvXDEJasZB2Jeq0zwRVFuUaU8ZvMtiBE9qSZbAVOt4CgvZlUv88howGleHmoLQGFW9A505/cSoIRRct89KJaC0ZuUj88cEW1BAIKpZyZvARmmzjo2WegHqIMGPlpX71kRr7mecgW5rA2WQMRmfDw8IdSLcM1INhoexL7fc0zxMGuZjZZt/Wp19rACsI6XphlNi+LMh6dfqsAcjalxST7YYHk0kWn6PJ2Qqeexnes/3cuf9GRFJgJUx0OOqFmLFCSJVXwW4F4cIdrclVY6bk0bzp+fg","format":"google-gemini-v1","index":0}]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1763546708-WlSEiEPr7nn7Uso3yUg7","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546708,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":11,"completion_tokens":281,"total_tokens":292,"cost":0.003394,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000022,"upstream_inference_completions_cost":0.003372},"completion_tokens_details":{"reasoning_tokens":262,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 2.670654208s diff --git a/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool.yaml b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..81bfd4c5f4cf63ac621b74d549264dda115d39c0 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 494 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n\n \n\n \n\n \n\n \n\n \n{\"id\":\"gen-1763546712-oowOHbRdTatTsgOviYVp\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-3-pro-preview\",\"object\":\"chat.completion\",\"created\":1763546712,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":\"**Investigating Weather Retrieval**\\n\\nI'm currently focused on the user's request for weather in Florence, Italy. My primary action is to evaluate available tools. The `get_weather` function looks promising, especially since it accepts a `location` parameter. I intend to use this function to provide the user with the information they need. I'm getting ready to use it!\\n\\n\\n**Evaluating Function Application**\\n\\nI've now attempted to apply the `get_weather` function with the specified location: 'Florence, Italy'. I'm expecting this will successfully retrieve the weather data the user is seeking. The next step is to process and present the received data.\\n\\n\\n\",\"tool_calls\":[{\"index\":0,\"id\":\"tool_weather_j0DpU01anCLITtFWepce\",\"type\":\"function\",\"function\":{\"name\":\"weather\",\"arguments\":\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"}}],\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"**Investigating Weather Retrieval**\\n\\nI'm currently focused on the user's request for weather in Florence, Italy. My primary action is to evaluate available tools. The `get_weather` function looks promising, especially since it accepts a `location` parameter. I intend to use this function to provide the user with the information they need. I'm getting ready to use it!\\n\\n\\n**Evaluating Function Application**\\n\\nI've now attempted to apply the `get_weather` function with the specified location: 'Florence, Italy'. I'm expecting this will successfully retrieve the weather data the user is seeking. The next step is to process and present the received data.\\n\\n\\n\",\"format\":\"google-gemini-v1\",\"index\":0},{\"type\":\"reasoning.encrypted\",\"data\":\"EtgDCtUDAdHtim+owmT73Js7vjC7xHBLN2/s4c4jI3o7DgAlJut+e/0MVHbwVhm4Qs1QoUNwVqV2Ny2m7j7qWTwqjuSqma19OdaHD1U2PRkvsPLUV7H8J9XcFMsRZne3U9IEo6RnHXZk0ynhb9EEsdGPwzMD1vu3CNPyPsvbBapGQ5c+G9q0xD0mh7A43k8I4o4uHlHUftH+TGDdEk3veSoUhy3zRESdf1LEJowbsRakH7iaVgfyL44HjKBAkh3elryR1j+FZCDpoI13LofJ5fPUCp3GbzWgitkPHrdYIH0rjsYjJlZF2INPrbDiUd/qpTHY2xi3HwhM0UiYG/QB8vxkQ1oEC2LgRMsMB7dQaG9On3Ww+4n54vEoLdPoNaLi+ZKJlHEf4ukiEufyDPDG063qrXqrq1+rneO0W2Yk4uCH9cYzjTJYk5YurWLEX9vZaHucY0hIfzrhlh32d5JDGvwa6gue5bjase1MSPngiyEAQmTOI8Aw30jozWBlI36VyyKjLoo24tC181vOvLjCmwZX7DDFaxIGVlQzWNAnJm1StcpKrhFuqV/FocTe6hlYuTg9F5UqyVXGmfTTquXHE8jqhOybQ4+G7zKjHaEgXDc23ou19YenEtBx0g==\",\"id\":\"tool_weather_j0DpU01anCLITtFWepce\",\"format\":\"google-gemini-v1\",\"index\":0}]}}],\"usage\":{\"prompt_tokens\":65,\"completion_tokens\":100,\"total_tokens\":165,\"cost\":0.00133,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00013,\"upstream_inference_completions_cost\":0.0012},\"completion_tokens_details\":{\"reasoning_tokens\":84,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.57858475s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 2274 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_weather_j0DpU01anCLITtFWepce","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"google-gemini-v1","index":0,"text":"**Investigating Weather Retrieval**\n\nI''m currently focused on the user''s request for weather in Florence, Italy. My primary action is to evaluate available tools. The `get_weather` function looks promising, especially since it accepts a `location` parameter. I intend to use this function to provide the user with the information they need. I''m getting ready to use it!\n\n\n**Evaluating Function Application**\n\nI''ve now attempted to apply the `get_weather` function with the specified location: ''Florence, Italy''. I''m expecting this will successfully retrieve the weather data the user is seeking. The next step is to process and present the received data.\n\n\n","type":"reasoning.text"},{"data":"EtgDCtUDAdHtim+owmT73Js7vjC7xHBLN2/s4c4jI3o7DgAlJut+e/0MVHbwVhm4Qs1QoUNwVqV2Ny2m7j7qWTwqjuSqma19OdaHD1U2PRkvsPLUV7H8J9XcFMsRZne3U9IEo6RnHXZk0ynhb9EEsdGPwzMD1vu3CNPyPsvbBapGQ5c+G9q0xD0mh7A43k8I4o4uHlHUftH+TGDdEk3veSoUhy3zRESdf1LEJowbsRakH7iaVgfyL44HjKBAkh3elryR1j+FZCDpoI13LofJ5fPUCp3GbzWgitkPHrdYIH0rjsYjJlZF2INPrbDiUd/qpTHY2xi3HwhM0UiYG/QB8vxkQ1oEC2LgRMsMB7dQaG9On3Ww+4n54vEoLdPoNaLi+ZKJlHEf4ukiEufyDPDG063qrXqrq1+rneO0W2Yk4uCH9cYzjTJYk5YurWLEX9vZaHucY0hIfzrhlh32d5JDGvwa6gue5bjase1MSPngiyEAQmTOI8Aw30jozWBlI36VyyKjLoo24tC181vOvLjCmwZX7DDFaxIGVlQzWNAnJm1StcpKrhFuqV/FocTe6hlYuTg9F5UqyVXGmfTTquXHE8jqhOybQ4+G7zKjHaEgXDc23ou19YenEtBx0g==","format":"google-gemini-v1","id":"tool_weather_j0DpU01anCLITtFWepce","index":0,"type":"reasoning.encrypted"}]},{"content":"40 C","tool_call_id":"tool_weather_j0DpU01anCLITtFWepce","role":"tool"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n\n \n\n \n\n \n\n \n{\"id\":\"gen-1763546715-2isSMEAOtYZrJ9E3lrvA\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-3-pro-preview\",\"object\":\"chat.completion\",\"created\":1763546715,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The weather in Florence, Italy is currently 40 degrees Celsius.\",\"refusal\":null,\"reasoning\":\"**Deliver the Answer**\\n\\nI've got the weather data for Florence - it's a scorching 40 degrees Celsius. Now, I'm crafting the response to the user, ensuring the temperature is clearly stated.\\n\\n\\n\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"**Deliver the Answer**\\n\\nI've got the weather data for Florence - it's a scorching 40 degrees Celsius. Now, I'm crafting the response to the user, ensuring the temperature is clearly stated.\\n\\n\\n\",\"format\":\"google-gemini-v1\",\"index\":0},{\"type\":\"reasoning.encrypted\",\"data\":\"Eo4CCosCAdHtim/M+Wv8vjHlzGm/0BnHiNkdjJezGKNj1AC7oH5ExVuvQNPnY51uym511/C6HVjzEeN5C286hYJXgQf6G4uTuoo5azntFo9nK7wER9jf98Amtt/3A6KpQpLzVDwe3Lidp5nHgdUzpIws5IwliAX9VtD6ktPhiI8v4UkFXsRp4sv2bI4Zvf4ORogdHJDN2fcLCTnZXOSVEdw6sZ4OZNI+JGc4tUyCE5cuU0jFWq0R/2eS6qn5N9TkBIx61H+OeXFyZtxX5edxtAykhSHv+kDa81s+wiYuwneBrb0uknwmuqHR3TTxzcn813ELwMnOaORVujw47blm2urGBxS9q7xj62udCT0wMli8\",\"format\":\"google-gemini-v1\",\"index\":0}]}}],\"usage\":{\"prompt_tokens\":193,\"completion_tokens\":55,\"total_tokens\":248,\"cost\":0.001046,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000386,\"upstream_inference_completions_cost\":0.00066},\"completion_tokens_details\":{\"reasoning_tokens\":41,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.627752916s diff --git a/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool_streaming.yaml b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4a017b561f99566702431e0a4e63d1476dfda701 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/gemini-3-pro-preview/tool_streaming.yaml @@ -0,0 +1,81 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 548 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1763546718-VolgJ4S2Tix4gqNJ9Pn9","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546718,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":"**Pinpointing the Weather**\n\nI've homed in on using the `weather` tool – a perfect match for the user's request! Now, I'm focusing on obtaining the necessary `location` parameter to make it work. I need to figure out how to parse \"Florence, Italy\" into a format the tool understands. I will need to get a location from a query using an available tool.\n\n\n","reasoning_details":[{"type":"reasoning.text","text":"**Pinpointing the Weather**\n\nI've homed in on using the `weather` tool – a perfect match for the user's request! Now, I'm focusing on obtaining the necessary `location` parameter to make it work. I need to figure out how to parse \"Florence, Italy\" into a format the tool understands. I will need to get a location from a query using an available tool.\n\n\n","format":"google-gemini-v1","index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546718-VolgJ4S2Tix4gqNJ9Pn9","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546718,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":"**Deciphering the Location**\n\nI've determined that the user's input directly provides the `location` needed by the weather tool. Specifically, \"Florence, Italy\" can be directly used as the `location` parameter. Thus, I'll execute the `weather` tool with `location='Florence, Italy'` as the argument.\n\n\n","reasoning_details":[{"type":"reasoning.text","text":"**Deciphering the Location**\n\nI've determined that the user's input directly provides the `location` needed by the weather tool. Specifically, \"Florence, Italy\" can be directly used as the `location` parameter. Thus, I'll execute the `weather` tool with `location='Florence, Italy'` as the argument.\n\n\n","format":"google-gemini-v1","index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546718-VolgJ4S2Tix4gqNJ9Pn9","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546718,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"reasoning":null,"reasoning_details":[{"id":"tool_weather_ZdFohc8uRXpsZsX3K74b","type":"reasoning.encrypted","data":"EvUDCvIDAdHtim/YGUj5NcE2xF6SC6IYQg3S9nvktXv6CQcy76ZTZdJ+5dFMIlPCXqVXLIrccmk3PX5MWiEM0NB0t4Cie2azaqDdgGgAN2kCKpZuJRIbqFDLWNR+oa0r2D7ShyyrWyAbz6YTjgBHvj8KqduwdA3Ya/9BKE1cuuacK4Sq3kH+cKpLMPXA3m4cZ7s/n02lvHHn2koGbXppEj7BuYxwHdDXOhHKN0JggJ9xzHR1DjL81e3DB3I7FITdUSL5U/DRfTwAErqfuTXfYUlNB2X3YUYHZ1vU0uCSCeliiG/mzmotfHHhb7VuzGmgLquhkQGcHbwoOkqTFVbT7iNBFg6kPtNc5qukvyprufaT3FfEupXH1qBv0djPYLwGyPsTIwDYt4QVsDd7pNb4yDj/1MrO/acvaCfz2vhwglSnTC0GUndMwFYCV991EAcsnLbPWNZcuztCzt8tvMjgUJkSQrRGuXUFUre6JQzv4VHl54NxxpTP/pOaWdKldT/j8Y64sb1tQwXYq1qFdYgKzh+U0ig/l05ZIvq9Mzw+R8p4qoug9wGV1U1cvXDwCIrkhN+k/j7DzcAg6kRgpNM26bUpBWZ7t8jhFgUIv+HyXfrBN9V4Q0Jd2ifN4yW68JBhCNeTe3d+/OokV5V8Y1McC5Moi3HC1Roq","format":"google-gemini-v1","index":0}],"tool_calls":[{"index":0,"id":"tool_weather_ZdFohc8uRXpsZsX3K74b","type":"function","function":{"name":"weather","arguments":"{\"location\":\"Florence, Italy\"}"}}]},"finish_reason":"tool_calls","native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546718-VolgJ4S2Tix4gqNJ9Pn9","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546718,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1763546718-VolgJ4S2Tix4gqNJ9Pn9","provider":"Google AI Studio","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546718,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":65,"completion_tokens":104,"total_tokens":169,"cost":0.001378,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00013,"upstream_inference_completions_cost":0.001248},"completion_tokens_details":{"reasoning_tokens":88,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 3.000569167s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 2368 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_weather_ZdFohc8uRXpsZsX3K74b","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"google-gemini-v1","index":0,"text":"**Pinpointing the Weather**\n\nI''ve homed in on using the `weather` tool – a perfect match for the user''s request! Now, I''m focusing on obtaining the necessary `location` parameter to make it work. I need to figure out how to parse \"Florence, Italy\" into a format the tool understands. I will need to get a location from a query using an available tool.\n\n\n**Deciphering the Location**\n\nI''ve determined that the user''s input directly provides the `location` needed by the weather tool. Specifically, \"Florence, Italy\" can be directly used as the `location` parameter. Thus, I''ll execute the `weather` tool with `location=''Florence, Italy''` as the argument.\n\n\n","type":"reasoning.text"},{"data":"EvUDCvIDAdHtim/YGUj5NcE2xF6SC6IYQg3S9nvktXv6CQcy76ZTZdJ+5dFMIlPCXqVXLIrccmk3PX5MWiEM0NB0t4Cie2azaqDdgGgAN2kCKpZuJRIbqFDLWNR+oa0r2D7ShyyrWyAbz6YTjgBHvj8KqduwdA3Ya/9BKE1cuuacK4Sq3kH+cKpLMPXA3m4cZ7s/n02lvHHn2koGbXppEj7BuYxwHdDXOhHKN0JggJ9xzHR1DjL81e3DB3I7FITdUSL5U/DRfTwAErqfuTXfYUlNB2X3YUYHZ1vU0uCSCeliiG/mzmotfHHhb7VuzGmgLquhkQGcHbwoOkqTFVbT7iNBFg6kPtNc5qukvyprufaT3FfEupXH1qBv0djPYLwGyPsTIwDYt4QVsDd7pNb4yDj/1MrO/acvaCfz2vhwglSnTC0GUndMwFYCV991EAcsnLbPWNZcuztCzt8tvMjgUJkSQrRGuXUFUre6JQzv4VHl54NxxpTP/pOaWdKldT/j8Y64sb1tQwXYq1qFdYgKzh+U0ig/l05ZIvq9Mzw+R8p4qoug9wGV1U1cvXDwCIrkhN+k/j7DzcAg6kRgpNM26bUpBWZ7t8jhFgUIv+HyXfrBN9V4Q0Jd2ifN4yW68JBhCNeTe3d+/OokV5V8Y1McC5Moi3HC1Roq","format":"google-gemini-v1","id":"tool_weather_ZdFohc8uRXpsZsX3K74b","index":0,"type":"reasoning.encrypted"}]},{"content":"40 C","tool_call_id":"tool_weather_ZdFohc8uRXpsZsX3K74b","role":"tool"}],"model":"google/gemini-3-pro-preview","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1763546721-kbEZ3lLMWQc3gbgqRMRp","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546721,"choices":[{"index":0,"delta":{"role":"assistant","content":"The weather in Florence","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546721-kbEZ3lLMWQc3gbgqRMRp","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546721,"choices":[{"index":0,"delta":{"role":"assistant","content":", Italy is 40°C.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1763546721-kbEZ3lLMWQc3gbgqRMRp","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546721,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":56,"completion_tokens":13,"total_tokens":69,"cost":0.000268,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000112,"upstream_inference_completions_cost":0.000156},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 1.668490333s diff --git a/providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking-streaming.yaml b/providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking-streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..25ff2c9031ce56245323bc1e4982246902c8bd61 --- /dev/null +++ b/providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking-streaming.yaml @@ -0,0 +1,77 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 563 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"}],"model":"google/gemini-3-pro-preview","stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"reasoning":{"effort":"medium"},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1763546643-6iyR5xZk4FUZDszB0am5","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546643,"choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning":"**Processing Weather Request**\n\nI've zeroed in on the user's weather query and pinpointed the location as Florence, Italy. The next step involves invoking the `get_weather` function, feeding it the identified location as a parameter. It's a straightforward process, I am ready to move on.\n\n\n","reasoning_details":[{"type":"reasoning.text","text":"**Processing Weather Request**\n\nI've zeroed in on the user's weather query and pinpointed the location as Florence, Italy. The next step involves invoking the `get_weather` function, feeding it the identified location as a parameter. It's a straightforward process, I am ready to move on.\n\n\n","format":"google-gemini-v1","index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546643-6iyR5xZk4FUZDszB0am5","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546643,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"reasoning":null,"reasoning_details":[{"id":"tool_weather_DTRiEM9ZhsGia4wKxtzr","type":"reasoning.encrypted","data":"CiQB4/H/XtQf/t2ivBCPsAJ1IAjit6zgeJbobI/H5w09u43xVM8KZwHj8f9e51jeSFgDf45Pkwo86CrPlD3o8ZyFEE/tLx74kTzrLixqIoG3WAJV4vzbIAAvRRm8HgovZkKLa/qR7XL3QyYKnFSDVbik86ElPf/9E9EbBc18RcBhU30VLLx+QWaL/9w9u/UKaAHj8f9eNB+grvQVrGDcL0BgnNLzSM4mVEAvaPOa6XddLxIi3izFHNpGVtVI1J8ABVPEzAwmZqGcr/NJTJDM+z0pZrnhUEdR5nCMw3/Kk6KH0SoOC+E0E9O8+0uTEZ2aVAIAqdI/cK98CqEBAePx/16FP6yD1/O5En03//g+Ux5rgUEtTKNmAvmlwyFy/62/L4iaDa7V/qSXsh5cjvcuzPGDfNu/E4LF+RrTK23Obdj9sa/CpVR8C//SfsztgPNrnn3DRxf78QYwIVHZeJdWTLsQ7gR97YqqV+p+ljwBkriVJ0hOdxlJzoKSDOqXk5HVLpS95XTVPrclF+TmDww+0YbNFAtIU5jOI465caQ=","format":"google-gemini-v1","index":0}],"tool_calls":[{"index":0,"id":"tool_weather_DTRiEM9ZhsGia4wKxtzr","type":"function","function":{"name":"weather","arguments":"{\"location\":\"Florence, Italy\"}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1763546643-6iyR5xZk4FUZDszB0am5","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546643,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":28,"completion_tokens":73,"total_tokens":101,"cost":0.000932,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000056,"upstream_inference_completions_cost":0.000876},"completion_tokens_details":{"reasoning_tokens":64,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 4.566491625s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1887 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"},{"tool_calls":[{"id":"tool_weather_DTRiEM9ZhsGia4wKxtzr","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"google-gemini-v1","index":0,"text":"**Processing Weather Request**\n\nI''ve zeroed in on the user''s weather query and pinpointed the location as Florence, Italy. The next step involves invoking the `get_weather` function, feeding it the identified location as a parameter. It''s a straightforward process, I am ready to move on.\n\n\n","type":"reasoning.text"},{"data":"CiQB4/H/XtQf/t2ivBCPsAJ1IAjit6zgeJbobI/H5w09u43xVM8KZwHj8f9e51jeSFgDf45Pkwo86CrPlD3o8ZyFEE/tLx74kTzrLixqIoG3WAJV4vzbIAAvRRm8HgovZkKLa/qR7XL3QyYKnFSDVbik86ElPf/9E9EbBc18RcBhU30VLLx+QWaL/9w9u/UKaAHj8f9eNB+grvQVrGDcL0BgnNLzSM4mVEAvaPOa6XddLxIi3izFHNpGVtVI1J8ABVPEzAwmZqGcr/NJTJDM+z0pZrnhUEdR5nCMw3/Kk6KH0SoOC+E0E9O8+0uTEZ2aVAIAqdI/cK98CqEBAePx/16FP6yD1/O5En03//g+Ux5rgUEtTKNmAvmlwyFy/62/L4iaDa7V/qSXsh5cjvcuzPGDfNu/E4LF+RrTK23Obdj9sa/CpVR8C//SfsztgPNrnn3DRxf78QYwIVHZeJdWTLsQ7gR97YqqV+p+ljwBkriVJ0hOdxlJzoKSDOqXk5HVLpS95XTVPrclF+TmDww+0YbNFAtIU5jOI465caQ=","format":"google-gemini-v1","id":"tool_weather_DTRiEM9ZhsGia4wKxtzr","index":0,"type":"reasoning.encrypted"}]},{"content":"40 C","tool_call_id":"tool_weather_DTRiEM9ZhsGia4wKxtzr","role":"tool"}],"model":"google/gemini-3-pro-preview","stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"reasoning":{"effort":"medium"},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1763546647-Tp9ZHwQ3rhhPj6NAdVFO","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546647,"choices":[{"index":0,"delta":{"role":"assistant","content":"The weather","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1763546647-Tp9ZHwQ3rhhPj6NAdVFO","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546647,"choices":[{"index":0,"delta":{"role":"assistant","content":" in Florence, Italy is currently 40°C.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1763546647-Tp9ZHwQ3rhhPj6NAdVFO","provider":"Google","model":"google/gemini-3-pro-preview","object":"chat.completion.chunk","created":1763546647,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":54,"completion_tokens":14,"total_tokens":68,"cost":0.000276,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000108,"upstream_inference_completions_cost":0.000168},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 1.671475084s diff --git a/providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking.yaml b/providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking.yaml new file mode 100644 index 0000000000000000000000000000000000000000..84ee5e5e70c626f887ef662297512c8ece52661b --- /dev/null +++ b/providertests/testdata/TestOpenRouterThinking/gemini-3-pro-preview/thinking.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 509 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"}],"model":"google/gemini-3-pro-preview","tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"reasoning":{"effort":"medium"},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n\n \n\n \n\n \n\n \n{\"id\":\"gen-1763546487-yFEwYukW5QfhvzEHSekZ\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-3-pro-preview\",\"object\":\"chat.completion\",\"created\":1763546488,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":\"**Acquiring Weather Data**\\n\\nI've decided to use the weather tool to get the current forecast for Florence, Italy. The location will be specified as \\\"Florence, Italy\\\" to get the most accurate results. I'm ready to proceed with using the tool and return the information.\\n\\n\\n\",\"tool_calls\":[{\"index\":0,\"id\":\"tool_weather_lYXVFov6DFhVAnGHGzui\",\"type\":\"function\",\"function\":{\"name\":\"weather\",\"arguments\":\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"}}],\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"**Acquiring Weather Data**\\n\\nI've decided to use the weather tool to get the current forecast for Florence, Italy. The location will be specified as \\\"Florence, Italy\\\" to get the most accurate results. I'm ready to proceed with using the tool and return the information.\\n\\n\\n\",\"format\":\"google-gemini-v1\",\"index\":0},{\"type\":\"reasoning.encrypted\",\"data\":\"Eo4CCosCAdHtim9UBFExPDgDuh8MWbVEkO9w+s9pDzoFBZjc7fdzo6eGpv04hlhBygkMpO6VBAIRKEooegdRQnhJUUWJD/Zrf5cfiahXRK4fWPQvTaBxS7+h1HpDORflVhuy2kDFSGDQkI43qaqvIPdBZLuo6P+KEO7rXnRAUJZ5EBhTqszy6qSDBkBZJofLvV0Hrm2AatVECeqV8ZX1fuVZ0vKgzHcE3ZQJD2CX2Hcu1DHf2zZRL9ghxK12GtxwBQjfHVj0uHafLMvMEMyOA6kRDkWRh7q+EPJ1MjCRKsEbZCEh29oXIUZUT9UI96H8harvQ+88L6WuN8AGv9+CFrHuenGzd7SymIM/C4L+vhge\",\"id\":\"tool_weather_lYXVFov6DFhVAnGHGzui\",\"format\":\"google-gemini-v1\",\"index\":0}]}}],\"usage\":{\"prompt_tokens\":65,\"completion_tokens\":58,\"total_tokens\":123,\"cost\":0.000826,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00013,\"upstream_inference_completions_cost\":0.000696},\"completion_tokens_details\":{\"reasoning_tokens\":42,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 3.118976208s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1627 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"},{"tool_calls":[{"id":"tool_weather_lYXVFov6DFhVAnGHGzui","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"google-gemini-v1","index":0,"text":"**Acquiring Weather Data**\n\nI''ve decided to use the weather tool to get the current forecast for Florence, Italy. The location will be specified as \"Florence, Italy\" to get the most accurate results. I''m ready to proceed with using the tool and return the information.\n\n\n","type":"reasoning.text"},{"data":"Eo4CCosCAdHtim9UBFExPDgDuh8MWbVEkO9w+s9pDzoFBZjc7fdzo6eGpv04hlhBygkMpO6VBAIRKEooegdRQnhJUUWJD/Zrf5cfiahXRK4fWPQvTaBxS7+h1HpDORflVhuy2kDFSGDQkI43qaqvIPdBZLuo6P+KEO7rXnRAUJZ5EBhTqszy6qSDBkBZJofLvV0Hrm2AatVECeqV8ZX1fuVZ0vKgzHcE3ZQJD2CX2Hcu1DHf2zZRL9ghxK12GtxwBQjfHVj0uHafLMvMEMyOA6kRDkWRh7q+EPJ1MjCRKsEbZCEh29oXIUZUT9UI96H8harvQ+88L6WuN8AGv9+CFrHuenGzd7SymIM/C4L+vhge","format":"google-gemini-v1","id":"tool_weather_lYXVFov6DFhVAnGHGzui","index":0,"type":"reasoning.encrypted"}]},{"content":"40 C","tool_call_id":"tool_weather_lYXVFov6DFhVAnGHGzui","role":"tool"}],"model":"google/gemini-3-pro-preview","tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"reasoning":{"effort":"medium"},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.7.1 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n\n \n\n \n{\"id\":\"gen-1763546490-1xpxTRabcgvGkdsoaObe\",\"provider\":\"Google\",\"model\":\"google/gemini-3-pro-preview\",\"object\":\"chat.completion\",\"created\":1763546490,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The weather in Florence is currently 40°C.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":54,\"completion_tokens\":12,\"total_tokens\":66,\"cost\":0.000252,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000108,\"upstream_inference_completions_cost\":0.000144},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.710336083s