From 7eef16ca4c62829c0c2f620f5894545cdccb8884 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Fri, 17 Oct 2025 15:33:36 +0200 Subject: [PATCH] feat: add openai reasponses api (#20) * feat: add openai reasponses api * fix(lint): some lint issues --- ai/agent.go | 13 +- ai/agent_stream_test.go | 2 +- ai/util.go | 16 +- cspell.json | 2 +- examples/simple/main.go | 2 +- examples/stream/main.go | 2 +- examples/streaming-agent/main.go | 2 +- google/google.go | 2 +- openai/openai.go | 17 +- openai/openai_test.go | 30 +- openai/responses_language_model.go | 1058 +++++++++++++++++ openai/responses_options.go | 128 ++ providertests/common_test.go | 15 +- providertests/google_test.go | 4 +- providertests/openai_responses_test.go | 85 ++ providertests/openai_test.go | 45 +- .../gpt-4o-mini/simple_streaming.yaml | 44 - .../gpt-4o/multi_tool_streaming.yaml | 151 --- .../gpt-4o/tool_streaming.yaml | 117 -- .../gpt-5/tool_streaming.yaml | 143 --- .../multi_tool.yaml | 24 +- .../multi_tool_streaming.yaml | 88 +- .../simple.yaml | 12 +- .../openai-gpt-4o-mini/simple_streaming.yaml | 60 + .../tool.yaml | 22 +- .../tool_streaming.yaml | 58 +- .../{gpt-4o => openai-gpt-4o}/multi_tool.yaml | 28 +- .../openai-gpt-4o/multi_tool_streaming.yaml | 135 +++ .../{gpt-4o => openai-gpt-4o}/simple.yaml | 8 +- .../simple_streaming.yaml | 12 +- .../{gpt-4o => openai-gpt-4o}/tool.yaml | 22 +- .../openai-gpt-4o/tool_streaming.yaml | 117 ++ .../{gpt-5 => openai-gpt-5}/multi_tool.yaml | 30 +- .../multi_tool_streaming.yaml | 84 +- .../{gpt-5 => openai-gpt-5}/simple.yaml | 12 +- .../simple_streaming.yaml | 12 +- .../{gpt-5 => openai-gpt-5}/tool.yaml | 30 +- .../openai-gpt-5/tool_streaming.yaml | 125 ++ .../openai-o4-mini/simple.yaml | 68 ++ .../openai-o4-mini/simple_streaming.yaml | 44 + .../TestOpenAICommon/openai-o4-mini/tool.yaml | 143 +++ .../openai-o4-mini/tool_streaming.yaml | 149 +++ .../openai-gpt-4o-mini/multi_tool.yaml | 293 +++++ .../multi_tool_streaming.yaml | 232 ++++ .../openai-gpt-4o-mini/simple.yaml | 100 ++ .../openai-gpt-4o-mini/simple_streaming.yaml | 62 + .../openai-gpt-4o-mini/tool.yaml | 229 ++++ .../openai-gpt-4o-mini/tool_streaming.yaml | 211 ++++ .../openai-gpt-4o/multi_tool.yaml | 293 +++++ .../openai-gpt-4o/multi_tool_streaming.yaml | 211 ++++ .../openai-gpt-4o/simple.yaml | 100 ++ .../openai-gpt-4o/simple_streaming.yaml | 62 + .../openai-gpt-4o/tool.yaml | 229 ++++ .../openai-gpt-4o/tool_streaming.yaml | 163 +++ .../openai-gpt-5/multi_tool.yaml | 298 +++++ .../openai-gpt-5/multi_tool_streaming.yaml | 202 ++++ .../openai-gpt-5/simple.yaml | 105 ++ .../openai-gpt-5/simple_streaming.yaml | 68 ++ .../openai-gpt-5/tool.yaml | 239 ++++ .../openai-gpt-5/tool_streaming.yaml | 217 ++++ .../openai-o4-mini/simple.yaml | 105 ++ .../openai-o4-mini/simple_streaming.yaml | 68 ++ .../openai-o4-mini/tool.yaml | 234 ++++ .../openai-o4-mini/tool_streaming.yaml | 169 +++ .../openai-gpt-5/thinking-streaming.yaml | 499 ++++++++ .../openai-gpt-5/thinking.yaml | 259 ++++ .../openai-o4-mini/thinking-streaming.yaml | 232 ++++ .../openai-o4-mini/thinking.yaml | 235 ++++ 68 files changed, 7527 insertions(+), 749 deletions(-) create mode 100644 openai/responses_language_model.go create mode 100644 openai/responses_options.go create mode 100644 providertests/openai_responses_test.go delete mode 100644 providertests/testdata/TestOpenAICommon/gpt-4o-mini/simple_streaming.yaml delete mode 100644 providertests/testdata/TestOpenAICommon/gpt-4o/multi_tool_streaming.yaml delete mode 100644 providertests/testdata/TestOpenAICommon/gpt-4o/tool_streaming.yaml delete mode 100644 providertests/testdata/TestOpenAICommon/gpt-5/tool_streaming.yaml rename providertests/testdata/TestOpenAICommon/{gpt-4o-mini => openai-gpt-4o-mini}/multi_tool.yaml (86%) rename providertests/testdata/TestOpenAICommon/{gpt-4o-mini => openai-gpt-4o-mini}/multi_tool_streaming.yaml (61%) rename providertests/testdata/TestOpenAICommon/{gpt-4o-mini => openai-gpt-4o-mini}/simple.yaml (86%) create mode 100644 providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/simple_streaming.yaml rename providertests/testdata/TestOpenAICommon/{gpt-4o-mini => openai-gpt-4o-mini}/tool.yaml (87%) rename providertests/testdata/TestOpenAICommon/{gpt-4o-mini => openai-gpt-4o-mini}/tool_streaming.yaml (59%) rename providertests/testdata/TestOpenAICommon/{gpt-4o => openai-gpt-4o}/multi_tool.yaml (84%) create mode 100644 providertests/testdata/TestOpenAICommon/openai-gpt-4o/multi_tool_streaming.yaml rename providertests/testdata/TestOpenAICommon/{gpt-4o => openai-gpt-4o}/simple.yaml (91%) rename providertests/testdata/TestOpenAICommon/{gpt-4o => openai-gpt-4o}/simple_streaming.yaml (65%) rename providertests/testdata/TestOpenAICommon/{gpt-4o => openai-gpt-4o}/tool.yaml (86%) create mode 100644 providertests/testdata/TestOpenAICommon/openai-gpt-4o/tool_streaming.yaml rename providertests/testdata/TestOpenAICommon/{gpt-5 => openai-gpt-5}/multi_tool.yaml (84%) rename providertests/testdata/TestOpenAICommon/{gpt-5 => openai-gpt-5}/multi_tool_streaming.yaml (55%) rename providertests/testdata/TestOpenAICommon/{gpt-5 => openai-gpt-5}/simple.yaml (87%) rename providertests/testdata/TestOpenAICommon/{gpt-5 => openai-gpt-5}/simple_streaming.yaml (66%) rename providertests/testdata/TestOpenAICommon/{gpt-5 => openai-gpt-5}/tool.yaml (82%) create mode 100644 providertests/testdata/TestOpenAICommon/openai-gpt-5/tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAICommon/openai-o4-mini/simple.yaml create mode 100644 providertests/testdata/TestOpenAICommon/openai-o4-mini/simple_streaming.yaml create mode 100644 providertests/testdata/TestOpenAICommon/openai-o4-mini/tool.yaml create mode 100644 providertests/testdata/TestOpenAICommon/openai-o4-mini/tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool_streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking-streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking-streaming.yaml create mode 100644 providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking.yaml diff --git a/ai/agent.go b/ai/agent.go index 6cb88c7bca0f00e9df90954246a406c7729a65f5..310f573f74165212c21d78299c737fd4e62b6de7 100644 --- a/ai/agent.go +++ b/ai/agent.go @@ -192,7 +192,7 @@ type ( OnTextEndFunc func(id string) error // OnReasoningStartFunc is called when reasoning starts. - OnReasoningStartFunc func(id string) error + OnReasoningStartFunc func(id string, reasoning ReasoningContent) error // OnReasoningDeltaFunc is called for reasoning deltas. OnReasoningDeltaFunc func(id, text string) error @@ -1135,9 +1135,13 @@ func (a *agent) processStepStream(ctx context.Context, stream StreamResponse, op } case StreamPartTypeReasoningStart: - activeReasoningContent[part.ID] = reasoningContent{content: ""} + activeReasoningContent[part.ID] = reasoningContent{content: "", options: part.ProviderMetadata} if opts.OnReasoningStart != nil { - err := opts.OnReasoningStart(part.ID) + content := ReasoningContent{ + Text: "", + ProviderMetadata: part.ProviderMetadata, + } + err := opts.OnReasoningStart(part.ID, content) if err != nil { return StepResult{}, false, err } @@ -1158,6 +1162,9 @@ func (a *agent) processStepStream(ctx context.Context, stream StreamResponse, op case StreamPartTypeReasoningEnd: if active, exists := activeReasoningContent[part.ID]; exists { + if part.ProviderMetadata != nil { + active.options = part.ProviderMetadata + } content := ReasoningContent{ Text: active.content, ProviderMetadata: active.options, diff --git a/ai/agent_stream_test.go b/ai/agent_stream_test.go index 5d7620cdb18206bc71038b4fee4c743919d144be..38d9f5db324e53ff7cf9329b97643ec2686ea777 100644 --- a/ai/agent_stream_test.go +++ b/ai/agent_stream_test.go @@ -157,7 +157,7 @@ func TestStreamingAgentCallbacks(t *testing.T) { callbacks["OnTextEnd"] = true return nil }, - OnReasoningStart: func(id string) error { + OnReasoningStart: func(id string, _ ReasoningContent) error { callbacks["OnReasoningStart"] = true return nil }, diff --git a/ai/util.go b/ai/util.go index 5c18c825a491f5714a97a9f1a92ca0aa63ad96c3..2d11a0c10bd4e8c5ad3806073a51e924196ad439 100644 --- a/ai/util.go +++ b/ai/util.go @@ -2,20 +2,8 @@ package ai import "github.com/go-viper/mapstructure/v2" -func FloatOption(f float64) *float64 { - return &f -} - -func BoolOption(b bool) *bool { - return &b -} - -func StringOption(s string) *string { - return &s -} - -func IntOption(i int64) *int64 { - return &i +func Opt[T any](v T) *T { + return &v } func ParseOptions[T any](options map[string]any, m *T) error { diff --git a/cspell.json b/cspell.json index 523792ea6cf8b1944e94d2c598604c7072c1c69f..8ca46c42b699439522e183aee66dd46b5a7c0895 100644 --- a/cspell.json +++ b/cspell.json @@ -1 +1 @@ -{"flagWords":[],"language":"en","version":"0.2","words":["mapstructure","mapstructure","charmbracelet","providertests","joho","godotenv","stretchr","Quantizations","Logit","Probs","openrouter","openaisdk"]} \ No newline at end of file +{"flagWords":[],"words":["mapstructure","mapstructure","charmbracelet","providertests","joho","godotenv","stretchr","Quantizations","Logit","Probs","openrouter","openaisdk","Logprobs","Includable"],"version":"0.2","language":"en"} \ No newline at end of file diff --git a/examples/simple/main.go b/examples/simple/main.go index 9a6e5aa9f1de483b10eb69a9a7c346cda4572afe..9a43556bc24b3145af5b865060e941f84f9fdf88 100644 --- a/examples/simple/main.go +++ b/examples/simple/main.go @@ -21,7 +21,7 @@ func main() { Prompt: ai.Prompt{ ai.NewUserMessage("Hello"), }, - Temperature: ai.FloatOption(0.7), + Temperature: ai.Opt(0.7), }) if err != nil { fmt.Println(err) diff --git a/examples/stream/main.go b/examples/stream/main.go index f6ea25b586b8a4cd21b2a55e37e768de8197b200..eede4d9c5582e928f9e84579a6f5f28015cc8fad 100644 --- a/examples/stream/main.go +++ b/examples/stream/main.go @@ -22,7 +22,7 @@ func main() { Prompt: ai.Prompt{ ai.NewUserMessage("Whats the weather in pristina."), }, - Temperature: ai.FloatOption(0.7), + Temperature: ai.Opt(0.7), Tools: []ai.Tool{ ai.FunctionTool{ Name: "weather", diff --git a/examples/streaming-agent/main.go b/examples/streaming-agent/main.go index a0944ceb8bd5735f6d8371f2b93ebbe9f1d9b65f..2cbdea58dd047096393f4ba4d593078450cbb40a 100644 --- a/examples/streaming-agent/main.go +++ b/examples/streaming-agent/main.go @@ -166,7 +166,7 @@ func main() { fmt.Println() return nil }, - OnReasoningStart: func(id string) error { + OnReasoningStart: func(id string, _ ai.ReasoningContent) error { fmt.Print("🤔 Thinking: ") return nil }, diff --git a/google/google.go b/google/google.go index e3192d47c06a5b81e5b48f03254bba598baf4363..1586816ef77601ccd3fa37541af49a2694e3d774 100644 --- a/google/google.go +++ b/google/google.go @@ -190,7 +190,7 @@ func (a languageModel) prepareParams(call ai.Call) (*genai.GenerateContentConfig Type: ai.CallWarningTypeOther, Message: "The 'thinking_budget' option can not be under 128 and will be set to 128 by default", }) - providerOptions.ThinkingConfig.ThinkingBudget = ai.IntOption(128) + providerOptions.ThinkingConfig.ThinkingBudget = ai.Opt(int64(128)) } } diff --git a/openai/openai.go b/openai/openai.go index 86c483c93d80a90138854742faad3ad3c74d2a6f..d1d69508576ac8162701402167c977952417cb38 100644 --- a/openai/openai.go +++ b/openai/openai.go @@ -1,3 +1,4 @@ +// Package openai contains the openai provider package openai import ( @@ -24,6 +25,7 @@ type options struct { organization string project string name string + useResponsesAPI bool headers map[string]string client option.HTTPClient sdkOptions []option.RequestOption @@ -108,6 +110,13 @@ func WithLanguageModelOptions(opts ...LanguageModelOption) Option { } } +// WithUseResponsesAPI makes it so the provider uses responses API for models that support it. +func WithUseResponsesAPI() Option { + return func(o *options) { + o.useResponsesAPI = true + } +} + // LanguageModel implements ai.Provider. func (o *provider) LanguageModel(modelID string) (ai.LanguageModel, error) { openaiClientOptions := make([]option.RequestOption, 0, 5+len(o.options.headers)+len(o.options.sdkOptions)) @@ -129,10 +138,16 @@ func (o *provider) LanguageModel(modelID string) (ai.LanguageModel, error) { openaiClientOptions = append(openaiClientOptions, o.options.sdkOptions...) + client := openai.NewClient(openaiClientOptions...) + + if o.options.useResponsesAPI && IsResponsesModel(modelID) { + return newResponsesLanguageModel(modelID, o.options.name, client), nil + } + return newLanguageModel( modelID, o.options.name, - openai.NewClient(openaiClientOptions...), + client, o.options.languageModelOptions..., ), nil } diff --git a/openai/openai_test.go b/openai/openai_test.go index d16a7101519edef3abf6b76bab33c2ea42cc0799..c5f6b56a09a68d48bf5e55124e0a47b0aea60f96 100644 --- a/openai/openai_test.go +++ b/openai/openai_test.go @@ -940,7 +940,7 @@ func TestDoGenerate(t *testing.T) { result, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - LogProbs: ai.BoolOption(true), + LogProbs: ai.Opt(true), }), }) @@ -1057,8 +1057,8 @@ func TestDoGenerate(t *testing.T) { LogitBias: map[string]int64{ "50256": -100, }, - ParallelToolCalls: ai.BoolOption(false), - User: ai.StringOption("test-user-id"), + ParallelToolCalls: ai.Opt(false), + User: ai.Opt("test-user-id"), }), }) @@ -1136,7 +1136,7 @@ func TestDoGenerate(t *testing.T) { _, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - TextVerbosity: ai.StringOption("low"), + TextVerbosity: ai.Opt("low"), }), }) @@ -1528,7 +1528,7 @@ func TestDoGenerate(t *testing.T) { _, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - MaxCompletionTokens: ai.IntOption(255), + MaxCompletionTokens: ai.Opt(int64(255)), }), }) @@ -1610,7 +1610,7 @@ func TestDoGenerate(t *testing.T) { _, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - Store: ai.BoolOption(true), + Store: ai.Opt(true), }), }) @@ -1690,7 +1690,7 @@ func TestDoGenerate(t *testing.T) { _, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - PromptCacheKey: ai.StringOption("test-cache-key-123"), + PromptCacheKey: ai.Opt("test-cache-key-123"), }), }) @@ -1728,7 +1728,7 @@ func TestDoGenerate(t *testing.T) { _, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - SafetyIdentifier: ai.StringOption("test-safety-identifier-123"), + SafetyIdentifier: ai.Opt("test-safety-identifier-123"), }), }) @@ -1798,7 +1798,7 @@ func TestDoGenerate(t *testing.T) { _, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - ServiceTier: ai.StringOption("flex"), + ServiceTier: ai.Opt("flex"), }), }) @@ -1834,7 +1834,7 @@ func TestDoGenerate(t *testing.T) { result, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - ServiceTier: ai.StringOption("flex"), + ServiceTier: ai.Opt("flex"), }), }) @@ -1867,7 +1867,7 @@ func TestDoGenerate(t *testing.T) { _, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - ServiceTier: ai.StringOption("priority"), + ServiceTier: ai.Opt("priority"), }), }) @@ -1903,7 +1903,7 @@ func TestDoGenerate(t *testing.T) { result, err := model.Generate(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - ServiceTier: ai.StringOption("priority"), + ServiceTier: ai.Opt("priority"), }), }) @@ -2573,7 +2573,7 @@ func TestDoStream(t *testing.T) { _, err := model.Stream(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - Store: ai.BoolOption(true), + Store: ai.Opt(true), }), }) @@ -2661,7 +2661,7 @@ func TestDoStream(t *testing.T) { _, err := model.Stream(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - ServiceTier: ai.StringOption("flex"), + ServiceTier: ai.Opt("flex"), }), }) @@ -2703,7 +2703,7 @@ func TestDoStream(t *testing.T) { _, err := model.Stream(context.Background(), ai.Call{ Prompt: testPrompt, ProviderOptions: NewProviderOptions(&ProviderOptions{ - ServiceTier: ai.StringOption("priority"), + ServiceTier: ai.Opt("priority"), }), }) diff --git a/openai/responses_language_model.go b/openai/responses_language_model.go new file mode 100644 index 0000000000000000000000000000000000000000..cba427d04ddff172b93efecc9a9004550384c058 --- /dev/null +++ b/openai/responses_language_model.go @@ -0,0 +1,1058 @@ +package openai + +import ( + "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "strings" + + "github.com/charmbracelet/fantasy/ai" + "github.com/google/uuid" + "github.com/openai/openai-go/v2" + "github.com/openai/openai-go/v2/packages/param" + "github.com/openai/openai-go/v2/responses" + "github.com/openai/openai-go/v2/shared" +) + +const topLogprobsMax = 20 + +type responsesLanguageModel struct { + provider string + modelID string + client openai.Client +} + +// newResponsesLanguageModel implements a responses api model +// INFO: (kujtim) currently we do not support stored parameter we default it to false. +func newResponsesLanguageModel(modelID string, provider string, client openai.Client) responsesLanguageModel { + return responsesLanguageModel{ + modelID: modelID, + provider: provider, + client: client, + } +} + +func (o responsesLanguageModel) Model() string { + return o.modelID +} + +func (o responsesLanguageModel) Provider() string { + return o.provider +} + +type responsesModelConfig struct { + isReasoningModel bool + systemMessageMode string + requiredAutoTruncation bool + supportsFlexProcessing bool + supportsPriorityProcessing bool +} + +func getResponsesModelConfig(modelID string) responsesModelConfig { + supportsFlexProcessing := strings.HasPrefix(modelID, "o3") || + strings.HasPrefix(modelID, "o4-mini") || + (strings.HasPrefix(modelID, "gpt-5") && !strings.HasPrefix(modelID, "gpt-5-chat")) + + supportsPriorityProcessing := strings.HasPrefix(modelID, "gpt-4") || + strings.HasPrefix(modelID, "gpt-5-mini") || + (strings.HasPrefix(modelID, "gpt-5") && + !strings.HasPrefix(modelID, "gpt-5-nano") && + !strings.HasPrefix(modelID, "gpt-5-chat")) || + strings.HasPrefix(modelID, "o3") || + strings.HasPrefix(modelID, "o4-mini") + + defaults := responsesModelConfig{ + requiredAutoTruncation: false, + systemMessageMode: "system", + supportsFlexProcessing: supportsFlexProcessing, + supportsPriorityProcessing: supportsPriorityProcessing, + } + + if strings.HasPrefix(modelID, "gpt-5-chat") { + return responsesModelConfig{ + isReasoningModel: false, + systemMessageMode: defaults.systemMessageMode, + requiredAutoTruncation: defaults.requiredAutoTruncation, + supportsFlexProcessing: defaults.supportsFlexProcessing, + supportsPriorityProcessing: defaults.supportsPriorityProcessing, + } + } + + if strings.HasPrefix(modelID, "o") || + strings.HasPrefix(modelID, "gpt-5") || + strings.HasPrefix(modelID, "codex-") || + strings.HasPrefix(modelID, "computer-use") { + if strings.HasPrefix(modelID, "o1-mini") || strings.HasPrefix(modelID, "o1-preview") { + return responsesModelConfig{ + isReasoningModel: true, + systemMessageMode: "remove", + requiredAutoTruncation: defaults.requiredAutoTruncation, + supportsFlexProcessing: defaults.supportsFlexProcessing, + supportsPriorityProcessing: defaults.supportsPriorityProcessing, + } + } + + return responsesModelConfig{ + isReasoningModel: true, + systemMessageMode: "developer", + requiredAutoTruncation: defaults.requiredAutoTruncation, + supportsFlexProcessing: defaults.supportsFlexProcessing, + supportsPriorityProcessing: defaults.supportsPriorityProcessing, + } + } + + return responsesModelConfig{ + isReasoningModel: false, + systemMessageMode: defaults.systemMessageMode, + requiredAutoTruncation: defaults.requiredAutoTruncation, + supportsFlexProcessing: defaults.supportsFlexProcessing, + supportsPriorityProcessing: defaults.supportsPriorityProcessing, + } +} + +func (o responsesLanguageModel) prepareParams(call ai.Call) (*responses.ResponseNewParams, []ai.CallWarning) { + var warnings []ai.CallWarning + params := &responses.ResponseNewParams{ + Store: param.NewOpt(false), + } + + modelConfig := getResponsesModelConfig(o.modelID) + + if call.TopK != nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "topK", + }) + } + + if call.PresencePenalty != nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "presencePenalty", + }) + } + + if call.FrequencyPenalty != nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "frequencyPenalty", + }) + } + + var openaiOptions *ResponsesProviderOptions + if opts, ok := call.ProviderOptions[Name]; ok { + if typedOpts, ok := opts.(*ResponsesProviderOptions); ok { + openaiOptions = typedOpts + } + } + + input, inputWarnings := toResponsesPrompt(call.Prompt, modelConfig.systemMessageMode) + warnings = append(warnings, inputWarnings...) + + var include []IncludeType + + addInclude := func(key IncludeType) { + include = append(include, key) + } + + topLogprobs := 0 + if openaiOptions != nil && openaiOptions.Logprobs != nil { + switch v := openaiOptions.Logprobs.(type) { + case bool: + if v { + topLogprobs = topLogprobsMax + } + case float64: + topLogprobs = int(v) + case int: + topLogprobs = v + } + } + + if topLogprobs > 0 { + addInclude(IncludeMessageOutputTextLogprobs) + } + + params.Model = o.modelID + params.Input = responses.ResponseNewParamsInputUnion{ + OfInputItemList: input, + } + + if call.Temperature != nil { + params.Temperature = param.NewOpt(*call.Temperature) + } + if call.TopP != nil { + params.TopP = param.NewOpt(*call.TopP) + } + if call.MaxOutputTokens != nil { + params.MaxOutputTokens = param.NewOpt(*call.MaxOutputTokens) + } + + if openaiOptions != nil { + if openaiOptions.MaxToolCalls != nil { + params.MaxToolCalls = param.NewOpt(*openaiOptions.MaxToolCalls) + } + if openaiOptions.Metadata != nil { + metadata := make(shared.Metadata) + for k, v := range openaiOptions.Metadata { + if str, ok := v.(string); ok { + metadata[k] = str + } + } + params.Metadata = metadata + } + if openaiOptions.ParallelToolCalls != nil { + params.ParallelToolCalls = param.NewOpt(*openaiOptions.ParallelToolCalls) + } + if openaiOptions.User != nil { + params.User = param.NewOpt(*openaiOptions.User) + } + if openaiOptions.Instructions != nil { + params.Instructions = param.NewOpt(*openaiOptions.Instructions) + } + if openaiOptions.ServiceTier != nil { + params.ServiceTier = responses.ResponseNewParamsServiceTier(*openaiOptions.ServiceTier) + } + if openaiOptions.PromptCacheKey != nil { + params.PromptCacheKey = param.NewOpt(*openaiOptions.PromptCacheKey) + } + if openaiOptions.SafetyIdentifier != nil { + params.SafetyIdentifier = param.NewOpt(*openaiOptions.SafetyIdentifier) + } + if topLogprobs > 0 { + params.TopLogprobs = param.NewOpt(int64(topLogprobs)) + } + + if len(openaiOptions.Include) > 0 { + include = append(include, openaiOptions.Include...) + } + + if modelConfig.isReasoningModel && (openaiOptions.ReasoningEffort != nil || openaiOptions.ReasoningSummary != nil) { + reasoning := shared.ReasoningParam{} + if openaiOptions.ReasoningEffort != nil { + reasoning.Effort = shared.ReasoningEffort(*openaiOptions.ReasoningEffort) + } + if openaiOptions.ReasoningSummary != nil { + reasoning.Summary = shared.ReasoningSummary(*openaiOptions.ReasoningSummary) + } + params.Reasoning = reasoning + } + } + + if modelConfig.requiredAutoTruncation { + params.Truncation = responses.ResponseNewParamsTruncationAuto + } + + if len(include) > 0 { + includeParams := make([]responses.ResponseIncludable, len(include)) + for i, inc := range include { + includeParams[i] = responses.ResponseIncludable(string(inc)) + } + params.Include = includeParams + } + + if modelConfig.isReasoningModel { + if call.Temperature != nil { + params.Temperature = param.Opt[float64]{} + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "temperature", + Details: "temperature is not supported for reasoning models", + }) + } + + if call.TopP != nil { + params.TopP = param.Opt[float64]{} + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "topP", + Details: "topP is not supported for reasoning models", + }) + } + } else { + if openaiOptions != nil { + if openaiOptions.ReasoningEffort != nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "reasoningEffort", + Details: "reasoningEffort is not supported for non-reasoning models", + }) + } + + if openaiOptions.ReasoningSummary != nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "reasoningSummary", + Details: "reasoningSummary is not supported for non-reasoning models", + }) + } + } + } + + if openaiOptions != nil && openaiOptions.ServiceTier != nil { + if *openaiOptions.ServiceTier == ServiceTierFlex && !modelConfig.supportsFlexProcessing { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "serviceTier", + Details: "flex processing is only available for o3, o4-mini, and gpt-5 models", + }) + params.ServiceTier = "" + } + + if *openaiOptions.ServiceTier == ServiceTierPriority && !modelConfig.supportsPriorityProcessing { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedSetting, + Setting: "serviceTier", + Details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported", + }) + params.ServiceTier = "" + } + } + + tools, toolChoice, toolWarnings := toResponsesTools(call.Tools, call.ToolChoice, openaiOptions) + warnings = append(warnings, toolWarnings...) + + if len(tools) > 0 { + params.Tools = tools + params.ToolChoice = toolChoice + } + + return params, warnings +} + +func toResponsesPrompt(prompt ai.Prompt, systemMessageMode string) (responses.ResponseInputParam, []ai.CallWarning) { + var input responses.ResponseInputParam + var warnings []ai.CallWarning + + for _, msg := range prompt { + switch msg.Role { + case ai.MessageRoleSystem: + var systemText string + for _, c := range msg.Content { + if c.GetType() != ai.ContentTypeText { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "system prompt can only have text content", + }) + continue + } + textPart, ok := ai.AsContentType[ai.TextPart](c) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "system prompt text part does not have the right type", + }) + continue + } + if strings.TrimSpace(textPart.Text) != "" { + systemText += textPart.Text + } + } + + if systemText == "" { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "system prompt has no text parts", + }) + continue + } + + switch systemMessageMode { + case "system": + input = append(input, responses.ResponseInputItemParamOfMessage(systemText, responses.EasyInputMessageRoleSystem)) + case "developer": + input = append(input, responses.ResponseInputItemParamOfMessage(systemText, responses.EasyInputMessageRoleDeveloper)) + case "remove": + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "system messages are removed for this model", + }) + } + + case ai.MessageRoleUser: + var contentParts responses.ResponseInputMessageContentListParam + for i, c := range msg.Content { + switch c.GetType() { + case ai.ContentTypeText: + textPart, ok := ai.AsContentType[ai.TextPart](c) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "user message text part does not have the right type", + }) + continue + } + contentParts = append(contentParts, responses.ResponseInputContentUnionParam{ + OfInputText: &responses.ResponseInputTextParam{ + Type: "input_text", + Text: textPart.Text, + }, + }) + + case ai.ContentTypeFile: + filePart, ok := ai.AsContentType[ai.FilePart](c) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "user message file part does not have the right type", + }) + continue + } + + if strings.HasPrefix(filePart.MediaType, "image/") { + base64Encoded := base64.StdEncoding.EncodeToString(filePart.Data) + imageURL := fmt.Sprintf("data:%s;base64,%s", filePart.MediaType, base64Encoded) + contentParts = append(contentParts, responses.ResponseInputContentUnionParam{ + OfInputImage: &responses.ResponseInputImageParam{ + Type: "input_image", + ImageURL: param.NewOpt(imageURL), + }, + }) + } else if filePart.MediaType == "application/pdf" { + base64Encoded := base64.StdEncoding.EncodeToString(filePart.Data) + fileData := fmt.Sprintf("data:application/pdf;base64,%s", base64Encoded) + filename := filePart.Filename + if filename == "" { + filename = fmt.Sprintf("part-%d.pdf", i) + } + contentParts = append(contentParts, responses.ResponseInputContentUnionParam{ + OfInputFile: &responses.ResponseInputFileParam{ + Type: "input_file", + Filename: param.NewOpt(filename), + FileData: param.NewOpt(fileData), + }, + }) + } else { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: fmt.Sprintf("file part media type %s not supported", filePart.MediaType), + }) + } + } + } + + input = append(input, responses.ResponseInputItemParamOfMessage(contentParts, responses.EasyInputMessageRoleUser)) + + case ai.MessageRoleAssistant: + for _, c := range msg.Content { + switch c.GetType() { + case ai.ContentTypeText: + textPart, ok := ai.AsContentType[ai.TextPart](c) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "assistant message text part does not have the right type", + }) + continue + } + input = append(input, responses.ResponseInputItemParamOfMessage(textPart.Text, responses.EasyInputMessageRoleAssistant)) + + case ai.ContentTypeToolCall: + toolCallPart, ok := ai.AsContentType[ai.ToolCallPart](c) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "assistant message tool call part does not have the right type", + }) + continue + } + + if toolCallPart.ProviderExecuted { + continue + } + + inputJSON, err := json.Marshal(toolCallPart.Input) + if err != nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: fmt.Sprintf("failed to marshal tool call input: %v", err), + }) + continue + } + + input = append(input, responses.ResponseInputItemParamOfFunctionCall(string(inputJSON), toolCallPart.ToolCallID, toolCallPart.ToolName)) + case ai.ContentTypeReasoning: + reasoningMetadata := getReasoningMetadata(c.Options()) + if reasoningMetadata == nil || reasoningMetadata.ItemID == "" { + continue + } + if len(reasoningMetadata.Summary) == 0 && reasoningMetadata.EncryptedContent == nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "assistant message reasoning part does is empty", + }) + continue + } + // we want to always send an empty array + summary := []responses.ResponseReasoningItemSummaryParam{} + for _, s := range reasoningMetadata.Summary { + summary = append(summary, responses.ResponseReasoningItemSummaryParam{ + Type: "summary_text", + Text: s, + }) + } + reasoning := &responses.ResponseReasoningItemParam{ + ID: reasoningMetadata.ItemID, + Summary: summary, + } + if reasoningMetadata.EncryptedContent != nil { + reasoning.EncryptedContent = param.NewOpt(*reasoningMetadata.EncryptedContent) + } + input = append(input, responses.ResponseInputItemUnionParam{ + OfReasoning: reasoning, + }) + } + } + + case ai.MessageRoleTool: + for _, c := range msg.Content { + if c.GetType() != ai.ContentTypeToolResult { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "tool message can only have tool result content", + }) + continue + } + + toolResultPart, ok := ai.AsContentType[ai.ToolResultPart](c) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "tool message result part does not have the right type", + }) + continue + } + + var outputStr string + switch toolResultPart.Output.GetType() { + case ai.ToolResultContentTypeText: + output, ok := ai.AsToolResultOutputType[ai.ToolResultOutputContentText](toolResultPart.Output) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "tool result output does not have the right type", + }) + continue + } + outputStr = output.Text + case ai.ToolResultContentTypeError: + output, ok := ai.AsToolResultOutputType[ai.ToolResultOutputContentError](toolResultPart.Output) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "tool result output does not have the right type", + }) + continue + } + outputStr = output.Error.Error() + case ai.ToolResultContentTypeMedia: + output, ok := ai.AsToolResultOutputType[ai.ToolResultOutputContentMedia](toolResultPart.Output) + if !ok { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: "tool result output does not have the right type", + }) + continue + } + // For media content, encode as JSON with data and media type + mediaContent := map[string]string{ + "data": output.Data, + "media_type": output.MediaType, + } + jsonBytes, err := json.Marshal(mediaContent) + if err != nil { + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeOther, + Message: fmt.Sprintf("failed to marshal tool result: %v", err), + }) + continue + } + outputStr = string(jsonBytes) + } + + input = append(input, responses.ResponseInputItemParamOfFunctionCallOutput(toolResultPart.ToolCallID, outputStr)) + } + } + } + + return input, warnings +} + +func toResponsesTools(tools []ai.Tool, toolChoice *ai.ToolChoice, options *ResponsesProviderOptions) ([]responses.ToolUnionParam, responses.ResponseNewParamsToolChoiceUnion, []ai.CallWarning) { + warnings := make([]ai.CallWarning, 0) + var openaiTools []responses.ToolUnionParam + + if len(tools) == 0 { + return nil, responses.ResponseNewParamsToolChoiceUnion{}, nil + } + + strictJSONSchema := false + if options != nil && options.StrictJSONSchema != nil { + strictJSONSchema = *options.StrictJSONSchema + } + + for _, tool := range tools { + if tool.GetType() == ai.ToolTypeFunction { + ft, ok := tool.(ai.FunctionTool) + if !ok { + continue + } + openaiTools = append(openaiTools, responses.ToolUnionParam{ + OfFunction: &responses.FunctionToolParam{ + Name: ft.Name, + Description: param.NewOpt(ft.Description), + Parameters: ft.InputSchema, + Strict: param.NewOpt(strictJSONSchema), + Type: "function", + }, + }) + continue + } + + warnings = append(warnings, ai.CallWarning{ + Type: ai.CallWarningTypeUnsupportedTool, + Tool: tool, + Message: "tool is not supported", + }) + } + + if toolChoice == nil { + return openaiTools, responses.ResponseNewParamsToolChoiceUnion{}, warnings + } + + var openaiToolChoice responses.ResponseNewParamsToolChoiceUnion + + switch *toolChoice { + case ai.ToolChoiceAuto: + openaiToolChoice = responses.ResponseNewParamsToolChoiceUnion{ + OfToolChoiceMode: param.NewOpt(responses.ToolChoiceOptionsAuto), + } + case ai.ToolChoiceNone: + openaiToolChoice = responses.ResponseNewParamsToolChoiceUnion{ + OfToolChoiceMode: param.NewOpt(responses.ToolChoiceOptionsNone), + } + case ai.ToolChoiceRequired: + openaiToolChoice = responses.ResponseNewParamsToolChoiceUnion{ + OfToolChoiceMode: param.NewOpt(responses.ToolChoiceOptionsRequired), + } + default: + openaiToolChoice = responses.ResponseNewParamsToolChoiceUnion{ + OfFunctionTool: &responses.ToolChoiceFunctionParam{ + Type: "function", + Name: string(*toolChoice), + }, + } + } + + return openaiTools, openaiToolChoice, warnings +} + +func (o responsesLanguageModel) handleError(err error) error { + var apiErr *openai.Error + if errors.As(err, &apiErr) { + requestDump := apiErr.DumpRequest(true) + responseDump := apiErr.DumpResponse(true) + headers := map[string]string{} + for k, h := range apiErr.Response.Header { + v := h[len(h)-1] + headers[strings.ToLower(k)] = v + } + return ai.NewAPICallError( + apiErr.Message, + apiErr.Request.URL.String(), + string(requestDump), + apiErr.StatusCode, + headers, + string(responseDump), + apiErr, + false, + ) + } + return err +} + +func (o responsesLanguageModel) Generate(ctx context.Context, call ai.Call) (*ai.Response, error) { + params, warnings := o.prepareParams(call) + response, err := o.client.Responses.New(ctx, *params) + if err != nil { + return nil, o.handleError(err) + } + + if response.Error.Message != "" { + return nil, o.handleError(fmt.Errorf("response error: %s (code: %s)", response.Error.Message, response.Error.Code)) + } + + var content []ai.Content + hasFunctionCall := false + + for _, outputItem := range response.Output { + switch outputItem.Type { + case "message": + for _, contentPart := range outputItem.Content { + if contentPart.Type == "output_text" { + content = append(content, ai.TextContent{ + Text: contentPart.Text, + }) + + for _, annotation := range contentPart.Annotations { + switch annotation.Type { + case "url_citation": + content = append(content, ai.SourceContent{ + SourceType: ai.SourceTypeURL, + ID: uuid.NewString(), + URL: annotation.URL, + Title: annotation.Title, + }) + case "file_citation": + title := "Document" + if annotation.Filename != "" { + title = annotation.Filename + } + filename := annotation.Filename + if filename == "" { + filename = annotation.FileID + } + content = append(content, ai.SourceContent{ + SourceType: ai.SourceTypeDocument, + ID: uuid.NewString(), + MediaType: "text/plain", + Title: title, + Filename: filename, + }) + } + } + } + } + + case "function_call": + hasFunctionCall = true + content = append(content, ai.ToolCallContent{ + ProviderExecuted: false, + ToolCallID: outputItem.CallID, + ToolName: outputItem.Name, + Input: outputItem.Arguments, + }) + + case "reasoning": + metadata := &ResponsesReasoningMetadata{ + ItemID: outputItem.ID, + } + if outputItem.EncryptedContent != "" { + metadata.EncryptedContent = &outputItem.EncryptedContent + } + + if len(outputItem.Summary) == 0 && metadata.EncryptedContent == nil { + continue + } + + // When there are no summary parts, add an empty reasoning part + summaries := outputItem.Summary + if len(summaries) == 0 { + summaries = []responses.ResponseReasoningItemSummary{{Type: "summary_text", Text: ""}} + } + + var summaryParts []string + + for _, s := range summaries { + metadata.Summary = append(metadata.Summary, s.Text) + summaryParts = append(summaryParts, s.Text) + } + + content = append(content, ai.ReasoningContent{ + Text: strings.Join(summaryParts, "\n"), + ProviderMetadata: ai.ProviderMetadata{ + Name: metadata, + }, + }) + } + } + + usage := ai.Usage{ + InputTokens: response.Usage.InputTokens, + OutputTokens: response.Usage.OutputTokens, + TotalTokens: response.Usage.InputTokens + response.Usage.OutputTokens, + } + + if response.Usage.OutputTokensDetails.ReasoningTokens != 0 { + usage.ReasoningTokens = response.Usage.OutputTokensDetails.ReasoningTokens + } + if response.Usage.InputTokensDetails.CachedTokens != 0 { + usage.CacheReadTokens = response.Usage.InputTokensDetails.CachedTokens + } + + finishReason := mapResponsesFinishReason(response.IncompleteDetails.Reason, hasFunctionCall) + + return &ai.Response{ + Content: content, + Usage: usage, + FinishReason: finishReason, + ProviderMetadata: ai.ProviderMetadata{}, + Warnings: warnings, + }, nil +} + +func mapResponsesFinishReason(reason string, hasFunctionCall bool) ai.FinishReason { + if hasFunctionCall { + return ai.FinishReasonToolCalls + } + + switch reason { + case "": + return ai.FinishReasonStop + case "max_tokens", "max_output_tokens": + return ai.FinishReasonLength + case "content_filter": + return ai.FinishReasonContentFilter + default: + return ai.FinishReasonOther + } +} + +func (o responsesLanguageModel) Stream(ctx context.Context, call ai.Call) (ai.StreamResponse, error) { + params, warnings := o.prepareParams(call) + + stream := o.client.Responses.NewStreaming(ctx, *params) + + finishReason := ai.FinishReasonUnknown + var usage ai.Usage + ongoingToolCalls := make(map[int64]*ongoingToolCall) + hasFunctionCall := false + activeReasoning := make(map[string]*reasoningState) + + return func(yield func(ai.StreamPart) bool) { + if len(warnings) > 0 { + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeWarnings, + Warnings: warnings, + }) { + return + } + } + + for stream.Next() { + event := stream.Current() + + switch event.Type { + case "response.created": + _ = event.AsResponseCreated() + + case "response.output_item.added": + added := event.AsResponseOutputItemAdded() + switch added.Item.Type { + case "function_call": + ongoingToolCalls[added.OutputIndex] = &ongoingToolCall{ + toolName: added.Item.Name, + toolCallID: added.Item.CallID, + } + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeToolInputStart, + ID: added.Item.CallID, + ToolCallName: added.Item.Name, + }) { + return + } + + case "message": + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeTextStart, + ID: added.Item.ID, + }) { + return + } + + case "reasoning": + metadata := &ResponsesReasoningMetadata{ + ItemID: added.Item.ID, + Summary: []string{}, + } + if added.Item.EncryptedContent != "" { + metadata.EncryptedContent = &added.Item.EncryptedContent + } + + activeReasoning[added.Item.ID] = &reasoningState{ + metadata: metadata, + } + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeReasoningStart, + ID: added.Item.ID, + ProviderMetadata: ai.ProviderMetadata{ + Name: metadata, + }, + }) { + return + } + } + + case "response.output_item.done": + done := event.AsResponseOutputItemDone() + switch done.Item.Type { + case "function_call": + tc := ongoingToolCalls[done.OutputIndex] + if tc != nil { + delete(ongoingToolCalls, done.OutputIndex) + hasFunctionCall = true + + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeToolInputEnd, + ID: done.Item.CallID, + }) { + return + } + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeToolCall, + ID: done.Item.CallID, + ToolCallName: done.Item.Name, + ToolCallInput: done.Item.Arguments, + }) { + return + } + } + + case "message": + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeTextEnd, + ID: done.Item.ID, + }) { + return + } + + case "reasoning": + state := activeReasoning[done.Item.ID] + if state != nil { + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeReasoningEnd, + ID: done.Item.ID, + ProviderMetadata: ai.ProviderMetadata{ + Name: state.metadata, + }, + }) { + return + } + delete(activeReasoning, done.Item.ID) + } + } + + case "response.function_call_arguments.delta": + delta := event.AsResponseFunctionCallArgumentsDelta() + tc := ongoingToolCalls[delta.OutputIndex] + if tc != nil { + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeToolInputDelta, + ID: tc.toolCallID, + Delta: delta.Delta, + }) { + return + } + } + + case "response.output_text.delta": + textDelta := event.AsResponseOutputTextDelta() + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeTextDelta, + ID: textDelta.ItemID, + Delta: textDelta.Delta, + }) { + return + } + + case "response.reasoning_summary_part.added": + added := event.AsResponseReasoningSummaryPartAdded() + state := activeReasoning[added.ItemID] + if state != nil { + state.metadata.Summary = append(state.metadata.Summary, "") + activeReasoning[added.ItemID] = state + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeReasoningDelta, + ID: added.ItemID, + Delta: "\n", + ProviderMetadata: ai.ProviderMetadata{ + Name: state.metadata, + }, + }) { + return + } + } + + case "response.reasoning_summary_text.delta": + textDelta := event.AsResponseReasoningSummaryTextDelta() + state := activeReasoning[textDelta.ItemID] + if state != nil { + if len(state.metadata.Summary)-1 >= int(textDelta.SummaryIndex) { + state.metadata.Summary[textDelta.SummaryIndex] += textDelta.Delta + } + activeReasoning[textDelta.ItemID] = state + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeReasoningDelta, + ID: textDelta.ItemID, + Delta: textDelta.Delta, + ProviderMetadata: ai.ProviderMetadata{ + Name: state.metadata, + }, + }) { + return + } + } + + case "response.completed", "response.incomplete": + completed := event.AsResponseCompleted() + finishReason = mapResponsesFinishReason(completed.Response.IncompleteDetails.Reason, hasFunctionCall) + usage = ai.Usage{ + InputTokens: completed.Response.Usage.InputTokens, + OutputTokens: completed.Response.Usage.OutputTokens, + TotalTokens: completed.Response.Usage.InputTokens + completed.Response.Usage.OutputTokens, + } + if completed.Response.Usage.OutputTokensDetails.ReasoningTokens != 0 { + usage.ReasoningTokens = completed.Response.Usage.OutputTokensDetails.ReasoningTokens + } + if completed.Response.Usage.InputTokensDetails.CachedTokens != 0 { + usage.CacheReadTokens = completed.Response.Usage.InputTokensDetails.CachedTokens + } + + case "error": + errorEvent := event.AsError() + if !yield(ai.StreamPart{ + Type: ai.StreamPartTypeError, + Error: fmt.Errorf("response error: %s (code: %s)", errorEvent.Message, errorEvent.Code), + }) { + return + } + return + } + } + + err := stream.Err() + if err != nil { + yield(ai.StreamPart{ + Type: ai.StreamPartTypeError, + Error: o.handleError(err), + }) + return + } + + yield(ai.StreamPart{ + Type: ai.StreamPartTypeFinish, + Usage: usage, + FinishReason: finishReason, + }) + }, nil +} + +func getReasoningMetadata(providerOptions ai.ProviderOptions) *ResponsesReasoningMetadata { + if openaiResponsesOptions, ok := providerOptions[Name]; ok { + if reasoning, ok := openaiResponsesOptions.(*ResponsesReasoningMetadata); ok { + return reasoning + } + } + return nil +} + +type ongoingToolCall struct { + toolName string + toolCallID string +} + +type reasoningState struct { + metadata *ResponsesReasoningMetadata +} diff --git a/openai/responses_options.go b/openai/responses_options.go new file mode 100644 index 0000000000000000000000000000000000000000..1ff353bea2290b3d2455cf5a936b25a5be5900ac --- /dev/null +++ b/openai/responses_options.go @@ -0,0 +1,128 @@ +package openai + +import ( + "slices" + + "github.com/charmbracelet/fantasy/ai" +) + +type ResponsesReasoningMetadata struct { + ItemID string `json:"item_id"` + EncryptedContent *string `json:"encrypted_content"` + Summary []string `json:"summary"` +} + +func (*ResponsesReasoningMetadata) Options() {} + +type IncludeType string + +const ( + IncludeReasoningEncryptedContent IncludeType = "reasoning.encrypted_content" + IncludeFileSearchCallResults IncludeType = "file_search_call.results" + IncludeMessageOutputTextLogprobs IncludeType = "message.output_text.logprobs" +) + +type ServiceTier string + +const ( + ServiceTierAuto ServiceTier = "auto" + ServiceTierFlex ServiceTier = "flex" + ServiceTierPriority ServiceTier = "priority" +) + +type TextVerbosity string + +const ( + TextVerbosityLow TextVerbosity = "low" + TextVerbosityMedium TextVerbosity = "medium" + TextVerbosityHigh TextVerbosity = "high" +) + +type ResponsesProviderOptions struct { + Include []IncludeType `json:"include"` + Instructions *string `json:"instructions"` + Logprobs any `json:"logprobs"` + MaxToolCalls *int64 `json:"max_tool_calls"` + Metadata map[string]any `json:"metadata"` + ParallelToolCalls *bool `json:"parallel_tool_calls"` + PromptCacheKey *string `json:"prompt_cache_key"` + ReasoningEffort *ReasoningEffort `json:"reasoning_effort"` + ReasoningSummary *string `json:"reasoning_summary"` + SafetyIdentifier *string `json:"safety_identifier"` + ServiceTier *ServiceTier `json:"service_tier"` + StrictJSONSchema *bool `json:"strict_json_schema"` + TextVerbosity *TextVerbosity `json:"text_verbosity"` + User *string `json:"user"` +} + +var responsesReasoningModelIds = []string{ + "o1", + "o1-2024-12-17", + "o3-mini", + "o3-mini-2025-01-31", + "o3", + "o3-2025-04-16", + "o4-mini", + "o4-mini-2025-04-16", + "codex-mini-latest", + "gpt-5", + "gpt-5-2025-08-07", + "gpt-5-mini", + "gpt-5-mini-2025-08-07", + "gpt-5-nano", + "gpt-5-nano-2025-08-07", + "gpt-5-codex", +} + +var responsesModelIds = append([]string{ + "gpt-4.1", + "gpt-4.1-2025-04-14", + "gpt-4.1-mini", + "gpt-4.1-mini-2025-04-14", + "gpt-4.1-nano", + "gpt-4.1-nano-2025-04-14", + "gpt-4o", + "gpt-4o-2024-05-13", + "gpt-4o-2024-08-06", + "gpt-4o-2024-11-20", + "gpt-4o-mini", + "gpt-4o-mini-2024-07-18", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-turbo-preview", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4", + "gpt-4-0613", + "gpt-4.5-preview", + "gpt-4.5-preview-2025-02-27", + "gpt-3.5-turbo-0125", + "gpt-3.5-turbo", + "gpt-3.5-turbo-1106", + "chatgpt-4o-latest", + "gpt-5-chat-latest", +}, responsesReasoningModelIds...) + +func (*ResponsesProviderOptions) Options() {} + +func NewResponsesProviderOptions(opts *ResponsesProviderOptions) ai.ProviderOptions { + return ai.ProviderOptions{ + Name: opts, + } +} + +func ParseResponsesOptions(data map[string]any) (*ResponsesProviderOptions, error) { + var options ResponsesProviderOptions + if err := ai.ParseOptions(data, &options); err != nil { + return nil, err + } + return &options, nil +} + +func IsResponsesModel(modelID string) bool { + return slices.Contains(responsesModelIds, modelID) +} + +func IsResponsesReasoningModel(modelID string) bool { + return slices.Contains(responsesReasoningModelIds, modelID) +} diff --git a/providertests/common_test.go b/providertests/common_test.go index 23323656b06d5bb5d2515b6ed3fff52accd47855..20720ca9c2c6f20793dafbfcecc48652e94f4b7a 100644 --- a/providertests/common_test.go +++ b/providertests/common_test.go @@ -65,7 +65,7 @@ func testSimple(t *testing.T, pair builderPair) { result, err := agent.Generate(t.Context(), ai.AgentCall{ Prompt: "Say hi in Portuguese", ProviderOptions: pair.providerOptions, - MaxOutputTokens: ai.IntOption(4000), + MaxOutputTokens: ai.Opt(int64(4000)), }) require.NoError(t, err, "failed to generate") checkResult(t, result) @@ -83,7 +83,7 @@ func testSimple(t *testing.T, pair builderPair) { result, err := agent.Stream(t.Context(), ai.AgentStreamCall{ Prompt: "Say hi in Portuguese", ProviderOptions: pair.providerOptions, - MaxOutputTokens: ai.IntOption(4000), + MaxOutputTokens: ai.Opt(int64(4000)), }) require.NoError(t, err, "failed to generate") checkResult(t, result) @@ -137,7 +137,7 @@ func testTool(t *testing.T, pair builderPair) { result, err := agent.Generate(t.Context(), ai.AgentCall{ Prompt: "What's the weather in Florence,Italy?", ProviderOptions: pair.providerOptions, - MaxOutputTokens: ai.IntOption(4000), + MaxOutputTokens: ai.Opt(int64(4000)), }) require.NoError(t, err, "failed to generate") checkResult(t, result) @@ -156,7 +156,7 @@ func testTool(t *testing.T, pair builderPair) { result, err := agent.Stream(t.Context(), ai.AgentStreamCall{ Prompt: "What's the weather in Florence,Italy?", ProviderOptions: pair.providerOptions, - MaxOutputTokens: ai.IntOption(4000), + MaxOutputTokens: ai.Opt(int64(4000)), }) require.NoError(t, err, "failed to generate") checkResult(t, result) @@ -174,6 +174,9 @@ func testMultiTool(t *testing.T, pair builderPair) { if strings.Contains(pair.name, "bedrock") && strings.Contains(pair.name, "claude") { t.Skip("skipping multi-tool tests for bedrock claude as it does not support parallel multi-tool calls") } + if strings.Contains(pair.name, "openai") && strings.Contains(pair.name, "o4-mini") { + t.Skip("skipping multi-tool tests for openai o4-mini it for some reason is not doing parallel tool calls even if asked") + } type CalculatorInput struct { A int `json:"a" description:"first number"` @@ -230,7 +233,7 @@ func testMultiTool(t *testing.T, pair builderPair) { result, err := agent.Generate(t.Context(), ai.AgentCall{ Prompt: "Add and multiply the number 2 and 3", ProviderOptions: pair.providerOptions, - MaxOutputTokens: ai.IntOption(4000), + MaxOutputTokens: ai.Opt(int64(4000)), }) require.NoError(t, err, "failed to generate") checkResult(t, result) @@ -250,7 +253,7 @@ func testMultiTool(t *testing.T, pair builderPair) { result, err := agent.Stream(t.Context(), ai.AgentStreamCall{ Prompt: "Add and multiply the number 2 and 3", ProviderOptions: pair.providerOptions, - MaxOutputTokens: ai.IntOption(4000), + MaxOutputTokens: ai.Opt(int64(4000)), }) require.NoError(t, err, "failed to generate") checkResult(t, result) diff --git a/providertests/google_test.go b/providertests/google_test.go index 36ab7ab94a0e633bfe179ae485fad1f25de59c59..632e6192b427265102ce946b45edd3ed97290235 100644 --- a/providertests/google_test.go +++ b/providertests/google_test.go @@ -38,8 +38,8 @@ func TestGoogleThinking(t *testing.T) { opts := ai.ProviderOptions{ google.Name: &google.ProviderOptions{ ThinkingConfig: &google.ThinkingConfig{ - ThinkingBudget: ai.IntOption(100), - IncludeThoughts: ai.BoolOption(true), + ThinkingBudget: ai.Opt(int64(100)), + IncludeThoughts: ai.Opt(true), }, }, } diff --git a/providertests/openai_responses_test.go b/providertests/openai_responses_test.go new file mode 100644 index 0000000000000000000000000000000000000000..b925c01a01582c3c7ea5dbc4320a89e7d97bf5bb --- /dev/null +++ b/providertests/openai_responses_test.go @@ -0,0 +1,85 @@ +package providertests + +import ( + "net/http" + "os" + "testing" + + "github.com/charmbracelet/fantasy/ai" + "github.com/charmbracelet/fantasy/openai" + "github.com/stretchr/testify/require" + "gopkg.in/dnaeon/go-vcr.v4/pkg/recorder" +) + +func TestOpenAIResponsesCommon(t *testing.T) { + var pairs []builderPair + for _, m := range openaiTestModels { + pairs = append(pairs, builderPair{m.name, openAIReasoningBuilder(m.model), nil}) + } + testCommon(t, pairs) +} + +func openAIReasoningBuilder(model string) builderFunc { + return func(r *recorder.Recorder) (ai.LanguageModel, error) { + provider := openai.New( + openai.WithAPIKey(os.Getenv("FANTASY_OPENAI_API_KEY")), + openai.WithHTTPClient(&http.Client{Transport: r}), + openai.WithUseResponsesAPI(), + ) + return provider.LanguageModel(model) + } +} + +func TestOpenAIResponsesWithSummaryThinking(t *testing.T) { + opts := ai.ProviderOptions{ + openai.Name: &openai.ResponsesProviderOptions{ + Include: []openai.IncludeType{ + openai.IncludeReasoningEncryptedContent, + }, + ReasoningEffort: openai.ReasoningEffortOption(openai.ReasoningEffortHigh), + ReasoningSummary: ai.Opt("auto"), + }, + } + var pairs []builderPair + for _, m := range openaiTestModels { + if !m.reasoning { + continue + } + pairs = append(pairs, builderPair{m.name, openAIReasoningBuilder(m.model), opts}) + } + testThinking(t, pairs, testOpenAIResponsesThinkingWithSummaryThinking) +} + +func testOpenAIResponsesThinkingWithSummaryThinking(t *testing.T, result *ai.AgentResult) { + reasoningContentCount := 0 + encryptedData := 0 + // Test if we got the signature + for _, step := range result.Steps { + for _, msg := range step.Messages { + for _, content := range msg.Content { + if content.GetType() == ai.ContentTypeReasoning { + reasoningContentCount += 1 + reasoningContent, ok := ai.AsContentType[ai.ReasoningPart](content) + if !ok { + continue + } + if len(reasoningContent.ProviderOptions) == 0 { + continue + } + + openaiReasoningMetadata, ok := reasoningContent.ProviderOptions[openai.Name] + if !ok { + continue + } + if typed, ok := openaiReasoningMetadata.(*openai.ResponsesReasoningMetadata); ok { + require.NotEmpty(t, typed.EncryptedContent) + encryptedData += 1 + } + } + } + } + } + require.Greater(t, reasoningContentCount, 0) + require.Greater(t, encryptedData, 0) + require.Equal(t, reasoningContentCount, encryptedData) +} diff --git a/providertests/openai_test.go b/providertests/openai_test.go index 52067860de60478a8b708bf64cf42d1c0417ee61..b984c4970aebba6723ab431ae09f2912d7c1280b 100644 --- a/providertests/openai_test.go +++ b/providertests/openai_test.go @@ -10,34 +10,27 @@ import ( "gopkg.in/dnaeon/go-vcr.v4/pkg/recorder" ) -func TestOpenAICommon(t *testing.T) { - testCommon(t, []builderPair{ - {"gpt-4o", builderOpenaiGpt4o, nil}, - {"gpt-4o-mini", builderOpenaiGpt4oMini, nil}, - {"gpt-5", builderOpenaiGpt5, nil}, - }) -} - -func builderOpenaiGpt4o(r *recorder.Recorder) (ai.LanguageModel, error) { - provider := openai.New( - openai.WithAPIKey(os.Getenv("FANTASY_OPENAI_API_KEY")), - openai.WithHTTPClient(&http.Client{Transport: r}), - ) - return provider.LanguageModel("gpt-4o") +var openaiTestModels = []testModel{ + {"openai-gpt-4o", "gpt-4o", false}, + {"openai-gpt-4o-mini", "gpt-4o-mini", false}, + {"openai-gpt-5", "gpt-5", true}, + {"openai-o4-mini", "o4-mini", true}, } -func builderOpenaiGpt4oMini(r *recorder.Recorder) (ai.LanguageModel, error) { - provider := openai.New( - openai.WithAPIKey(os.Getenv("FANTASY_OPENAI_API_KEY")), - openai.WithHTTPClient(&http.Client{Transport: r}), - ) - return provider.LanguageModel("gpt-4o-mini") +func TestOpenAICommon(t *testing.T) { + var pairs []builderPair + for _, m := range openaiTestModels { + pairs = append(pairs, builderPair{m.name, openAIBuilder(m.model), nil}) + } + testCommon(t, pairs) } -func builderOpenaiGpt5(r *recorder.Recorder) (ai.LanguageModel, error) { - provider := openai.New( - openai.WithAPIKey(os.Getenv("FANTASY_OPENAI_API_KEY")), - openai.WithHTTPClient(&http.Client{Transport: r}), - ) - return provider.LanguageModel("gpt-5") +func openAIBuilder(model string) builderFunc { + return func(r *recorder.Recorder) (ai.LanguageModel, error) { + provider := openai.New( + openai.WithAPIKey(os.Getenv("FANTASY_OPENAI_API_KEY")), + openai.WithHTTPClient(&http.Client{Transport: r}), + ) + return provider.LanguageModel(model) + } } diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/simple_streaming.yaml b/providertests/testdata/TestOpenAICommon/gpt-4o-mini/simple_streaming.yaml deleted file mode 100644 index 7362652c91881f7c42f5620619e8acba8617a251..0000000000000000000000000000000000000000 --- a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/simple_streaming.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -version: 2 -interactions: -- id: 0 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 215 - host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"gpt-4o-mini","max_tokens":4000,"stream_options":{"include_usage":true},"stream":true}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CK0XEa10Hau7DKHUO2epNihUILBAk","object":"chat.completion.chunk","created":1758884652,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mTQZfrLcd"} - - data: {"id":"chatcmpl-CK0XEa10Hau7DKHUO2epNihUILBAk","object":"chat.completion.chunk","created":1758884652,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"Olá"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"kFGU8bXe"} - - data: {"id":"chatcmpl-CK0XEa10Hau7DKHUO2epNihUILBAk","object":"chat.completion.chunk","created":1758884652,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6WTCbco7Wv"} - - data: {"id":"chatcmpl-CK0XEa10Hau7DKHUO2epNihUILBAk","object":"chat.completion.chunk","created":1758884652,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"pJDRU"} - - data: {"id":"chatcmpl-CK0XEa10Hau7DKHUO2epNihUILBAk","object":"chat.completion.chunk","created":1758884652,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":20,"completion_tokens":2,"total_tokens":22,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"bo3PrVK8BB3"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 709.002458ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o/multi_tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/gpt-4o/multi_tool_streaming.yaml deleted file mode 100644 index 13632527e7c7a82b6c700a5a09979313a393406f..0000000000000000000000000000000000000000 --- a/providertests/testdata/TestOpenAICommon/gpt-4o/multi_tool_streaming.yaml +++ /dev/null @@ -1,151 +0,0 @@ ---- -version: 2 -interactions: -- id: 0 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 848 - 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":"gpt-4o","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"}],"stream":true}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}],"obfuscation":"qnpNwYTQFp4"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_MBriMTSHw1UFtzQAduPP0Mkj","type":"function","function":{"name":"add","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"73"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"t"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"CrvdpBgVuwx3Xz"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"2INCr"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_7sVj20JsN3VYpXv8pZuLDruY","type":"function","function":{"name":"multiply","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"4mr5kRbqRoraJ"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"0"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"fxhC40qt4dPvrJ"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"xjieU"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"fYPH"} - - data: {"id":"chatcmpl-CK0XBiHwsrgUyuIOsQJ7L2KjpG0pb","object":"chat.completion.chunk","created":1758884649,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":106,"completion_tokens":50,"total_tokens":156,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"xSLkv2SDLIEKV"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 948.292334ms -- id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 1279 - 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":"call_MBriMTSHw1UFtzQAduPP0Mkj","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_7sVj20JsN3VYpXv8pZuLDruY","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_MBriMTSHw1UFtzQAduPP0Mkj","role":"tool"},{"content":"6","tool_call_id":"call_7sVj20JsN3VYpXv8pZuLDruY","role":"tool"}],"model":"gpt-4o","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"}],"stream":true}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AGSy93IAj0a02O"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YafdRYS6Y8xr5"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" result"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DfNQXI6we"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tjH8MrKJEvpSy"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" adding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6LElZJQti"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GXSHAnQ8c1MXZJO"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jGiuoFFj3Ql1qxj"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"vWIQaxcCC34T"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tQZ1UcjpXfJRf5y"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mKOnHcppv3V8BJw"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UXUFUQRNGDTnN"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Isx3r2cP6TT2VDr"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"5"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dbo2v9t3zNKRHep"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AkuDqKy9dcmYhVx"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"lrljFna0k8gx"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"l6VR83Jozfpv"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" result"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XuxWbaPzE"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KsWb9aMhgBdLH"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" multiplying"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gxEq"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DXVsBeOAYIUn8Mi"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qXW42N6A9MpXRyw"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QsYrBzSTafoA"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XW40Jw1wdM27Q3x"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Z9abDXTP8bgDoMZ"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"uazMqBAe00fKm"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Zr7IF7wIzJEIJy4"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"6"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WfvcRuzh2fbox54"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"evqJsK2KqP7rqLN"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"6omC0sTA4o"} - - data: {"id":"chatcmpl-CK0XC8ADYjWGumKgPucuZfGDaWNiZ","object":"chat.completion.chunk","created":1758884650,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":172,"completion_tokens":28,"total_tokens":200,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"yPHbD0dFcRX5l"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 932.741083ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o/tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/gpt-4o/tool_streaming.yaml deleted file mode 100644 index 6f42652eb1da2bafdc189bd2b52c4bf2ffb083c2..0000000000000000000000000000000000000000 --- a/providertests/testdata/TestOpenAICommon/gpt-4o/tool_streaming.yaml +++ /dev/null @@ -1,117 +0,0 @@ ---- -version: 2 -interactions: -- id: 0 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 502 - host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-4o","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"}],"stream":true}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_9ljXFCM8IxQxKHyEsUQVijHp","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UAGY3b30VnPgY"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"OgK"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Q3DcqpRbSwpb3R"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"p"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AR"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MA"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ARQ9S"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gGD"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"U9KT"} - - data: {"id":"chatcmpl-CK0X7SLV8PNKV91i8JXuZrQ5mP03w","object":"chat.completion.chunk","created":1758884645,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":61,"completion_tokens":16,"total_tokens":77,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"NJ7nx5YCufYwsl5"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 791.905875ms -- id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 754 - host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_9ljXFCM8IxQxKHyEsUQVijHp","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_9ljXFCM8IxQxKHyEsUQVijHp","role":"tool"}],"model":"gpt-4o","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"}],"stream":true}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ot2BLWJZM4mQCF"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mRJkBDkrUI2ci"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"1L6dJjW9"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" temperature"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"paCu"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jr3Q8VcSKhEoL"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fW43Xry"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wrIYFJtAid7igZY"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ggB92W1IhU"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"oz7GPYuLjC8YF"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BkYtBy1jdlqB4yU"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"40"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2yi0arRy2iRUkk"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"°C"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"oyLNpZLu7c19qd"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"RjlnTLetR4N1OZC"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"GEcdbaZ1IU"} - - data: {"id":"chatcmpl-CK0X8AngXdsZNpiHAr4nAL68UhG4O","object":"chat.completion.chunk","created":1758884646,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":86,"completion_tokens":13,"total_tokens":99,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"W54neIykgflNQwN"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 733.489417ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-5/tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/gpt-5/tool_streaming.yaml deleted file mode 100644 index 1606386283fc708f69cf9e97aea370a0142c99f5..0000000000000000000000000000000000000000 --- a/providertests/testdata/TestOpenAICommon/gpt-5/tool_streaming.yaml +++ /dev/null @@ -1,143 +0,0 @@ ---- -version: 2 -interactions: -- id: 0 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 512 - host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-5","max_completion_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"}],"stream":true}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_R6xW0RTSZLIX6N8k9assZBi6","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"gD6Jtbj4f"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Mp2kWW2NQYHWbWR"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"finish_reason":null}],"usage":null,"obfuscation":"eYcxIjga47"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"EDTLdzBMQA4Fu"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"finish_reason":null}],"usage":null,"obfuscation":"nt5fI6wBEoQ7RL"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ALfx9Lp79jtGNE"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"J"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KxzKpGDg69qm"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9BLLcr0UYPn5fcR"} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CK0XhIKDGZ1uM1c703bF4VNG9Iwdr","object":"chat.completion.chunk","created":1758884681,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":145,"completion_tokens":89,"total_tokens":234,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"aNuoJMq8"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 2.150256292s -- id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 764 - host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_R6xW0RTSZLIX6N8k9assZBi6","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_R6xW0RTSZLIX6N8k9assZBi6","role":"tool"}],"model":"gpt-5","max_completion_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"}],"stream":true}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"1QwDd8Ke63"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"It"},"finish_reason":null}],"usage":null,"obfuscation":"0yJ0HwOjeE"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"’s"},"finish_reason":null}],"usage":null,"obfuscation":"VNddxQuik0"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" currently"},"finish_reason":null}],"usage":null,"obfuscation":"G8"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" about"},"finish_reason":null}],"usage":null,"obfuscation":"3zOerF"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"Rn08jDfgDZ6"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"40"},"finish_reason":null}],"usage":null,"obfuscation":"SAq4MKX1tU"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"°C"},"finish_reason":null}],"usage":null,"obfuscation":"hjG5RtTJEr"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" in"},"finish_reason":null}],"usage":null,"obfuscation":"CMAmDZpK1"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Florence"},"finish_reason":null}],"usage":null,"obfuscation":"Qe2"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"84OPfcO8SSl"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Italy"},"finish_reason":null}],"usage":null,"obfuscation":"MwI72m"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"7evHde6w0ci"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Would"},"finish_reason":null}],"usage":null,"obfuscation":"H4cgYK"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" you"},"finish_reason":null}],"usage":null,"obfuscation":"K1Z94VsI"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" like"},"finish_reason":null}],"usage":null,"obfuscation":"s2z6de3"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" the"},"finish_reason":null}],"usage":null,"obfuscation":"zkMR0F71"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" hourly"},"finish_reason":null}],"usage":null,"obfuscation":"KjnAr"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" or"},"finish_reason":null}],"usage":null,"obfuscation":"X99Z6vjPI"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"dQe993jbPM1"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"7"},"finish_reason":null}],"usage":null,"obfuscation":"BYBiweUr5ri"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-day"},"finish_reason":null}],"usage":null,"obfuscation":"yb8PgNjS"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" forecast"},"finish_reason":null}],"usage":null,"obfuscation":"Mo4"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" as"},"finish_reason":null}],"usage":null,"obfuscation":"tEIYgn6d5"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" well"},"finish_reason":null}],"usage":null,"obfuscation":"7HlqGyB"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"?"},"finish_reason":null}],"usage":null,"obfuscation":"EfVBOumj9S1"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"3c3k2U"} - - data: {"id":"chatcmpl-CK0XjsfRcuJKkovHfxUB7XypOCIdK","object":"chat.completion.chunk","created":1758884683,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":176,"completion_tokens":162,"total_tokens":338,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"QKSbao"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 3.872249167s diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/multi_tool.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/multi_tool.yaml similarity index 86% rename from providertests/testdata/TestOpenAICommon/gpt-4o-mini/multi_tool.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/multi_tool.yaml index 221b15de77e6706e42e8108bf6d620839b28a069..11fb20471927adaeac94b5c7469c133cab60decf 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/multi_tool.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/multi_tool.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XJEkzXehFvxL0bZtmn3X8bgEgl", + "id": "chatcmpl-CRdyxdsCExOS7bMCJ0q5fBEN9lCYM", "object": "chat.completion", - "created": 1758884657, + "created": 1760704583, "model": "gpt-4o-mini-2024-07-18", "choices": [ { @@ -38,7 +38,7 @@ interactions: "content": null, "tool_calls": [ { - "id": "call_FCjSdfiDyZbfKofJ8aYgjarN", + "id": "call_H0yMeWt85QiaFMjrlPqAyCYY", "type": "function", "function": { "name": "add", @@ -46,7 +46,7 @@ interactions: } }, { - "id": "call_AgpIWMgz4cq1cKBsv6Mziy64", + "id": "call_Xh3xOMoQueLZUgW7HYVvwwql", "type": "function", "function": { "name": "multiply", @@ -84,7 +84,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 1.27362425s + duration: 2.030219167s - id: 1 request: proto: HTTP/1.1 @@ -92,7 +92,7 @@ interactions: proto_minor: 1 content_length: 1247 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":"call_FCjSdfiDyZbfKofJ8aYgjarN","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_AgpIWMgz4cq1cKBsv6Mziy64","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_FCjSdfiDyZbfKofJ8aYgjarN","role":"tool"},{"content":"6","tool_call_id":"call_AgpIWMgz4cq1cKBsv6Mziy64","role":"tool"}],"model":"gpt-4o-mini","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"}]}' + 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":"call_H0yMeWt85QiaFMjrlPqAyCYY","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_Xh3xOMoQueLZUgW7HYVvwwql","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_H0yMeWt85QiaFMjrlPqAyCYY","role":"tool"},{"content":"6","tool_call_id":"call_Xh3xOMoQueLZUgW7HYVvwwql","role":"tool"}],"model":"gpt-4o-mini","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"}]}' headers: Accept: - application/json @@ -110,16 +110,16 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XKcm153c0W1VAS4zMtETzXtpVJ", + "id": "chatcmpl-CRdyzVF8CB8APitB5WP6J9QSdWilT", "object": "chat.completion", - "created": 1758884658, + "created": 1760704585, "model": "gpt-4o-mini-2024-07-18", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "The sum of 2 and 3 is 5, and the product of 2 and 3 is 6.", + "content": "The result of adding 2 and 3 is 5, and the result of multiplying 2 and 3 is 6.", "refusal": null, "annotations": [] }, @@ -129,8 +129,8 @@ interactions: ], "usage": { "prompt_tokens": 176, - "completion_tokens": 26, - "total_tokens": 202, + "completion_tokens": 28, + "total_tokens": 204, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 @@ -150,4 +150,4 @@ interactions: - application/json status: 200 OK code: 200 - duration: 1.1014055s + duration: 987.804708ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/multi_tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/multi_tool_streaming.yaml similarity index 61% rename from providertests/testdata/TestOpenAICommon/gpt-4o-mini/multi_tool_streaming.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/multi_tool_streaming.yaml index fd18eb5d5030775f854beca3df0e4c4aa82c056b..cbf4d3537007b84b3e81af6381806ffb4d3106aa 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/multi_tool_streaming.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/multi_tool_streaming.yaml @@ -24,31 +24,31 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}],"obfuscation":"Jc55JP"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}],"obfuscation":"icfARx"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_CGT5idjqbJEWyLlJgPfsmFYb","type":"function","function":{"name":"add","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"OmSduDa945dbJ"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_vgTL4QSVMl9ocwrlDENBvKCl","type":"function","function":{"name":"add","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"feBbOJXFBL4EO"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"JGWO5LWiKSK"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"VkgJFOcIZbR"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"hiqHPmiezH46"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"3w2natY0RoGc"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"OSQtmBsHX"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"36y1gHQIT"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_OrChv4bx3cZusgzSYcsNBXxI","type":"function","function":{"name":"multiply","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"zeRuqxfB"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_0163ysRAfpd1kX8JEsq8piJv","type":"function","function":{"name":"multiply","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"dWNz2rVl"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"p7UhRLOP29K"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"ko1uYx2756e"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"tlEc9WchAOF2"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"8ty7XqR7h2EW"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"iobxrSeLl"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"iD4RWBFbS"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"rVIe1UbTRO4Fjt4"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"vknFSfxKgFJlLl9"} - data: {"id":"chatcmpl-CK0XL6hjKzmU1T07yvr9rjTCPOnAh","object":"chat.completion.chunk","created":1758884659,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":106,"completion_tokens":50,"total_tokens":156,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"XSLg3zvv"} + data: {"id":"chatcmpl-CRdz0aS9mqbcyCuvqkNMoVXDUraLn","object":"chat.completion.chunk","created":1760704586,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":106,"completion_tokens":50,"total_tokens":156,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"hms0Yf0n"} data: [DONE] @@ -57,7 +57,7 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.289823791s + duration: 1.538896292s - id: 1 request: proto: HTTP/1.1 @@ -65,7 +65,7 @@ interactions: proto_minor: 1 content_length: 1284 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":"call_CGT5idjqbJEWyLlJgPfsmFYb","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_OrChv4bx3cZusgzSYcsNBXxI","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_CGT5idjqbJEWyLlJgPfsmFYb","role":"tool"},{"content":"6","tool_call_id":"call_OrChv4bx3cZusgzSYcsNBXxI","role":"tool"}],"model":"gpt-4o-mini","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"}],"stream":true}' + 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":"call_vgTL4QSVMl9ocwrlDENBvKCl","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_0163ysRAfpd1kX8JEsq8piJv","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_vgTL4QSVMl9ocwrlDENBvKCl","role":"tool"},{"content":"6","tool_call_id":"call_0163ysRAfpd1kX8JEsq8piJv","role":"tool"}],"model":"gpt-4o-mini","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"}],"stream":true}' headers: Accept: - application/json @@ -81,61 +81,61 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ovwAEPdQf"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6SLbBHqzK"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"B526hXRg"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"q75QdzGc"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" sum"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LxqqXkb"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" sum"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"JkSJSpe"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IjqaUbWz"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Fi2wspyk"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"K5iHJ3zYsB"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"RXvBB9PXzG"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"it20LzEFmY"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ujYHkroCfT"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QtuO8jy"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ITQLTFp"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"I80rEzGGNy"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"E7m6MjfMt3"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YSnzH4XlkL"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DRYRaSiTRa"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gtENZp22"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nqa6qObb"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AEsjr4m2yV"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"y4ntGcWHia"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"5"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nOUrmAmGJO"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"5"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Oqqu6A6xuL"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"8lWh5aFRrT"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KJoWB4TVlb"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dFNgZc6"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"vkqbtjX"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qw59nLM"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QS86hO5"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" product"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"efI"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" product"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"FJu"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5MKl4OJP"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Ro4WzpG2"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jyOvZqKOeh"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"oCIJrrf6Bp"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YReWDYkmHT"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"F10Kbuq9sR"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9mEgmJ9"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MM5G9Kp"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KxxoW4pT2L"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XTzTNroRtq"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"khvmYS4NU1"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xGzeZa2yza"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WkhqK2kF"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"N6A8H4NU"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KmcLzbmPdz"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mS71DW3IyN"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"6"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ckwI8bCe5W"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"6"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mCm2RXW0k6"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CqL8m0PrXo"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GQdrwWteKo"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"JohBL"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"416kd"} - data: {"id":"chatcmpl-CK0XMr6cA9FeWp9NsQGh2Dft15tBP","object":"chat.completion.chunk","created":1758884660,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":172,"completion_tokens":26,"total_tokens":198,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"goAMHwGT"} + data: {"id":"chatcmpl-CRdz21hccnb76Tjoh5ZtYfJ7qUcKS","object":"chat.completion.chunk","created":1760704588,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":172,"completion_tokens":26,"total_tokens":198,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"JbBHLqxI"} data: [DONE] @@ -144,4 +144,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 632.242708ms + duration: 737.127958ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/simple.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/simple.yaml similarity index 86% rename from providertests/testdata/TestOpenAICommon/gpt-4o-mini/simple.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/simple.yaml index 08d33a0ef7b73f6df2c4eeb1224dffcedeab620b..1d267cf1c2d854ee11ea7dfea1e0825dcd000c9c 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/simple.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/simple.yaml @@ -26,16 +26,16 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XDJXMRJFIQoawW09BP2SyM4Ot8", + "id": "chatcmpl-CRdysIxOQVTFiu9TMRyxiiYHHQyTj", "object": "chat.completion", - "created": 1758884651, + "created": 1760704578, "model": "gpt-4o-mini-2024-07-18", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "Hi! In Portuguese, you would say \"Olá!\"", + "content": "Olá!", "refusal": null, "annotations": [] }, @@ -45,8 +45,8 @@ interactions: ], "usage": { "prompt_tokens": 20, - "completion_tokens": 11, - "total_tokens": 31, + "completion_tokens": 2, + "total_tokens": 22, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 @@ -66,4 +66,4 @@ interactions: - application/json status: 200 OK code: 200 - duration: 761.996916ms + duration: 902.366208ms diff --git a/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/simple_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f27ef625824fa9f7b7d598a79dd7f77c0a13d1a5 --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/simple_streaming.yaml @@ -0,0 +1,60 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 215 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"gpt-4o-mini","max_tokens":4000,"stream_options":{"include_usage":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dNrgk6KCj"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"Hi"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wRjU25PHG"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"li6Xgje1BS"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" In"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3rRemht7"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" Portuguese"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"S0Wp8u71lq"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gsbpPtV"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" say"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LBoNQFN"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" \""},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Bgm7GOfe"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"Olá"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CmJzapI9"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"!\""},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dtukc2xn"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"nYn46"} + + data: {"id":"chatcmpl-CRdytk5LO0hrSMS9Co5OPHLFCuLSF","object":"chat.completion.chunk","created":1760704579,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":20,"completion_tokens":10,"total_tokens":30,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"wXXaHiliFF"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 566.636417ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/tool.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/tool.yaml similarity index 87% rename from providertests/testdata/TestOpenAICommon/gpt-4o-mini/tool.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/tool.yaml index a89e94583cdc27cb263750d37c8e99a1be742ca5..8e7ec09a5430c8b2483c1a35e8fd0772554294e7 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/tool.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/tool.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XFLvJhhbJXQpYZSq0bUsexpP18", + "id": "chatcmpl-CRdyuS0DEOR3GgR76SLPKqPiwPIAt", "object": "chat.completion", - "created": 1758884653, + "created": 1760704580, "model": "gpt-4o-mini-2024-07-18", "choices": [ { @@ -38,7 +38,7 @@ interactions: "content": null, "tool_calls": [ { - "id": "call_KJtOtoO7dF2DgTI8nctku9EC", + "id": "call_2uH56RhZZbC8djqCn7cxRyKl", "type": "function", "function": { "name": "weather", @@ -76,7 +76,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 1.169646666s + duration: 1.057664375s - id: 1 request: proto: HTTP/1.1 @@ -84,7 +84,7 @@ interactions: proto_minor: 1 content_length: 705 host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_KJtOtoO7dF2DgTI8nctku9EC","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_KJtOtoO7dF2DgTI8nctku9EC","role":"tool"}],"model":"gpt-4o-mini","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"}]}' + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_2uH56RhZZbC8djqCn7cxRyKl","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_2uH56RhZZbC8djqCn7cxRyKl","role":"tool"}],"model":"gpt-4o-mini","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"}]}' headers: Accept: - application/json @@ -102,16 +102,16 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XGrDAk6At7slQfnVXf7SWIPNI9", + "id": "chatcmpl-CRdyvMVFPOfa2G1IC80Js9jy1xIE0", "object": "chat.completion", - "created": 1758884654, + "created": 1760704581, "model": "gpt-4o-mini-2024-07-18", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "The current weather in Florence, Italy, is 40°C.", + "content": "The weather in Florence, Italy is currently 40°C.", "refusal": null, "annotations": [] }, @@ -121,8 +121,8 @@ interactions: ], "usage": { "prompt_tokens": 86, - "completion_tokens": 14, - "total_tokens": 100, + "completion_tokens": 13, + "total_tokens": 99, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 @@ -142,4 +142,4 @@ interactions: - application/json status: 200 OK code: 200 - duration: 772.468958ms + duration: 933.192292ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/tool_streaming.yaml similarity index 59% rename from providertests/testdata/TestOpenAICommon/gpt-4o-mini/tool_streaming.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/tool_streaming.yaml index 30d27ebf46efa64083cf89e2017a3ac1fc1b2730..2fc71eadd02f93d98ba8b21ee82ad2d3f70c394c 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o-mini/tool_streaming.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o-mini/tool_streaming.yaml @@ -24,27 +24,27 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_DETfkgrMGPDgJzwS62NSuRPa","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LX9odVHb"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_eOpGKcIP7rzEsLNRtEm9K6mx","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"M7LBWEuz"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"c1yYSDZaI1UDYV"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"y0wRfvzAfc7Gwp"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZToBjCwft"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"l4ftT9t8s"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SXENj4krMldO"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"egmKNDffXaU3"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"O4dIvyXTiV9nE"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GG1ybnr1YrkNG"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CHahf3pIqTc5c"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bSU8KmpVhJmCU"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"RCwjNsUKEVK"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"iRxnuJP3cpr"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dpgaKu5zTDw8CZ"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QBAmqhvyRFjbCZ"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"cYYcBlfkMvDVd07"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"3ebmRJY6jIoVVSq"} - data: {"id":"chatcmpl-CK0XH1YEf20Nk6A5GRZVFbdBy8NvS","object":"chat.completion.chunk","created":1758884655,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":61,"completion_tokens":16,"total_tokens":77,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"aX8SEVMo9D"} + data: {"id":"chatcmpl-CRdywA4dbuMAJLXVP860cVgCKV8Jz","object":"chat.completion.chunk","created":1760704582,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":61,"completion_tokens":16,"total_tokens":77,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"9htLycow0a"} data: [DONE] @@ -53,7 +53,7 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 713.193958ms + duration: 680.827667ms - id: 1 request: proto: HTTP/1.1 @@ -61,7 +61,7 @@ interactions: proto_minor: 1 content_length: 759 host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_DETfkgrMGPDgJzwS62NSuRPa","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_DETfkgrMGPDgJzwS62NSuRPa","role":"tool"}],"model":"gpt-4o-mini","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"}],"stream":true}' + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_eOpGKcIP7rzEsLNRtEm9K6mx","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_eOpGKcIP7rzEsLNRtEm9K6mx","role":"tool"}],"model":"gpt-4o-mini","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"}],"stream":true}' headers: Accept: - application/json @@ -77,35 +77,35 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Nld6m4L8f"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"uB0vXwmAg"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Tt22VYUt"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bXKWncif"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HSH"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5VH"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" temperature"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YVBXBDODyk7cIJS"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"cOVYqBuN"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0owI6QAQ"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qn"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"A8"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ETVXMoB3wo"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Koc2bQX8BA"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"TJueB"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MN5Jc"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2dXikvHR"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MmkAFvX2"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" currently"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"U"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"EdhYi7wxQ1"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SJvYbm15DI"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"40"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AQOB4uaLd"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"40"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MmF8rVRCD"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"°C"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"u3tu0x3Af"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"°C"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6apyDO2Sn"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"RpzcBAg3HO"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"10hdWpCjhh"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"NfRGq"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"CFuXa"} - data: {"id":"chatcmpl-CK0XIUwrhgZGexhOP9ECHm2D0DZLr","object":"chat.completion.chunk","created":1758884656,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":86,"completion_tokens":13,"total_tokens":99,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"QW8EXr68zX"} + data: {"id":"chatcmpl-CRdyx1hGexd66KC0T4iMnborWhkbJ","object":"chat.completion.chunk","created":1760704583,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":86,"completion_tokens":13,"total_tokens":99,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"G7mYdCwtgy"} data: [DONE] @@ -114,4 +114,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 631.400833ms + duration: 434.186417ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o/multi_tool.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/multi_tool.yaml similarity index 84% rename from providertests/testdata/TestOpenAICommon/gpt-4o/multi_tool.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o/multi_tool.yaml index 0e027fa0ff0566614b6b94a92a5525b8536862c3..dc675015a6ff4249a1863549debda68f9dbf9865 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o/multi_tool.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/multi_tool.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XA5ghLRvKpjSC7Rg3T1y9lcS4l", + "id": "chatcmpl-CRdyoWcDq406PCUaEpBjaiqUGhoI3", "object": "chat.completion", - "created": 1758884648, + "created": 1760704574, "model": "gpt-4o-2024-08-06", "choices": [ { @@ -38,7 +38,7 @@ interactions: "content": null, "tool_calls": [ { - "id": "call_xzBAj3TQym7plpg6LQrUqzNb", + "id": "call_Cg9itjRbJ4NYAZEbIwcSiEJZ", "type": "function", "function": { "name": "add", @@ -46,7 +46,7 @@ interactions: } }, { - "id": "call_EhG6PUMSJoTy4yH4uYeOL1fB", + "id": "call_sSIhNbcU2Ap95fBjcsScrTMz", "type": "function", "function": { "name": "multiply", @@ -77,14 +77,14 @@ interactions: } }, "service_tier": "default", - "system_fingerprint": "fp_cbf1785567" + "system_fingerprint": "fp_f64f290af2" } headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 888.207625ms + duration: 1.503138709s - id: 1 request: proto: HTTP/1.1 @@ -92,7 +92,7 @@ interactions: proto_minor: 1 content_length: 1242 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":"call_xzBAj3TQym7plpg6LQrUqzNb","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_EhG6PUMSJoTy4yH4uYeOL1fB","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_xzBAj3TQym7plpg6LQrUqzNb","role":"tool"},{"content":"6","tool_call_id":"call_EhG6PUMSJoTy4yH4uYeOL1fB","role":"tool"}],"model":"gpt-4o","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"}]}' + 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":"call_Cg9itjRbJ4NYAZEbIwcSiEJZ","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_sSIhNbcU2Ap95fBjcsScrTMz","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_Cg9itjRbJ4NYAZEbIwcSiEJZ","role":"tool"},{"content":"6","tool_call_id":"call_sSIhNbcU2Ap95fBjcsScrTMz","role":"tool"}],"model":"gpt-4o","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"}]}' headers: Accept: - application/json @@ -110,16 +110,16 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XBHxWcZv6PHXs0mewNB2TZwvCO", + "id": "chatcmpl-CRdyq4Im6cnYdhDwDtM3utmxVrohv", "object": "chat.completion", - "created": 1758884649, + "created": 1760704576, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "The sum of 2 and 3 is 5, and their product is 6.", + "content": "The result of adding 2 and 3 is 5, and the result of multiplying 2 and 3 is 6.", "refusal": null, "annotations": [] }, @@ -129,8 +129,8 @@ interactions: ], "usage": { "prompt_tokens": 176, - "completion_tokens": 20, - "total_tokens": 196, + "completion_tokens": 28, + "total_tokens": 204, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 @@ -143,11 +143,11 @@ interactions: } }, "service_tier": "default", - "system_fingerprint": "fp_f33640a400" + "system_fingerprint": "fp_f64f290af2" } headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 571.347167ms + duration: 632.902333ms diff --git a/providertests/testdata/TestOpenAICommon/openai-gpt-4o/multi_tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/multi_tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..23f237bbf813e2d6013118d2aed4aa9a757e08e4 --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/multi_tool_streaming.yaml @@ -0,0 +1,135 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 848 + 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":"gpt-4o","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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}],"obfuscation":"OHGcRuhO4A4"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_43EjiXfsjRlSfqUDWptDvMBZ","type":"function","function":{"name":"add","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"Zz"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"X"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"m5lvJ0jw20BTZs"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"uM0Ca"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_xHjbYtQqq9gsbadfjB3Vpjde","type":"function","function":{"name":"multiply","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"u39m7n3pFddmq"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"Z"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"fk12n2in3eYPHY"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"XS0QR"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"J1Fr"} + + data: {"id":"chatcmpl-CRdyrlpgfyiFlAAnoiflUbvXhNUGP","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":106,"completion_tokens":50,"total_tokens":156,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"8X9w9cqTHQGUY"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 772.991416ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1279 + 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":"call_43EjiXfsjRlSfqUDWptDvMBZ","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_xHjbYtQqq9gsbadfjB3Vpjde","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_43EjiXfsjRlSfqUDWptDvMBZ","role":"tool"},{"content":"6","tool_call_id":"call_xHjbYtQqq9gsbadfjB3Vpjde","role":"tool"}],"model":"gpt-4o","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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wQ0ZUR76SWLb1Q"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ISPfkxMctrH0o"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" sum"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"JqFwg751miTx"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9YWR8giqtYFUM"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"itlKS7ahTpMBW8L"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2e7u7BIkx92l3cr"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"m5Oplb1gN9Ja"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3vugZRR3s2aEKKY"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"28sBUXYUnGB22UI"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AuXkgVuyVW8Hy"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"PJgz1kJnoOj9Ftb"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"5"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5osDSc1ClKxMw71"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QsS9PzfMEQOkIt4"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qfFoD9BWS7OJ"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yVmAXLCiwmCA"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" product"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zdqgWQg4"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BURYwy2cPdNM1"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"z12QGfGlmG9qbx1"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"6"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WLygsVccLgfco4Q"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gK83HveBSnYrHmO"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"AmG4YiCc1W"} + + data: {"id":"chatcmpl-CRdyriuRwApMtbM90UU0ea8z83pmx","object":"chat.completion.chunk","created":1760704577,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":172,"completion_tokens":20,"total_tokens":192,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"BlFvM9v7xKitB"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 582.337667ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o/simple.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/simple.yaml similarity index 91% rename from providertests/testdata/TestOpenAICommon/gpt-4o/simple.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o/simple.yaml index a69e11a7cd01daa77f2d38de3eaf462dad54c5a1..1199b98bc664fd250c6a9a6786a8a8620825e8c7 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o/simple.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/simple.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0X4bZcI8nrXIcHWmKudgvXDxrDA", + "id": "chatcmpl-CRdyjdJswbbI6kuVNScObDe3tYnu2", "object": "chat.completion", - "created": 1758884642, + "created": 1760704569, "model": "gpt-4o-2024-08-06", "choices": [ { @@ -59,11 +59,11 @@ interactions: } }, "service_tier": "default", - "system_fingerprint": "fp_f33640a400" + "system_fingerprint": "fp_cbf1785567" } headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 1.155694458s + duration: 740.354167ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o/simple_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/simple_streaming.yaml similarity index 65% rename from providertests/testdata/TestOpenAICommon/gpt-4o/simple_streaming.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o/simple_streaming.yaml index 43d1520a5d233bf90530b311ddf5a36144d07f34..9c31b3f7326385f46c698cddc9e432664dad8d48 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o/simple_streaming.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/simple_streaming.yaml @@ -24,15 +24,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0X5ZDGxyhuWeT5rVCHaFGRgbccv","object":"chat.completion.chunk","created":1758884643,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HqD71AKa50tXXh"} + data: {"id":"chatcmpl-CRdyjrv70pWoCSnjiX81dksuhZK0H","object":"chat.completion.chunk","created":1760704569,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dW8LjvG3FnxHr9"} - data: {"id":"chatcmpl-CK0X5ZDGxyhuWeT5rVCHaFGRgbccv","object":"chat.completion.chunk","created":1758884643,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Olá"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"40xIFsLyWvteo"} + data: {"id":"chatcmpl-CRdyjrv70pWoCSnjiX81dksuhZK0H","object":"chat.completion.chunk","created":1760704569,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Olá"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HhaSik3KUWGzk"} - data: {"id":"chatcmpl-CK0X5ZDGxyhuWeT5rVCHaFGRgbccv","object":"chat.completion.chunk","created":1758884643,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2FARzZxtjhy5wgw"} + data: {"id":"chatcmpl-CRdyjrv70pWoCSnjiX81dksuhZK0H","object":"chat.completion.chunk","created":1760704569,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XoNpCCkgDMpPelm"} - data: {"id":"chatcmpl-CK0X5ZDGxyhuWeT5rVCHaFGRgbccv","object":"chat.completion.chunk","created":1758884643,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"Y6BYwTwbLh"} + data: {"id":"chatcmpl-CRdyjrv70pWoCSnjiX81dksuhZK0H","object":"chat.completion.chunk","created":1760704569,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"FbHAsgWpZy"} - data: {"id":"chatcmpl-CK0X5ZDGxyhuWeT5rVCHaFGRgbccv","object":"chat.completion.chunk","created":1758884643,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":20,"completion_tokens":2,"total_tokens":22,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":""} + data: {"id":"chatcmpl-CRdyjrv70pWoCSnjiX81dksuhZK0H","object":"chat.completion.chunk","created":1760704569,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":20,"completion_tokens":2,"total_tokens":22,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":""} data: [DONE] @@ -41,4 +41,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 683.806291ms + duration: 626.391292ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-4o/tool.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/tool.yaml similarity index 86% rename from providertests/testdata/TestOpenAICommon/gpt-4o/tool.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-4o/tool.yaml index 4183ee5ff4085e18fceffd977425af7c3053860c..2f58ff98e951ea16f061f115fddde1f57ed1016d 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-4o/tool.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/tool.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0X6hYUe2ObsAoS3agGWpVx6KAIF", + "id": "chatcmpl-CRdykecyitTrtBgxG3cAhHM82R3ar", "object": "chat.completion", - "created": 1758884644, + "created": 1760704570, "model": "gpt-4o-2024-08-06", "choices": [ { @@ -38,7 +38,7 @@ interactions: "content": null, "tool_calls": [ { - "id": "call_PzVhbfSC5fkOlTTPrPLKF3og", + "id": "call_zKl0GvROtopAKaVzafvOYfPu", "type": "function", "function": { "name": "weather", @@ -69,14 +69,14 @@ interactions: } }, "service_tier": "default", - "system_fingerprint": "fp_f33640a400" + "system_fingerprint": "fp_cbf1785567" } headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 870.074417ms + duration: 1.142721375s - id: 1 request: proto: HTTP/1.1 @@ -84,7 +84,7 @@ interactions: proto_minor: 1 content_length: 700 host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_PzVhbfSC5fkOlTTPrPLKF3og","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_PzVhbfSC5fkOlTTPrPLKF3og","role":"tool"}],"model":"gpt-4o","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"}]}' + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_zKl0GvROtopAKaVzafvOYfPu","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_zKl0GvROtopAKaVzafvOYfPu","role":"tool"}],"model":"gpt-4o","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"}]}' headers: Accept: - application/json @@ -102,16 +102,16 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0X7Hzh8cJn4geVw2dn4qX583KOX", + "id": "chatcmpl-CRdyljyj1IrCMsT69QVozUugzhlwd", "object": "chat.completion", - "created": 1758884645, + "created": 1760704571, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "The weather in Florence, Italy is currently 40°C.", + "content": "The current temperature in Florence, Italy is 40°C.", "refusal": null, "annotations": [] }, @@ -135,11 +135,11 @@ interactions: } }, "service_tier": "default", - "system_fingerprint": "fp_f33640a400" + "system_fingerprint": "fp_cbf1785567" } headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 578.292709ms + duration: 1.414555709s diff --git a/providertests/testdata/TestOpenAICommon/openai-gpt-4o/tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0476310662c6ce4362409ae730622e0eebd1cd83 --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-4o/tool_streaming.yaml @@ -0,0 +1,117 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 502 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-4o","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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_9W0PDPMmK2SHo8Ph5qmngr60","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SKTBYmVhUa37r"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ISP"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wTarJRBKmxWzEe"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"b"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Dt"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"lK"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZEEqt"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tsM"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"hAQV"} + + data: {"id":"chatcmpl-CRdynEXtk7T39drPlGlAxtuaMPYtO","object":"chat.completion.chunk","created":1760704573,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":61,"completion_tokens":16,"total_tokens":77,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"1fPE9DL5GVNekQj"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 828.397667ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 754 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_9W0PDPMmK2SHo8Ph5qmngr60","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_9W0PDPMmK2SHo8Ph5qmngr60","role":"tool"}],"model":"gpt-4o","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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"redbGckJxoV9Sf"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"hokBzzfi9soMV"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GYmp4NHd"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" temperature"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"V72K"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"J4dE5Y0oVkTnc"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"embLD68"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QxOjL2vP9UUb8DE"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xVq2JhUM0m"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wR1prrEQ6cTc3"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"8tMP4q2OCLlkRy3"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"40"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GOjJVxLP9sk8u4"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"°C"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CCwAe3AFhmdpna"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6DQeIz589eDMca5"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"gnoMeZSJgE"} + + data: {"id":"chatcmpl-CRdyomJ9SewTkG1C99SPqHd6NWByb","object":"chat.completion.chunk","created":1760704574,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":86,"completion_tokens":13,"total_tokens":99,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ImGWeSBRNjxx71V"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 637.852666ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-5/multi_tool.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-5/multi_tool.yaml similarity index 84% rename from providertests/testdata/TestOpenAICommon/gpt-5/multi_tool.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-5/multi_tool.yaml index e4f9b6d677d9574c1957812eb6d6062a84d84d0a..ded49c07c927667466e7688bdc72734e9b0fc8e8 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-5/multi_tool.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-5/multi_tool.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XnxWhgtkMe0wP3vgmBDyXKUnRG", + "id": "chatcmpl-CRdzUDVMIrCJUYwgqR69TFp8L2Swc", "object": "chat.completion", - "created": 1758884687, + "created": 1760704616, "model": "gpt-5-2025-08-07", "choices": [ { @@ -38,7 +38,7 @@ interactions: "content": null, "tool_calls": [ { - "id": "call_owMpyw7UQNzI7NZYQdaRAHuw", + "id": "call_md2XuaM6Rk2D4bTo2L6U2rC4", "type": "function", "function": { "name": "add", @@ -46,7 +46,7 @@ interactions: } }, { - "id": "call_UMUj2rz9wz4i1f0yViOfELBg", + "id": "call_uSejWXP98W4wT6BU62WnSFkD", "type": "function", "function": { "name": "multiply", @@ -62,14 +62,14 @@ interactions: ], "usage": { "prompt_tokens": 194, - "completion_tokens": 379, - "total_tokens": 573, + "completion_tokens": 315, + "total_tokens": 509, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 }, "completion_tokens_details": { - "reasoning_tokens": 320, + "reasoning_tokens": 256, "audio_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0 @@ -83,7 +83,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 4.394474708s + duration: 5.788909416s - id: 1 request: proto: HTTP/1.1 @@ -91,7 +91,7 @@ interactions: proto_minor: 1 content_length: 1252 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":"call_owMpyw7UQNzI7NZYQdaRAHuw","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_UMUj2rz9wz4i1f0yViOfELBg","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_owMpyw7UQNzI7NZYQdaRAHuw","role":"tool"},{"content":"6","tool_call_id":"call_UMUj2rz9wz4i1f0yViOfELBg","role":"tool"}],"model":"gpt-5","max_completion_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"}]}' + 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":"call_md2XuaM6Rk2D4bTo2L6U2rC4","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_uSejWXP98W4wT6BU62WnSFkD","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_md2XuaM6Rk2D4bTo2L6U2rC4","role":"tool"},{"content":"6","tool_call_id":"call_uSejWXP98W4wT6BU62WnSFkD","role":"tool"}],"model":"gpt-5","max_completion_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"}]}' headers: Accept: - application/json @@ -109,16 +109,16 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XsPbTqxoopiRPJQSHDqINvTUtP", + "id": "chatcmpl-CRdzaC6UTwNAIUssvUroMMI05yZPC", "object": "chat.completion", - "created": 1758884692, + "created": 1760704622, "model": "gpt-5-2025-08-07", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "Results:\n- Addition (2 + 3) = 5\n- Multiplication (2 × 3) = 6", + "content": "- Sum (2 + 3): 5\n- Product (2 × 3): 6", "refusal": null, "annotations": [] }, @@ -127,8 +127,8 @@ interactions: ], "usage": { "prompt_tokens": 266, - "completion_tokens": 29, - "total_tokens": 295, + "completion_tokens": 24, + "total_tokens": 290, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 @@ -148,4 +148,4 @@ interactions: - application/json status: 200 OK code: 200 - duration: 1.666342417s + duration: 2.555093917s diff --git a/providertests/testdata/TestOpenAICommon/gpt-5/multi_tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-5/multi_tool_streaming.yaml similarity index 55% rename from providertests/testdata/TestOpenAICommon/gpt-5/multi_tool_streaming.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-5/multi_tool_streaming.yaml index 4471c6056df1338f37124608e1f458d201aee3c6..858a42df18f04a348055cd9d85f2ca92e1664840 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-5/multi_tool_streaming.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-5/multi_tool_streaming.yaml @@ -24,31 +24,31 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"finish_reason":null}],"obfuscation":"A267Qlz"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"finish_reason":null}],"obfuscation":"NvBRsp2"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_AXhYybFxqFkolGcqOgAFoSFX","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null}],"obfuscation":"RFeaNwHIAYBsVY"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_4ebZx1iZmHY4sPZ1h1iMHaWD","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null}],"obfuscation":"5qQkfsMd6Ydd9V"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"finish_reason":null}],"obfuscation":"WJMeoEiRsqUQ"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"finish_reason":null}],"obfuscation":"VeWK0cIPeocT"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"finish_reason":null}],"obfuscation":"ICdxIqu5A6utx"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"finish_reason":null}],"obfuscation":"ROMuHEfrgbrS7"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"finish_reason":null}],"obfuscation":"EEVOXd76AO"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"finish_reason":null}],"obfuscation":"xE9kB40afY"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"obfuscation":"b"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"obfuscation":"4"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_3coDGg9Vq8TWdNxqZhONlTvf","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null}],"obfuscation":"FlbQ1NJFg"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_wyeHgH870UHPvm0tKc4MwvDD","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null}],"obfuscation":"IneSneP7z"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"finish_reason":null}],"obfuscation":"cT6Z7pBgiudL"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"finish_reason":null}],"obfuscation":"HGrCNThdZNii"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"finish_reason":null}],"obfuscation":"hBepHW4ne1PKa"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"finish_reason":null}],"obfuscation":"5ZULYIdry7hus"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"finish_reason":null}],"obfuscation":"8cRTwxjNfk"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"finish_reason":null}],"obfuscation":"3iFLy71PX6"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"finish_reason":null}],"obfuscation":"n"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"finish_reason":null}],"obfuscation":"d"} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CK0XtZlLMkqbw0LEkkXg7xLSmvy9K","object":"chat.completion.chunk","created":1758884693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":190,"completion_tokens":315,"total_tokens":505,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"9PJ53E"} + data: {"id":"chatcmpl-CRdzc7GhPT7mc2HunXDSslDWG7Bhx","object":"chat.completion.chunk","created":1760704624,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":190,"completion_tokens":507,"total_tokens":697,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":448,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Em6PO8"} data: [DONE] @@ -57,7 +57,7 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 3.330712625s + duration: 7.672726292s - id: 1 request: proto: HTTP/1.1 @@ -65,7 +65,7 @@ interactions: proto_minor: 1 content_length: 1289 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":"call_AXhYybFxqFkolGcqOgAFoSFX","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_3coDGg9Vq8TWdNxqZhONlTvf","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_AXhYybFxqFkolGcqOgAFoSFX","role":"tool"},{"content":"6","tool_call_id":"call_3coDGg9Vq8TWdNxqZhONlTvf","role":"tool"}],"model":"gpt-5","max_completion_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"}],"stream":true}' + 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":"call_4ebZx1iZmHY4sPZ1h1iMHaWD","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"},{"id":"call_wyeHgH870UHPvm0tKc4MwvDD","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"call_4ebZx1iZmHY4sPZ1h1iMHaWD","role":"tool"},{"content":"6","tool_call_id":"call_wyeHgH870UHPvm0tKc4MwvDD","role":"tool"}],"model":"gpt-5","max_completion_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"}],"stream":true}' headers: Accept: - application/json @@ -81,57 +81,57 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"vID1IGJC6m"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"1TG67VBOtJ"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"qbxZjUkeuDv"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"OHhVbfnddSM"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Sum"},"finish_reason":null}],"usage":null,"obfuscation":"PEdMh36h"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Sum"},"finish_reason":null}],"usage":null,"obfuscation":"jEUBOH54"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"KGL91cgbWw"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"PtgcMX4qEe"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"2"},"finish_reason":null}],"usage":null,"obfuscation":"2ZsGXv9EiHV"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"2"},"finish_reason":null}],"usage":null,"obfuscation":"zfYlcOcLZ9C"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" +"},"finish_reason":null}],"usage":null,"obfuscation":"BXimjcvLQx"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" +"},"finish_reason":null}],"usage":null,"obfuscation":"1u8xvTtq3Y"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"WHOV531PL3L"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"K9I2ZUnGymF"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"3"},"finish_reason":null}],"usage":null,"obfuscation":"b4dZKxqGGiy"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"3"},"finish_reason":null}],"usage":null,"obfuscation":"TIkXxx9gbCK"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")"},"finish_reason":null}],"usage":null,"obfuscation":"5HiMMinpUcV"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")"},"finish_reason":null}],"usage":null,"obfuscation":"mFcLz5PLsoF"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ="},"finish_reason":null}],"usage":null,"obfuscation":"zL0byXjsPs"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ="},"finish_reason":null}],"usage":null,"obfuscation":"0ZLum9Jw5e"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"Zow0s0dR8w3"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"pbEwyGNzS90"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"5"},"finish_reason":null}],"usage":null,"obfuscation":"cJhL3OkRIAx"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"5"},"finish_reason":null}],"usage":null,"obfuscation":"OYQfKVWpL6O"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"q8rSxuKB6w"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"fjPV5j0VDX"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"PAXMwDOW8fg"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"j7Xcg9fNM95"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Product"},"finish_reason":null}],"usage":null,"obfuscation":"dt2z"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Product"},"finish_reason":null}],"usage":null,"obfuscation":"GAEj"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"9MfGVRPMdO"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"BE9tgnurlz"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"2"},"finish_reason":null}],"usage":null,"obfuscation":"qU9B2iZnI8o"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"2"},"finish_reason":null}],"usage":null,"obfuscation":"Yymwjl7AQga"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ×"},"finish_reason":null}],"usage":null,"obfuscation":"hHzza8eoV3"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ×"},"finish_reason":null}],"usage":null,"obfuscation":"gGuS8rBmJ7"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"GmiguRpaJTY"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"8Z5amiIoV0M"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"3"},"finish_reason":null}],"usage":null,"obfuscation":"LjRT5gs3X2p"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"3"},"finish_reason":null}],"usage":null,"obfuscation":"jBrz8DxKZbt"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")"},"finish_reason":null}],"usage":null,"obfuscation":"6urhKP1K3vT"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")"},"finish_reason":null}],"usage":null,"obfuscation":"5mWkJRjBkAX"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ="},"finish_reason":null}],"usage":null,"obfuscation":"WOrtpCd87Y"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ="},"finish_reason":null}],"usage":null,"obfuscation":"UWqBcH386u"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"m5sWF0Kp7D1"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"WDsRS72YWt0"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"6"},"finish_reason":null}],"usage":null,"obfuscation":"Ys8pW1fwz40"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"6"},"finish_reason":null}],"usage":null,"obfuscation":"tUUmtDYNimg"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"fvd0Zu"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"UgDqt8"} - data: {"id":"chatcmpl-CK0XxDRAh0JZnMfWhYwXQXIrkIkf1","object":"chat.completion.chunk","created":1758884697,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":262,"completion_tokens":26,"total_tokens":288,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"VYgMnRAvS"} + data: {"id":"chatcmpl-CRdzkO32Hy3VSWpgWF4X77ZM5KD12","object":"chat.completion.chunk","created":1760704632,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":262,"completion_tokens":26,"total_tokens":288,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Wqu7E2SWz"} data: [DONE] @@ -140,4 +140,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.330152625s + duration: 954.683416ms diff --git a/providertests/testdata/TestOpenAICommon/gpt-5/simple.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-5/simple.yaml similarity index 87% rename from providertests/testdata/TestOpenAICommon/gpt-5/simple.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-5/simple.yaml index 171e05d4094f6ece935385cabdd301d1b373bdcf..0e91885c49c3dcf1f3238bed17de0f7c6198c5b7 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-5/simple.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-5/simple.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XOu05MsCCjlsUQ8FMCiweyNIzy", + "id": "chatcmpl-CRdz3IlGIW2lfJ0VP6n8tkysshWP6", "object": "chat.completion", - "created": 1758884662, + "created": 1760704589, "model": "gpt-5-2025-08-07", "choices": [ { @@ -44,14 +44,14 @@ interactions: ], "usage": { "prompt_tokens": 19, - "completion_tokens": 267, - "total_tokens": 286, + "completion_tokens": 203, + "total_tokens": 222, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 }, "completion_tokens_details": { - "reasoning_tokens": 256, + "reasoning_tokens": 192, "audio_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0 @@ -65,4 +65,4 @@ interactions: - application/json status: 200 OK code: 200 - duration: 7.980275959s + duration: 5.250838625s diff --git a/providertests/testdata/TestOpenAICommon/gpt-5/simple_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-5/simple_streaming.yaml similarity index 66% rename from providertests/testdata/TestOpenAICommon/gpt-5/simple_streaming.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-5/simple_streaming.yaml index b18a6e1897e5a547c6a52710249ed36bd43a1df7..71885f56532bf0d36943cbbaf17bca09d43d98f8 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-5/simple_streaming.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-5/simple_streaming.yaml @@ -24,15 +24,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CK0XVjPg2s2l38Jp4lk55TNIOTFhX","object":"chat.completion.chunk","created":1758884669,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"DkFHOAsKPT"} + data: {"id":"chatcmpl-CRdz8RCAgBM561aJOMPL9YeHB957W","object":"chat.completion.chunk","created":1760704594,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"SFRj4fNgeY"} - data: {"id":"chatcmpl-CK0XVjPg2s2l38Jp4lk55TNIOTFhX","object":"chat.completion.chunk","created":1758884669,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Olá"},"finish_reason":null}],"usage":null,"obfuscation":"DDecr705I"} + data: {"id":"chatcmpl-CRdz8RCAgBM561aJOMPL9YeHB957W","object":"chat.completion.chunk","created":1760704594,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Olá"},"finish_reason":null}],"usage":null,"obfuscation":"x2Y1eWqda"} - data: {"id":"chatcmpl-CK0XVjPg2s2l38Jp4lk55TNIOTFhX","object":"chat.completion.chunk","created":1758884669,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}],"usage":null,"obfuscation":"xXHCpUUBS0F"} + data: {"id":"chatcmpl-CRdz8RCAgBM561aJOMPL9YeHB957W","object":"chat.completion.chunk","created":1760704594,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}],"usage":null,"obfuscation":"tDJ7zpDqgTi"} - data: {"id":"chatcmpl-CK0XVjPg2s2l38Jp4lk55TNIOTFhX","object":"chat.completion.chunk","created":1758884669,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"YGdqo0"} + data: {"id":"chatcmpl-CRdz8RCAgBM561aJOMPL9YeHB957W","object":"chat.completion.chunk","created":1760704594,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"85W83X"} - data: {"id":"chatcmpl-CK0XVjPg2s2l38Jp4lk55TNIOTFhX","object":"chat.completion.chunk","created":1758884669,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":19,"completion_tokens":75,"total_tokens":94,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"W9Y009RwUv"} + data: {"id":"chatcmpl-CRdz8RCAgBM561aJOMPL9YeHB957W","object":"chat.completion.chunk","created":1760704594,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":19,"completion_tokens":75,"total_tokens":94,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"gUl972lllc"} data: [DONE] @@ -41,4 +41,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.723195042s + duration: 2.890382667s diff --git a/providertests/testdata/TestOpenAICommon/gpt-5/tool.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-5/tool.yaml similarity index 82% rename from providertests/testdata/TestOpenAICommon/gpt-5/tool.yaml rename to providertests/testdata/TestOpenAICommon/openai-gpt-5/tool.yaml index 6cd16d5b7281e25880d4480d139f1aeebefcca1e..8a8cd3dbe1161054126f4df0188776eb83533d80 100644 --- a/providertests/testdata/TestOpenAICommon/gpt-5/tool.yaml +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-5/tool.yaml @@ -26,9 +26,9 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XYLtrTcQa9MlwDz9fensX4gebx", + "id": "chatcmpl-CRdzCfnkaQoMYKAvfAXds0hUUaCog", "object": "chat.completion", - "created": 1758884672, + "created": 1760704598, "model": "gpt-5-2025-08-07", "choices": [ { @@ -38,7 +38,7 @@ interactions: "content": null, "tool_calls": [ { - "id": "call_f7ty26Ui6FOEcr62i17rpqTm", + "id": "call_iENK0JiZIVgIwVhzXgr2vqAb", "type": "function", "function": { "name": "weather", @@ -54,14 +54,14 @@ interactions: ], "usage": { "prompt_tokens": 145, - "completion_tokens": 153, - "total_tokens": 298, + "completion_tokens": 89, + "total_tokens": 234, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 }, "completion_tokens_details": { - "reasoning_tokens": 128, + "reasoning_tokens": 64, "audio_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0 @@ -75,7 +75,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 3.940455375s + duration: 4.061672083s - id: 1 request: proto: HTTP/1.1 @@ -83,7 +83,7 @@ interactions: proto_minor: 1 content_length: 710 host: "" - body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_f7ty26Ui6FOEcr62i17rpqTm","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_f7ty26Ui6FOEcr62i17rpqTm","role":"tool"}],"model":"gpt-5","max_completion_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"}]}' + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_iENK0JiZIVgIwVhzXgr2vqAb","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_iENK0JiZIVgIwVhzXgr2vqAb","role":"tool"}],"model":"gpt-5","max_completion_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"}]}' headers: Accept: - application/json @@ -101,16 +101,16 @@ interactions: uncompressed: true body: | { - "id": "chatcmpl-CK0XcDcYqMxxiRhTx5TCZV8YODtaI", + "id": "chatcmpl-CRdzFTi2wOwwtpFFMfez7pGHYh07c", "object": "chat.completion", - "created": 1758884676, + "created": 1760704601, "model": "gpt-5-2025-08-07", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "It’s currently around 40°C in Florence, Italy. Would you like details like conditions, wind, or a forecast?", + "content": "It’s currently about 40°C (104°F) in Florence, Italy. Would you like a forecast or more details (humidity, wind, etc.)?", "refusal": null, "annotations": [] }, @@ -119,14 +119,14 @@ interactions: ], "usage": { "prompt_tokens": 176, - "completion_tokens": 226, - "total_tokens": 402, + "completion_tokens": 297, + "total_tokens": 473, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 }, "completion_tokens_details": { - "reasoning_tokens": 192, + "reasoning_tokens": 256, "audio_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0 @@ -140,4 +140,4 @@ interactions: - application/json status: 200 OK code: 200 - duration: 4.914360584s + duration: 6.021670833s diff --git a/providertests/testdata/TestOpenAICommon/openai-gpt-5/tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-gpt-5/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cb04a361d67de4d83fd0a8b990527285bf470c4a --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-gpt-5/tool_streaming.yaml @@ -0,0 +1,125 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 512 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-5","max_completion_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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_HclHssdmN42q5djc4MO0fnIH","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"wW0mB4WAi"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Djas7aoZyHzDdg5"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9OsYZ12UtG"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"YIo7qOV9nxFX5"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0t9tM3wGusJNdp"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"finish_reason":null}],"usage":null,"obfuscation":"B5LwqW2HhJ6FQv"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"4"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Bxlp9FKSsSrt"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zX7DDFi6nMXYRWx"} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CRdzLjfDek4NLenFzdYH7xA7ZwhXR","object":"chat.completion.chunk","created":1760704607,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":145,"completion_tokens":89,"total_tokens":234,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"9A0uIEuB"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 3.656144208s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 764 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_HclHssdmN42q5djc4MO0fnIH","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_HclHssdmN42q5djc4MO0fnIH","role":"tool"}],"model":"gpt-5","max_completion_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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"Zo8VekTq7A"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"It"},"finish_reason":null}],"usage":null,"obfuscation":"0XPFHlQbT1"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"’s"},"finish_reason":null}],"usage":null,"obfuscation":"VqFEMOFD6V"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" currently"},"finish_reason":null}],"usage":null,"obfuscation":"05"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" about"},"finish_reason":null}],"usage":null,"obfuscation":"Hmjn6u"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"R6mJbjdENZ1"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"40"},"finish_reason":null}],"usage":null,"obfuscation":"aVWsABpE1B"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"°C"},"finish_reason":null}],"usage":null,"obfuscation":"vRN6vWf8xs"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"qf1rIt73k5"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"104"},"finish_reason":null}],"usage":null,"obfuscation":"lkJ8qhLqA"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"°F"},"finish_reason":null}],"usage":null,"obfuscation":"x76W7W30bt"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")"},"finish_reason":null}],"usage":null,"obfuscation":"X46lgG61m9r"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" in"},"finish_reason":null}],"usage":null,"obfuscation":"IXf4EbHLq"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Florence"},"finish_reason":null}],"usage":null,"obfuscation":"MQT"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"dxfY7jhGQdw"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Italy"},"finish_reason":null}],"usage":null,"obfuscation":"WKm2x1"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"pCxaTBsDTC8"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"uEVTHt"} + + data: {"id":"chatcmpl-CRdzPGEdWul8J6am5jOSgWZXVK6c8","object":"chat.completion.chunk","created":1760704611,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":176,"completion_tokens":217,"total_tokens":393,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"PJkBnc"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 4.725152125s diff --git a/providertests/testdata/TestOpenAICommon/openai-o4-mini/simple.yaml b/providertests/testdata/TestOpenAICommon/openai-o4-mini/simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..65c1131bff2ca942b38c6ddd41154deda43f8884 --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-o4-mini/simple.yaml @@ -0,0 +1,68 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 168 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"o4-mini","max_completion_tokens":4000}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "id": "chatcmpl-CRdzlFzVyGYYxdsq9AKdmXfr7MukL", + "object": "chat.completion", + "created": 1760704633, + "model": "o4-mini-2025-04-16", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Olá!", + "refusal": null, + "annotations": [] + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 19, + "completion_tokens": 84, + "total_tokens": 103, + "prompt_tokens_details": { + "cached_tokens": 0, + "audio_tokens": 0 + }, + "completion_tokens_details": { + "reasoning_tokens": 64, + "audio_tokens": 0, + "accepted_prediction_tokens": 0, + "rejected_prediction_tokens": 0 + } + }, + "service_tier": "default", + "system_fingerprint": null + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.321425625s diff --git a/providertests/testdata/TestOpenAICommon/openai-o4-mini/simple_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-o4-mini/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..de93f432a57e53a57619e65bde2f548495682dcd --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-o4-mini/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: 222 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"o4-mini","max_completion_tokens":4000,"stream_options":{"include_usage":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdznBTZHwiwBn3wgDxF7dJBJmoV8","object":"chat.completion.chunk","created":1760704635,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"In0BspKy"} + + data: {"id":"chatcmpl-CRdznBTZHwiwBn3wgDxF7dJBJmoV8","object":"chat.completion.chunk","created":1760704635,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Oi"},"finish_reason":null}],"usage":null,"obfuscation":"RHZ9L7BA"} + + data: {"id":"chatcmpl-CRdznBTZHwiwBn3wgDxF7dJBJmoV8","object":"chat.completion.chunk","created":1760704635,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}],"usage":null,"obfuscation":"X8LMBUcZV"} + + data: {"id":"chatcmpl-CRdznBTZHwiwBn3wgDxF7dJBJmoV8","object":"chat.completion.chunk","created":1760704635,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"q1Yq"} + + data: {"id":"chatcmpl-CRdznBTZHwiwBn3wgDxF7dJBJmoV8","object":"chat.completion.chunk","created":1760704635,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":19,"completion_tokens":148,"total_tokens":167,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"VkPeD"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 3.133094s diff --git a/providertests/testdata/TestOpenAICommon/openai-o4-mini/tool.yaml b/providertests/testdata/TestOpenAICommon/openai-o4-mini/tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7f6538b21b382d749a17ce6ce58f17efe079376e --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-o4-mini/tool.yaml @@ -0,0 +1,143 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 460 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"o4-mini","max_completion_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"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "id": "chatcmpl-CRdzrg9Xy1ovxuEsdeaIh5HbAmzlq", + "object": "chat.completion", + "created": 1760704639, + "model": "o4-mini-2025-04-16", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": null, + "tool_calls": [ + { + "id": "call_ZvgvJnyxcLxfnrw1vvy9QVMu", + "type": "function", + "function": { + "name": "weather", + "arguments": "{\"location\":\"Florence,Italy\"}" + } + } + ], + "refusal": null, + "annotations": [] + }, + "finish_reason": "tool_calls" + } + ], + "usage": { + "prompt_tokens": 64, + "completion_tokens": 89, + "total_tokens": 153, + "prompt_tokens_details": { + "cached_tokens": 0, + "audio_tokens": 0 + }, + "completion_tokens_details": { + "reasoning_tokens": 64, + "audio_tokens": 0, + "accepted_prediction_tokens": 0, + "rejected_prediction_tokens": 0 + } + }, + "service_tier": "default", + "system_fingerprint": null + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.706478833s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 711 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_ZvgvJnyxcLxfnrw1vvy9QVMu","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_ZvgvJnyxcLxfnrw1vvy9QVMu","role":"tool"}],"model":"o4-mini","max_completion_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"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: | + { + "id": "chatcmpl-CRdzu4C4EiqGRGJMYLhi1nnaygxRb", + "object": "chat.completion", + "created": 1760704642, + "model": "o4-mini-2025-04-16", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "The current temperature in Florence, Italy is 40°C. It's quite hot, so stay hydrated and try to stay in the shade or indoors with air conditioning if you can!", + "refusal": null, + "annotations": [] + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 95, + "completion_tokens": 47, + "total_tokens": 142, + "prompt_tokens_details": { + "cached_tokens": 0, + "audio_tokens": 0 + }, + "completion_tokens_details": { + "reasoning_tokens": 0, + "audio_tokens": 0, + "accepted_prediction_tokens": 0, + "rejected_prediction_tokens": 0 + } + }, + "service_tier": "default", + "system_fingerprint": null + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.575507083s diff --git a/providertests/testdata/TestOpenAICommon/openai-o4-mini/tool_streaming.yaml b/providertests/testdata/TestOpenAICommon/openai-o4-mini/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5b2f388bcd3c91b98af78ba329698f444c9cc691 --- /dev/null +++ b/providertests/testdata/TestOpenAICommon/openai-o4-mini/tool_streaming.yaml @@ -0,0 +1,149 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 514 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"o4-mini","max_completion_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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_XevDuUMYIPg4YiA0oGOYlJTt","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"kPmohDP"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"l8ZBA4sqknndZ"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uDtteUEc"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"RLch0C57YvN"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ubrkTTBECEch"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ymKoTibZF2Wx"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"lunIUN6UnqixGVS"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0R7CM90wrz"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UoUH2orSC5M6H"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"kyr6C4vgS6KpIx"} + + data: {"id":"chatcmpl-CRdzvzjPGfHTfxYWBuHOE6Fqgbd3w","object":"chat.completion.chunk","created":1760704643,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":64,"completion_tokens":25,"total_tokens":89,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"BMYaOAORX"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 1.742662959s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 766 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_XevDuUMYIPg4YiA0oGOYlJTt","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_XevDuUMYIPg4YiA0oGOYlJTt","role":"tool"}],"model":"o4-mini","max_completion_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"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"J9fqcxQ0"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"The"},"finish_reason":null}],"usage":null,"obfuscation":"9psTh4S"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" current"},"finish_reason":null}],"usage":null,"obfuscation":"qC"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" temperature"},"finish_reason":null}],"usage":null,"obfuscation":"IWaJutlGMgxvCa"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" in"},"finish_reason":null}],"usage":null,"obfuscation":"7GnoJrO"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Florence"},"finish_reason":null}],"usage":null,"obfuscation":"C"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"7uviSp1f4"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Italy"},"finish_reason":null}],"usage":null,"obfuscation":"OIuc"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" is"},"finish_reason":null}],"usage":null,"obfuscation":"FefXEvV"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"zMQLb8hcU"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"40"},"finish_reason":null}],"usage":null,"obfuscation":"dqTN5maD"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"°C"},"finish_reason":null}],"usage":null,"obfuscation":"zmWzszVf"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"wcGkYYod2"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Would"},"finish_reason":null}],"usage":null,"obfuscation":"Y3wl"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" you"},"finish_reason":null}],"usage":null,"obfuscation":"whFvbn"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" like"},"finish_reason":null}],"usage":null,"obfuscation":"zleYy"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" more"},"finish_reason":null}],"usage":null,"obfuscation":"LvKVS"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" details"},"finish_reason":null}],"usage":null,"obfuscation":"6S"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"CN2vr0cw"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"e"},"finish_reason":null}],"usage":null,"obfuscation":"MnqKVTshP"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".g"},"finish_reason":null}],"usage":null,"obfuscation":"3dgCtAmi"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".,"},"finish_reason":null}],"usage":null,"obfuscation":"3PssNymm"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" humidity"},"finish_reason":null}],"usage":null,"obfuscation":"2"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"YOzesgDGD"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" wind"},"finish_reason":null}],"usage":null,"obfuscation":"WcWEd"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" speed"},"finish_reason":null}],"usage":null,"obfuscation":"22yU"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"YM4evRNHw"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" forecast"},"finish_reason":null}],"usage":null,"obfuscation":"X"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")?"},"finish_reason":null}],"usage":null,"obfuscation":"kWnwQGZK"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"u1V5"} + + data: {"id":"chatcmpl-CRdzxUM84mYwaVLVUEQ0BMkH7N3rK","object":"chat.completion.chunk","created":1760704645,"model":"o4-mini-2025-04-16","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":95,"completion_tokens":40,"total_tokens":135,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"WOSHdxIx"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 905.154333ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6200528a823029ef8c0f3cf0c58e54124385c8fd --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool.yaml @@ -0,0 +1,293 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 839 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0e6e91029b6ada300168f237eec6608195ad0152f869ad01dc", + "object": "response", + "created_at": 1760704494, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [ + { + "id": "fc_0e6e91029b6ada300168f237efd70c8195aa55d25207351903", + "type": "function_call", + "status": "completed", + "arguments": "{\"a\":2,\"b\":3}", + "call_id": "call_OHopAt0ZeLfG0Th5YYgklQUA", + "name": "add" + }, + { + "id": "fc_0e6e91029b6ada300168f237f056848195b392f4da0c8c085c", + "type": "function_call", + "status": "completed", + "arguments": "{\"a\":2,\"b\":3}", + "call_id": "call_CuDiIyPSC4zAkb7l4cjiEBot", + "name": "multiply" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "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" + }, + "strict": false + }, + { + "type": "function", + "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" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 54, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 50, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 104 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.986247916s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1266 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_OHopAt0ZeLfG0Th5YYgklQUA","name":"add","type":"function_call"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_CuDiIyPSC4zAkb7l4cjiEBot","name":"multiply","type":"function_call"},{"call_id":"call_OHopAt0ZeLfG0Th5YYgklQUA","output":"5","type":"function_call_output"},{"call_id":"call_CuDiIyPSC4zAkb7l4cjiEBot","output":"6","type":"function_call_output"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0d01b8c6f6fd8fea0168f237f0b9d88192a55dfc495051641f", + "object": "response", + "created_at": 1760704496, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [ + { + "id": "msg_0d01b8c6f6fd8fea0168f237f11b3881929b9577533766ce13", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "The results are as follows:\n\n- Addition of 2 and 3: **5**\n- Multiplication of 2 and 3: **6**" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "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" + }, + "strict": false + }, + { + "type": "function", + "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" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 156, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 33, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 189 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.0980445s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..08e8b7dd57e49c75f225dc1b2626f57c8dec8286 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/multi_tool_streaming.yaml @@ -0,0 +1,232 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 836 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_00a8e88fa6f940ad0168f237f1dd888193a1ef5c9847dab08c","object":"response","created_at":1760704498,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_00a8e88fa6f940ad0168f237f1dd888193a1ef5c9847dab08c","object":"response","created_at":1760704498,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","type":"function_call","status":"in_progress","arguments":"","call_id":"call_3kTB5GwkneSeSzqRU0vGYPDL","name":"add"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":3,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"delta":"{","obfuscation":"MYJbzQXS8koAMnE"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":4,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"delta":"\"a","obfuscation":"QsLZoZF7HORhVg"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"delta":"\":","obfuscation":"t1wiWnFzF3XGK3"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"delta":"2,","obfuscation":"RGkyrnS7pyZ4Dc"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"delta":"\"b","obfuscation":"EaoxiEhgZ08nqy"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"delta":"\":","obfuscation":"JVvJNSMiELxKzO"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"delta":"3}","obfuscation":"x4XeMEEEMraVP6"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":10,"item_id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","output_index":0,"arguments":"{\"a\":2,\"b\":3}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":11,"output_index":0,"item":{"id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_3kTB5GwkneSeSzqRU0vGYPDL","name":"add"}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":12,"output_index":1,"item":{"id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","type":"function_call","status":"in_progress","arguments":"","call_id":"call_Jt8bB5S9YYfmIi76VQmbBbRU","name":"multiply"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":13,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"delta":"{","obfuscation":"1RSWOvhsqosKvNT"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":14,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"delta":"\"a","obfuscation":"q5YBU194JPt2K7"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":15,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"delta":"\":","obfuscation":"0ST7G5t6xpPBbm"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":16,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"delta":"2,","obfuscation":"fehmIw5XYwhSmd"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":17,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"delta":"\"b","obfuscation":"aTdnl1XrjAoVfk"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":18,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"delta":"\":","obfuscation":"MZxsdfhi5quYaN"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":19,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"delta":"3}","obfuscation":"oo1Zml2PxLLsqt"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":20,"item_id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","output_index":1,"arguments":"{\"a\":2,\"b\":3}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":21,"output_index":1,"item":{"id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_Jt8bB5S9YYfmIi76VQmbBbRU","name":"multiply"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":22,"response":{"id":"resp_00a8e88fa6f940ad0168f237f1dd888193a1ef5c9847dab08c","object":"response","created_at":1760704498,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[{"id":"fc_00a8e88fa6f940ad0168f237f314c08193b9a1bbcfcac14cf0","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_3kTB5GwkneSeSzqRU0vGYPDL","name":"add"},{"id":"fc_00a8e88fa6f940ad0168f237f36d5481939649569c1b43bad3","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_Jt8bB5S9YYfmIi76VQmbBbRU","name":"multiply"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":52,"input_tokens_details":{"cached_tokens":0},"output_tokens":50,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":102},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 484.945334ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1263 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_3kTB5GwkneSeSzqRU0vGYPDL","name":"add","type":"function_call"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_Jt8bB5S9YYfmIi76VQmbBbRU","name":"multiply","type":"function_call"},{"call_id":"call_3kTB5GwkneSeSzqRU0vGYPDL","output":"5","type":"function_call_output"},{"call_id":"call_Jt8bB5S9YYfmIi76VQmbBbRU","output":"6","type":"function_call_output"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0dce58b46fca39020168f237f414988197b9530f9cacc71f05","object":"response","created_at":1760704500,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0dce58b46fca39020168f237f414988197b9530f9cacc71f05","object":"response","created_at":1760704500,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"The","logprobs":[],"obfuscation":"KXnqGA8frpb3Z"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" sum","logprobs":[],"obfuscation":"muAcpURnEZNO"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" of","logprobs":[],"obfuscation":"NiiFQNE8Vbx3m"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"iedCm3V4NG5VwKG"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"2","logprobs":[],"obfuscation":"DpkpH9aX7QlOgRI"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" and","logprobs":[],"obfuscation":"JKO99mU6Fzjd"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"DKM0PLMlWtpJ2db"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"3","logprobs":[],"obfuscation":"mNeixBaCsE7BA3E"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"bVAgqZAo0CgC6"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" **","logprobs":[],"obfuscation":"jSwrxR8I6VXfC"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"5","logprobs":[],"obfuscation":"XLGPJZ5j6iFMyJA"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"**,","logprobs":[],"obfuscation":"t6jjUQXk4bJje"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" and","logprobs":[],"obfuscation":"lO0lZAk18hmY"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" the","logprobs":[],"obfuscation":"mWdiBmSqYvRX"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" product","logprobs":[],"obfuscation":"8JcFiI34"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" of","logprobs":[],"obfuscation":"TPkzDFwQxJbSv"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"LJlbhe5chuMFaet"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"2","logprobs":[],"obfuscation":"b0aoUxaTomg3dRS"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" and","logprobs":[],"obfuscation":"87UGzV4meZ0c"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":23,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"DqZaRc0KL1HCaa7"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":24,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"3","logprobs":[],"obfuscation":"2XztAgjOUqo2XhP"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":25,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"5R24VMFP7z2bO"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":26,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":" **","logprobs":[],"obfuscation":"4h58jpYffdpGo"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":27,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"6","logprobs":[],"obfuscation":"Btim10fw2C3Hmlh"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":28,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":"**","logprobs":[],"obfuscation":"OPI3mnY896mA1s"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":29,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"delta":".","logprobs":[],"obfuscation":"2VzoXZZJZ0dW8MY"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":30,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"text":"The sum of 2 and 3 is **5**, and the product of 2 and 3 is **6**.","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":31,"item_id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"The sum of 2 and 3 is **5**, and the product of 2 and 3 is **6**."}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":32,"output_index":0,"item":{"id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The sum of 2 and 3 is **5**, and the product of 2 and 3 is **6**."}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":33,"response":{"id":"resp_0dce58b46fca39020168f237f414988197b9530f9cacc71f05","object":"response","created_at":1760704500,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[{"id":"msg_0dce58b46fca39020168f237f489188197a1fdc7d8f7aa79f8","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The sum of 2 and 3 is **5**, and the product of 2 and 3 is **6**."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":152,"input_tokens_details":{"cached_tokens":0},"output_tokens":28,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":180},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 413.404917ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c520cfc5a37a158b710814a040a863489cce0a57 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple.yaml @@ -0,0 +1,100 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 210 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"gpt-4o-mini"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_02fb59ed5cb3cadf0168f237e8ce908195baa9463cad5776cb", + "object": "response", + "created_at": 1760704488, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [ + { + "id": "msg_02fb59ed5cb3cadf0168f237e93f388195afee2cc6277cfaa0", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Oi!" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 20, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 23 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 701.807792ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..68497028140dc4b4088f3dd5dffef9ef0434cdfe --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/simple_streaming.yaml @@ -0,0 +1,62 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 224 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"gpt-4o-mini","stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_05eea6934a1b65980168f237e98214819693e879eb9deb3718","object":"response","created_at":1760704489,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_05eea6934a1b65980168f237e98214819693e879eb9deb3718","object":"response","created_at":1760704489,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","output_index":0,"content_index":0,"delta":"Oi","logprobs":[],"obfuscation":"PLeCwMMZIiZ7tE"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","output_index":0,"content_index":0,"delta":"!","logprobs":[],"obfuscation":"VYhGbSW2JCl6w1K"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":6,"item_id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","output_index":0,"content_index":0,"text":"Oi!","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":7,"item_id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"Oi!"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":8,"output_index":0,"item":{"id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Oi!"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":9,"response":{"id":"resp_05eea6934a1b65980168f237e98214819693e879eb9deb3718","object":"response","created_at":1760704489,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[{"id":"msg_05eea6934a1b65980168f237ea15448196bb4186395ed2288d","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Oi!"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":20,"input_tokens_details":{"cached_tokens":0},"output_tokens":3,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":23},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 413.059208ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ee83f6ab34298e5a38452ff1a80f3c1e30e49193 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool.yaml @@ -0,0 +1,229 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 489 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_010f0015da2b88280168f237ea6c18819e8ce2b72d44ac08b4", + "object": "response", + "created_at": 1760704490, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [ + { + "id": "fc_010f0015da2b88280168f237eb2b7c819eae6470cdee55da77", + "type": "function_call", + "status": "completed", + "arguments": "{\"location\":\"Florence, Italy\"}", + "call_id": "call_59vzLlFlML0RoHvlJxgWZZ7m", + "name": "weather" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 58, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 17, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 75 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.0454615s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 724 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_59vzLlFlML0RoHvlJxgWZZ7m","name":"weather","type":"function_call"},{"call_id":"call_59vzLlFlML0RoHvlJxgWZZ7m","output":"40 C","type":"function_call_output"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0de529b5396cb7cc0168f237eb7d9c81a3aca3fef6a9749a5f", + "object": "response", + "created_at": 1760704491, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [ + { + "id": "msg_0de529b5396cb7cc0168f237ebf0ec81a39a23afc61ca30582", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "The current temperature in Florence, Italy, is 40\u00b0C. If you need more details like humidity or forecast, just let me know!" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 83, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 30, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 113 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.421569667s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..13e5d7737153e94bcc3cdca75c46883a13aa9bde --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o-mini/tool_streaming.yaml @@ -0,0 +1,211 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 503 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0915a342b22b18d50168f237ece814819fbbac6dc48dd0edb2","object":"response","created_at":1760704492,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0915a342b22b18d50168f237ece814819fbbac6dc48dd0edb2","object":"response","created_at":1760704492,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","type":"function_call","status":"in_progress","arguments":"","call_id":"call_ytBD13XK47ACiCTAyn4RZCSb","name":"weather"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":3,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":"{\"","obfuscation":"Hrtnjbqy71fTf2"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":4,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":"location","obfuscation":"pzYupDDV"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":"\":\"","obfuscation":"l8BCOLb4pKgPH"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":"Flor","obfuscation":"XuNP9JDMdMXF"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":"ence","obfuscation":"TFnsqDERhUnk"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":",","obfuscation":"Ot0Lx95tLZ6T2MK"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":" Italy","obfuscation":"6x0z1jEIf7"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":10,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"delta":"\"}","obfuscation":"XxvQGBcCf9Gh8t"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":11,"item_id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","output_index":0,"arguments":"{\"location\":\"Florence, Italy\"}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":12,"output_index":0,"item":{"id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_ytBD13XK47ACiCTAyn4RZCSb","name":"weather"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":13,"response":{"id":"resp_0915a342b22b18d50168f237ece814819fbbac6dc48dd0edb2","object":"response","created_at":1760704492,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[{"id":"fc_0915a342b22b18d50168f237ed7be4819fb7686ac852408033","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_ytBD13XK47ACiCTAyn4RZCSb","name":"weather"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":58,"input_tokens_details":{"cached_tokens":0},"output_tokens":17,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":75},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 236.516125ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 738 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_ytBD13XK47ACiCTAyn4RZCSb","name":"weather","type":"function_call"},{"call_id":"call_ytBD13XK47ACiCTAyn4RZCSb","output":"40 C","type":"function_call_output"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_03b372deeab9afef0168f237edcaac8195a4aa3d164255738c","object":"response","created_at":1760704493,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_03b372deeab9afef0168f237edcaac8195a4aa3d164255738c","object":"response","created_at":1760704493,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":"The","logprobs":[],"obfuscation":"LbJ0zrf2Xlbtt"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" current","logprobs":[],"obfuscation":"gSB6Ljso"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" temperature","logprobs":[],"obfuscation":"6HSV"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" in","logprobs":[],"obfuscation":"2olcAesqOKi1y"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" Florence","logprobs":[],"obfuscation":"nbgdzjL"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"YoZssiZgz5zHS6h"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" Italy","logprobs":[],"obfuscation":"02oJoNSkie"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"pez2xfiPiFc29Ho"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"MFk9ejbypODoX"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"6XX7qV3SfkXCP3E"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":"40","logprobs":[],"obfuscation":"staQ8SeYDAvuUZ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":"°C","logprobs":[],"obfuscation":"jS2kbp5xGRAQKR"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":".","logprobs":[],"obfuscation":"GhbVrcMoP8Je3IX"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" If","logprobs":[],"obfuscation":"aRk18WTNA45gH"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" you","logprobs":[],"obfuscation":"kbEO7bKGPMTR"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" need","logprobs":[],"obfuscation":"k3UWS3v8OLR"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" more","logprobs":[],"obfuscation":"q3E8iPZa3bR"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" details","logprobs":[],"obfuscation":"4PXIjoSv"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" about","logprobs":[],"obfuscation":"QIjhgtABf3"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":23,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" the","logprobs":[],"obfuscation":"jJELxprdIxCs"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":24,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" weather","logprobs":[],"obfuscation":"2uDTEcSy"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":25,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" conditions","logprobs":[],"obfuscation":"8xVDS"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":26,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"TioHCr0j04ibL6K"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":27,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" feel","logprobs":[],"obfuscation":"KW1peE4VWsd"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":28,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" free","logprobs":[],"obfuscation":"es0c6QGaBJt"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":29,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" to","logprobs":[],"obfuscation":"aMZakoFmaTLnI"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":30,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":" ask","logprobs":[],"obfuscation":"tcXPkxUY2xuP"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":31,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"delta":"!","logprobs":[],"obfuscation":"WwWEZBAyOpDhWvp"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":32,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"text":"The current temperature in Florence, Italy, is 40°C. If you need more details about the weather conditions, feel free to ask!","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":33,"item_id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy, is 40°C. If you need more details about the weather conditions, feel free to ask!"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":34,"output_index":0,"item":{"id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy, is 40°C. If you need more details about the weather conditions, feel free to ask!"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":35,"response":{"id":"resp_03b372deeab9afef0168f237edcaac8195a4aa3d164255738c","object":"response","created_at":1760704493,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-mini-2024-07-18","output":[{"id":"msg_03b372deeab9afef0168f237ee2e0881959296453175fdf7c1","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy, is 40°C. If you need more details about the weather conditions, feel free to ask!"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":83,"input_tokens_details":{"cached_tokens":0},"output_tokens":30,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":113},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 394.542125ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..62635da09f5d0a37c4fd44d05eb240a5bb7fe800 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool.yaml @@ -0,0 +1,293 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 834 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0e4ad943aeeb6f440168f237e4ba68819d82d960503add3455", + "object": "response", + "created_at": 1760704484, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-2024-08-06", + "output": [ + { + "id": "fc_0e4ad943aeeb6f440168f237e55708819dbb4bacb951338226", + "type": "function_call", + "status": "completed", + "arguments": "{\"a\":2,\"b\":3}", + "call_id": "call_fWTsR6VaKuyav2YHicLHxgUu", + "name": "add" + }, + { + "id": "fc_0e4ad943aeeb6f440168f237e57510819db015d8ff8e768bdb", + "type": "function_call", + "status": "completed", + "arguments": "{\"a\":2,\"b\":3}", + "call_id": "call_KLpoIGIQ4rbE8b3AWCUaui6g", + "name": "multiply" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "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" + }, + "strict": false + }, + { + "type": "function", + "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" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 54, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 50, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 104 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 991.245209ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1261 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_fWTsR6VaKuyav2YHicLHxgUu","name":"add","type":"function_call"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_KLpoIGIQ4rbE8b3AWCUaui6g","name":"multiply","type":"function_call"},{"call_id":"call_fWTsR6VaKuyav2YHicLHxgUu","output":"5","type":"function_call_output"},{"call_id":"call_KLpoIGIQ4rbE8b3AWCUaui6g","output":"6","type":"function_call_output"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_03837d599fa2bb470168f237e5bb18819c981526bc15969e4b", + "object": "response", + "created_at": 1760704485, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-2024-08-06", + "output": [ + { + "id": "msg_03837d599fa2bb470168f237e6987c819c8c1f2bd707a5ecd0", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "The sum of 2 and 3 is 5, and their product is 6." + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "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" + }, + "strict": false + }, + { + "type": "function", + "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" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 156, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 21, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 177 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.167056291s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0ed7ba6fef75f55b58c8aea2fcd0fe050534c286 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/multi_tool_streaming.yaml @@ -0,0 +1,211 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 831 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0ebade88a03470de0168f237e6e58c819c84da1c8ec78ba7d2","object":"response","created_at":1760704486,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0ebade88a03470de0168f237e6e58c819c84da1c8ec78ba7d2","object":"response","created_at":1760704486,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","type":"function_call","status":"in_progress","arguments":"","call_id":"call_zxaMct5MXAoxOlvCrfOtlCtZ","name":"add"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":3,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"delta":"{","obfuscation":"fCJFJFNkp4P8bMx"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":4,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"delta":"\"a","obfuscation":"O7MZLEoZ8gyHPI"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"delta":"\":","obfuscation":"hTAm6x12gWo3K1"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"delta":"2,","obfuscation":"kITfb9flbFOABd"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"delta":"\"b","obfuscation":"xwg5ZiXbfokw7a"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"delta":"\":","obfuscation":"dG0OUpvC8pgzeh"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"delta":"3}","obfuscation":"XvcAKdjFk0itEn"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":10,"item_id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","output_index":0,"arguments":"{\"a\":2,\"b\":3}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":11,"output_index":0,"item":{"id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_zxaMct5MXAoxOlvCrfOtlCtZ","name":"add"}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":12,"output_index":1,"item":{"id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","type":"function_call","status":"in_progress","arguments":"","call_id":"call_H0ZwSpO6zg8hQFdgz1R0mThA","name":"multiply"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":13,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"delta":"{","obfuscation":"YEf72OYRdag8Aj7"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":14,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"delta":"\"a","obfuscation":"5x1eNl800xF39X"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":15,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"delta":"\":","obfuscation":"iNZ5apaeClogAa"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":16,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"delta":"2,","obfuscation":"3OjGv8FBMD6cfB"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":17,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"delta":"\"b","obfuscation":"YsWSMGJeoKYcas"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":18,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"delta":"\":","obfuscation":"ntum9UcsMIC2oQ"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":19,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"delta":"3}","obfuscation":"cmtfNtk9UsX1US"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":20,"item_id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","output_index":1,"arguments":"{\"a\":2,\"b\":3}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":21,"output_index":1,"item":{"id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_H0ZwSpO6zg8hQFdgz1R0mThA","name":"multiply"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":22,"response":{"id":"resp_0ebade88a03470de0168f237e6e58c819c84da1c8ec78ba7d2","object":"response","created_at":1760704486,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[{"id":"fc_0ebade88a03470de0168f237e7cedc819c8e0e319d3639c441","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_zxaMct5MXAoxOlvCrfOtlCtZ","name":"add"},{"id":"fc_0ebade88a03470de0168f237e7dcb0819cb8bb0bf6e673c0f1","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_H0ZwSpO6zg8hQFdgz1R0mThA","name":"multiply"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":52,"input_tokens_details":{"cached_tokens":0},"output_tokens":50,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":102},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 239.5585ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1258 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_zxaMct5MXAoxOlvCrfOtlCtZ","name":"add","type":"function_call"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_H0ZwSpO6zg8hQFdgz1R0mThA","name":"multiply","type":"function_call"},{"call_id":"call_zxaMct5MXAoxOlvCrfOtlCtZ","output":"5","type":"function_call_output"},{"call_id":"call_H0ZwSpO6zg8hQFdgz1R0mThA","output":"6","type":"function_call_output"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_077c121a3ca3329e0168f237e81de481a092d45b91e6588ae8","object":"response","created_at":1760704488,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_077c121a3ca3329e0168f237e81de481a092d45b91e6588ae8","object":"response","created_at":1760704488,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":"The","logprobs":[],"obfuscation":"2owrUCvUJFBUT"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" sum","logprobs":[],"obfuscation":"cjzIn6Vw53ss"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" of","logprobs":[],"obfuscation":"tPgTY5UTToAa3"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"b2fGuIhqxzmIlfy"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":"2","logprobs":[],"obfuscation":"4PmAyHYuNn7iGjN"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" and","logprobs":[],"obfuscation":"gePgnHt9j6lR"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"YovNQ00Om1zFWv3"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":"3","logprobs":[],"obfuscation":"0PLD6BLk7xZ5IGs"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"gryllz0ZCrkI8"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"KD7wHvYxGbw7jiY"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":"5","logprobs":[],"obfuscation":"sjlU5yKhucEWC8I"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"Fmbamjkh4NwKk5q"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" and","logprobs":[],"obfuscation":"HG6ynXHqm2ru"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" the","logprobs":[],"obfuscation":"7criLQoQ65gL"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" product","logprobs":[],"obfuscation":"meY9ncha"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"pjYCNpKQmBByY"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"84LNfyse8RA3FmS"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":"6","logprobs":[],"obfuscation":"HJPEBcOEzg5QCE2"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"delta":".","logprobs":[],"obfuscation":"xYOursICvKMAOqI"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":23,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"text":"The sum of 2 and 3 is 5, and the product is 6.","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":24,"item_id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"The sum of 2 and 3 is 5, and the product is 6."}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":25,"output_index":0,"item":{"id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The sum of 2 and 3 is 5, and the product is 6."}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":26,"response":{"id":"resp_077c121a3ca3329e0168f237e81de481a092d45b91e6588ae8","object":"response","created_at":1760704488,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[{"id":"msg_077c121a3ca3329e0168f237e87ebc81a0991d3b1ab9200eed","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The sum of 2 and 3 is 5, and the product is 6."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":152,"input_tokens_details":{"cached_tokens":0},"output_tokens":21,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":173},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 239.102917ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d7f886b4c3f3d631e318f19ad0ab524c4f74fe84 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple.yaml @@ -0,0 +1,100 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 205 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"gpt-4o"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_07891da4b653e1470168f237de167081909c53deff29e333b8", + "object": "response", + "created_at": 1760704478, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-2024-08-06", + "output": [ + { + "id": "msg_07891da4b653e1470168f237deab0c8190be2fd9591e3d9afa", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Ol\u00e1!" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 20, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 23 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 941.245125ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5888c35867b7770d74b8405821c16fffd7ad7cde --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/simple_streaming.yaml @@ -0,0 +1,62 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 219 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"gpt-4o","stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_02a83fea833f7e430168f237dee7b08192a3ee0794d16e8574","object":"response","created_at":1760704478,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_02a83fea833f7e430168f237dee7b08192a3ee0794d16e8574","object":"response","created_at":1760704478,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","output_index":0,"content_index":0,"delta":"Olá","logprobs":[],"obfuscation":"PURwA0yAiQYg4"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","output_index":0,"content_index":0,"delta":"!","logprobs":[],"obfuscation":"J47DmBbNkTc5h5k"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":6,"item_id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","output_index":0,"content_index":0,"text":"Olá!","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":7,"item_id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":8,"output_index":0,"item":{"id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":9,"response":{"id":"resp_02a83fea833f7e430168f237dee7b08192a3ee0794d16e8574","object":"response","created_at":1760704478,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[{"id":"msg_02a83fea833f7e430168f237df67988192ae502a743f847a80","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":20,"input_tokens_details":{"cached_tokens":0},"output_tokens":3,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":23},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 232.38575ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dde370d5a3e520c43cd4ca388bae74f61ac544c8 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool.yaml @@ -0,0 +1,229 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 484 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_05f862a82ed768dc0168f237df9eac81a09b83a647320323a6", + "object": "response", + "created_at": 1760704479, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-2024-08-06", + "output": [ + { + "id": "fc_05f862a82ed768dc0168f237e0123c81a090b0b89afe5c9f72", + "type": "function_call", + "status": "completed", + "arguments": "{\"location\":\"Florence, Italy\"}", + "call_id": "call_jPXpCiiHqnkbYK8RbeLZfkLR", + "name": "weather" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 58, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 17, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 75 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 777.148541ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 719 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_jPXpCiiHqnkbYK8RbeLZfkLR","name":"weather","type":"function_call"},{"call_id":"call_jPXpCiiHqnkbYK8RbeLZfkLR","output":"40 C","type":"function_call_output"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0122dddaaa9675250168f237e06e9481948f2a870e82765495", + "object": "response", + "created_at": 1760704480, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-4o-2024-08-06", + "output": [ + { + "id": "msg_0122dddaaa9675250168f237e16ed481948bdad89376f1431a", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "The current temperature in Florence, Italy is 40\u00b0C. Stay cool and hydrated!" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 83, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 19, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 102 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.512680875s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da55222c05c67d31f8d26f9f20a4b918c836ec11 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-4o/tool_streaming.yaml @@ -0,0 +1,163 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 498 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0ac5f2ba0b4c0b830168f237e1ee10819dbe53070aa00ae06a","object":"response","created_at":1760704481,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0ac5f2ba0b4c0b830168f237e1ee10819dbe53070aa00ae06a","object":"response","created_at":1760704481,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","type":"function_call","status":"in_progress","arguments":"","call_id":"call_Zvcj4GFYqfvf8AcNIB0Ra8is","name":"weather"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":3,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":"{\"","obfuscation":"2GAUmPtuwiNdYV"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":4,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":"location","obfuscation":"au0PIDR3"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":"\":\"","obfuscation":"FJYeCiQOcRosn"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":"Flor","obfuscation":"E9SXHAGEvpMC"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":"ence","obfuscation":"Sezl9leQQI91"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":",","obfuscation":"EL65bbUJbktS4Tq"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":"Italy","obfuscation":"3paXU4gUFjJ"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":10,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"delta":"\"}","obfuscation":"RWw8uxX409IAgP"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":11,"item_id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","output_index":0,"arguments":"{\"location\":\"Florence,Italy\"}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":12,"output_index":0,"item":{"id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence,Italy\"}","call_id":"call_Zvcj4GFYqfvf8AcNIB0Ra8is","name":"weather"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":13,"response":{"id":"resp_0ac5f2ba0b4c0b830168f237e1ee10819dbe53070aa00ae06a","object":"response","created_at":1760704481,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[{"id":"fc_0ac5f2ba0b4c0b830168f237e2f3d0819d8b008d01089913c8","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence,Italy\"}","call_id":"call_Zvcj4GFYqfvf8AcNIB0Ra8is","name":"weather"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":58,"input_tokens_details":{"cached_tokens":0},"output_tokens":17,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":75},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 259.382959ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 732 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"system"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence,Italy\\\"}\"","call_id":"call_Zvcj4GFYqfvf8AcNIB0Ra8is","name":"weather","type":"function_call"},{"call_id":"call_Zvcj4GFYqfvf8AcNIB0Ra8is","output":"40 C","type":"function_call_output"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_06731cb9fb4e5ca10168f237e386788196af9a9096ab039479","object":"response","created_at":1760704483,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_06731cb9fb4e5ca10168f237e386788196af9a9096ab039479","object":"response","created_at":1760704483,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":"The","logprobs":[],"obfuscation":"Cgwi5P8IgS9WC"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":" current","logprobs":[],"obfuscation":"E0r0sSyh"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":" temperature","logprobs":[],"obfuscation":"RF23"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":" in","logprobs":[],"obfuscation":"jlg35ceRDkKXk"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":" Florence","logprobs":[],"obfuscation":"EDwr3ta"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"FxbKO1NyhPWzcR4"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":" Italy","logprobs":[],"obfuscation":"4DdeFdQGAC"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"jMNhe6GuRNzQb"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"gvoxDRWu7wmp9EI"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":"40","logprobs":[],"obfuscation":"xNieQmyGcRt9XH"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":"°C","logprobs":[],"obfuscation":"BkGN6qzwpQMLmt"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"delta":".","logprobs":[],"obfuscation":"wpXzyrGKXvqZ4cU"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":16,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"text":"The current temperature in Florence, Italy is 40°C.","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":17,"item_id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C."}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":18,"output_index":0,"item":{"id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C."}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":19,"response":{"id":"resp_06731cb9fb4e5ca10168f237e386788196af9a9096ab039479","object":"response","created_at":1760704483,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-4o-2024-08-06","output":[{"id":"msg_06731cb9fb4e5ca10168f237e4477881968e966f3aca367554","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":83,"input_tokens_details":{"cached_tokens":0},"output_tokens":14,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":97},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 438.122375ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b69208afb7a427228e9d01e5b9bb6048f64c2a17 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool.yaml @@ -0,0 +1,298 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 836 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"developer"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0a67406c0312cd3d0168f23808e21081a19469bdae7c79e9a1", + "object": "response", + "created_at": 1760704520, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-5-2025-08-07", + "output": [ + { + "id": "rs_0a67406c0312cd3d0168f238093ecc81a1bdba7329dca10274", + "type": "reasoning", + "summary": [] + }, + { + "id": "fc_0a67406c0312cd3d0168f2380c363c81a185a8cb8507231fa5", + "type": "function_call", + "status": "completed", + "arguments": "{\"a\":2,\"b\":3}", + "call_id": "call_4zp4utiXe14bjLO4jtMZEjT9", + "name": "add" + }, + { + "id": "fc_0a67406c0312cd3d0168f2380c544081a18909136702882f58", + "type": "function_call", + "status": "completed", + "arguments": "{\"a\":2,\"b\":3}", + "call_id": "call_4RkbJhNCkvdVClgNEsmTa3lb", + "name": "multiply" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "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" + }, + "strict": false + }, + { + "type": "function", + "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" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 58, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 248, + "output_tokens_details": { + "reasoning_tokens": 192 + }, + "total_tokens": 306 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 3.821118208s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1263 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. CRITICAL: Always use both add and multiply at the same time ALWAYS.","role":"developer"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_4zp4utiXe14bjLO4jtMZEjT9","name":"add","type":"function_call"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_4RkbJhNCkvdVClgNEsmTa3lb","name":"multiply","type":"function_call"},{"call_id":"call_4zp4utiXe14bjLO4jtMZEjT9","output":"5","type":"function_call_output"},{"call_id":"call_4RkbJhNCkvdVClgNEsmTa3lb","output":"6","type":"function_call_output"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_02b2a4b073ba53220168f2380cb3a48190926547554955da24", + "object": "response", + "created_at": 1760704524, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-5-2025-08-07", + "output": [ + { + "id": "msg_02b2a4b073ba53220168f2380d87508190bfa30618f00b704e", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Results for the numbers 2 and 3:\n- Addition: 5\n- Multiplication: 6" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "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" + }, + "strict": false + }, + { + "type": "function", + "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" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 176, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 26, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 202 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.3138075s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f1dfe25815f215c1c32c6a889b15932091a69367 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/multi_tool_streaming.yaml @@ -0,0 +1,202 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 833 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"developer"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_09e381d930f3da290168f2380e007c819eb0824a9f89df2473","object":"response","created_at":1760704526,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_09e381d930f3da290168f2380e007c819eb0824a9f89df2473","object":"response","created_at":1760704526,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_09e381d930f3da290168f2380e6048819e8e16dbff603275ca","type":"reasoning","summary":[]}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_09e381d930f3da290168f2380e6048819e8e16dbff603275ca","type":"reasoning","summary":[]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","type":"function_call","status":"in_progress","arguments":"","call_id":"call_mM0OA8cwZxVibTLUQ0tgfuRL","name":"add"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"delta":"{","obfuscation":"A28LVm1DiTYj9iJ"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"delta":"\"a","obfuscation":"JPXaoVvKkpCAKM"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"delta":"\":","obfuscation":"uqXm9A6BWRrQW9"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"delta":"2,","obfuscation":"rSjqV8JLpcXCyy"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"delta":"\"b","obfuscation":"vHlTgn3pkcFggt"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":10,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"delta":"\":","obfuscation":"FGSSNQEHMtsOQ9"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":11,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"delta":"3}","obfuscation":"yQg8YUXPlb0xkd"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":12,"item_id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","output_index":1,"arguments":"{\"a\":2,\"b\":3}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":13,"output_index":1,"item":{"id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_mM0OA8cwZxVibTLUQ0tgfuRL","name":"add"}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":14,"output_index":2,"item":{"id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","type":"function_call","status":"in_progress","arguments":"","call_id":"call_ZN5JKJlLQZfBL7JTpEHES3Sm","name":"multiply"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":15,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"delta":"{","obfuscation":"8dJcK7PD3X9jvxe"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":16,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"delta":"\"a","obfuscation":"D9AcojCGoP0XoR"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":17,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"delta":"\":","obfuscation":"LWpcm2Co0t9wOb"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":18,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"delta":"2,","obfuscation":"mdBjj4nf2MtHzU"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":19,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"delta":"\"b","obfuscation":"TCZjctdZylEM7V"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":20,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"delta":"\":","obfuscation":"AW3CGCQsAgdcuq"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":21,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"delta":"3}","obfuscation":"woholi6rbpmqFw"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":22,"item_id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","output_index":2,"arguments":"{\"a\":2,\"b\":3}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":23,"output_index":2,"item":{"id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_ZN5JKJlLQZfBL7JTpEHES3Sm","name":"multiply"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":24,"response":{"id":"resp_09e381d930f3da290168f2380e007c819eb0824a9f89df2473","object":"response","created_at":1760704526,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_09e381d930f3da290168f2380e6048819e8e16dbff603275ca","type":"reasoning","summary":[]},{"id":"fc_09e381d930f3da290168f23811471c819e9b878cd97d590c70","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_mM0OA8cwZxVibTLUQ0tgfuRL","name":"add"},{"id":"fc_09e381d930f3da290168f238115664819ea231c4078a5f0376","type":"function_call","status":"completed","arguments":"{\"a\":2,\"b\":3}","call_id":"call_ZN5JKJlLQZfBL7JTpEHES3Sm","name":"multiply"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":56,"input_tokens_details":{"cached_tokens":0},"output_tokens":311,"output_tokens_details":{"reasoning_tokens":256},"total_tokens":367},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 283.240959ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1260 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"developer"},{"content":[{"text":"Add and multiply the number 2 and 3","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_mM0OA8cwZxVibTLUQ0tgfuRL","name":"add","type":"function_call"},{"arguments":"\"{\\\"a\\\":2,\\\"b\\\":3}\"","call_id":"call_ZN5JKJlLQZfBL7JTpEHES3Sm","name":"multiply","type":"function_call"},{"call_id":"call_mM0OA8cwZxVibTLUQ0tgfuRL","output":"5","type":"function_call_output"},{"call_id":"call_ZN5JKJlLQZfBL7JTpEHES3Sm","output":"6","type":"function_call_output"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers","type":"function"},{"strict":false,"parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_09bb7d797077bd810168f23811b088819fb2b1949e8dca30ed","object":"response","created_at":1760704529,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_09bb7d797077bd810168f23811b088819fb2b1949e8dca30ed","object":"response","created_at":1760704529,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":"Results","logprobs":[],"obfuscation":"6StWlhs3v"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":":\n","logprobs":[],"obfuscation":"7HlDzzfB4tGg8e"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":"-","logprobs":[],"obfuscation":"aSgNiqlzrKxjwYJ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":" Addition","logprobs":[],"obfuscation":"1kIs9Fe"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":":","logprobs":[],"obfuscation":"N8ePsIjPQkwgIIm"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"tDupEgp74kvVegn"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":"5","logprobs":[],"obfuscation":"TXGo0Bhtqs0YNF5"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":"\n","logprobs":[],"obfuscation":"sUe555ChDTIWxUy"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":"-","logprobs":[],"obfuscation":"LnlsBondAJmfbak"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":" Multip","logprobs":[],"obfuscation":"5vR7Ad1x4"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":"lication","logprobs":[],"obfuscation":"2tYg9jRB"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":":","logprobs":[],"obfuscation":"35cmlvHPfcNwftK"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"paqGVy5mDHZwDrl"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"delta":"6","logprobs":[],"obfuscation":"7GUVgOzItgYc95c"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":18,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"text":"Results:\n- Addition: 5\n- Multiplication: 6","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":19,"item_id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"Results:\n- Addition: 5\n- Multiplication: 6"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":20,"output_index":0,"item":{"id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Results:\n- Addition: 5\n- Multiplication: 6"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":21,"response":{"id":"resp_09bb7d797077bd810168f23811b088819fb2b1949e8dca30ed","object":"response","created_at":1760704529,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"msg_09bb7d797077bd810168f238125ad4819f84cc331e42e9f26c","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Results:\n- Addition: 5\n- Multiplication: 6"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","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"},"strict":false},{"type":"function","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"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":172,"input_tokens_details":{"cached_tokens":0},"output_tokens":18,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":190},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 250.805041ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0d497eaf748cbc155420f659ff13705d4307d178 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple.yaml @@ -0,0 +1,105 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 207 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"gpt-5"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0b81ac5fdc5483560168f237f54ccc81968efa75aba7162889", + "object": "response", + "created_at": 1760704501, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-5-2025-08-07", + "output": [ + { + "id": "rs_0b81ac5fdc5483560168f237f6618881968521aadd267daa6a", + "type": "reasoning", + "summary": [] + }, + { + "id": "msg_0b81ac5fdc5483560168f237f84b6c81968619287b3bf9dee9", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Oi!" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 19, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 136, + "output_tokens_details": { + "reasoning_tokens": 128 + }, + "total_tokens": 155 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 3.478110792s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..83dd08ea6e91bd8c1422ccd884472d9b54917cef --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/simple_streaming.yaml @@ -0,0 +1,68 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 221 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"gpt-5","stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_06f879733b735e3a0168f237f8c33481a2ba14b36d6b67d967","object":"response","created_at":1760704504,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_06f879733b735e3a0168f237f8c33481a2ba14b36d6b67d967","object":"response","created_at":1760704504,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_06f879733b735e3a0168f237f941a481a28d55b9bcf8fe577c","type":"reasoning","summary":[]}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_06f879733b735e3a0168f237f941a481a28d55b9bcf8fe577c","type":"reasoning","summary":[]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":5,"item_id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","output_index":1,"content_index":0,"delta":"Olá","logprobs":[],"obfuscation":"UqLDi4LzR6EDJ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","output_index":1,"content_index":0,"delta":"!","logprobs":[],"obfuscation":"nohgR94nfxqT0xc"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":8,"item_id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","output_index":1,"content_index":0,"text":"Olá!","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":9,"item_id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":10,"output_index":1,"item":{"id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":11,"response":{"id":"resp_06f879733b735e3a0168f237f8c33481a2ba14b36d6b67d967","object":"response","created_at":1760704504,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_06f879733b735e3a0168f237f941a481a28d55b9bcf8fe577c","type":"reasoning","summary":[]},{"id":"msg_06f879733b735e3a0168f237fac9c481a2b3a561bc2c54232c","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":19,"input_tokens_details":{"cached_tokens":0},"output_tokens":136,"output_tokens_details":{"reasoning_tokens":128},"total_tokens":155},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 252.58825ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..24587f0a92ca9fc2064ea35ca3d198379b94d71b --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool.yaml @@ -0,0 +1,239 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 486 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_03c1862e0741d1d40168f237fb21e88191bbe5c97d0994130f", + "object": "response", + "created_at": 1760704507, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-5-2025-08-07", + "output": [ + { + "id": "rs_03c1862e0741d1d40168f237fb807c819194656e80eb126a65", + "type": "reasoning", + "summary": [] + }, + { + "id": "fc_03c1862e0741d1d40168f237fce0c88191a227de0e0fc29c2c", + "type": "function_call", + "status": "completed", + "arguments": "{\"location\":\"Florence, Italy\"}", + "call_id": "call_pG7sDgSfcLvcZrGGJrH3Z3aQ", + "name": "weather" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 66, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 86, + "output_tokens_details": { + "reasoning_tokens": 64 + }, + "total_tokens": 152 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.09006325s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 721 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_pG7sDgSfcLvcZrGGJrH3Z3aQ","name":"weather","type":"function_call"},{"call_id":"call_pG7sDgSfcLvcZrGGJrH3Z3aQ","output":"40 C","type":"function_call_output"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_00c0656fa55dff4a0168f237fd3b9c8196bd4e4de8737e9452", + "object": "response", + "created_at": 1760704509, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "gpt-5-2025-08-07", + "output": [ + { + "id": "rs_00c0656fa55dff4a0168f237fdc064819691999ce73a7ce97a", + "type": "reasoning", + "summary": [] + }, + { + "id": "msg_00c0656fa55dff4a0168f2380148748196b3987065a61dba12", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Right now in Florence, Italy it\u2019s about 40\u00b0C. Would you like the forecast or details like humidity and wind?" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 97, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 287, + "output_tokens_details": { + "reasoning_tokens": 256 + }, + "total_tokens": 384 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 4.618793667s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a64d062e53a34af514922753544d147ccebb9622 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-gpt-5/tool_streaming.yaml @@ -0,0 +1,217 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 500 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0f08b04cd21bd82c0168f23801d5c881a2b0d9b07784b8413a","object":"response","created_at":1760704513,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0f08b04cd21bd82c0168f23801d5c881a2b0d9b07784b8413a","object":"response","created_at":1760704513,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_0f08b04cd21bd82c0168f2380221f881a290014a36b8e479a4","type":"reasoning","summary":[]}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_0f08b04cd21bd82c0168f2380221f881a290014a36b8e479a4","type":"reasoning","summary":[]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","type":"function_call","status":"in_progress","arguments":"","call_id":"call_kGfQAVJ6MRnp9dXE2d0uYojD","name":"weather"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":"{\"","obfuscation":"xcxYsutrsF2Mr3"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":"location","obfuscation":"wSCxPmqE"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":"\":\"","obfuscation":"UNB0sKeiNNVya"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":"Flor","obfuscation":"nmio6Y5KgBCY"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":"ence","obfuscation":"dnccg49kl0GV"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":10,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":",","obfuscation":"zwu8CHinn8HhyUq"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":11,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":" Italy","obfuscation":"JrzifooHsu"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":12,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"delta":"\"}","obfuscation":"EOPhpWvCbvwgkS"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":13,"item_id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","output_index":1,"arguments":"{\"location\":\"Florence, Italy\"}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":14,"output_index":1,"item":{"id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_kGfQAVJ6MRnp9dXE2d0uYojD","name":"weather"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":15,"response":{"id":"resp_0f08b04cd21bd82c0168f23801d5c881a2b0d9b07784b8413a","object":"response","created_at":1760704513,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_0f08b04cd21bd82c0168f2380221f881a290014a36b8e479a4","type":"reasoning","summary":[]},{"id":"fc_0f08b04cd21bd82c0168f23803cc1481a28dc92074ab71c2e0","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_kGfQAVJ6MRnp9dXE2d0uYojD","name":"weather"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":66,"input_tokens_details":{"cached_tokens":0},"output_tokens":150,"output_tokens_details":{"reasoning_tokens":128},"total_tokens":216},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 281.778583ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 735 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_kGfQAVJ6MRnp9dXE2d0uYojD","name":"weather","type":"function_call"},{"call_id":"call_kGfQAVJ6MRnp9dXE2d0uYojD","output":"40 C","type":"function_call_output"}],"model":"gpt-5","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0eaa9d097b2a92720168f238043bb481929c94d445e6308cf0","object":"response","created_at":1760704516,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0eaa9d097b2a92720168f238043bb481929c94d445e6308cf0","object":"response","created_at":1760704516,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_0eaa9d097b2a92720168f23804ce888192b7336b8d4035a45d","type":"reasoning","summary":[]}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_0eaa9d097b2a92720168f23804ce888192b7336b8d4035a45d","type":"reasoning","summary":[]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":5,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"It","logprobs":[],"obfuscation":"qcuOrpMigLjgYx"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"’s","logprobs":[],"obfuscation":"BPKnl3lugU0n8Q"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" currently","logprobs":[],"obfuscation":"MoQlwI"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" about","logprobs":[],"obfuscation":"jJLAHeLcaa"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"T7DA0KFl7T9dCNp"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"40","logprobs":[],"obfuscation":"iqIKIEx7Vvby8v"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"°C","logprobs":[],"obfuscation":"Z6SUC2Ijtf39QQ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" (","logprobs":[],"obfuscation":"0fdEh8YqW52Eln"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"104","logprobs":[],"obfuscation":"NPDD9eImQzTaO"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"°F","logprobs":[],"obfuscation":"2v6RZJh1tMZuzH"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":")","logprobs":[],"obfuscation":"acclkkaR3ZuJLEO"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" in","logprobs":[],"obfuscation":"mAqi3AUpM4err"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" Florence","logprobs":[],"obfuscation":"EzqWNVR"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":",","logprobs":[],"obfuscation":"V9xzbMRz64sqFUh"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" Italy","logprobs":[],"obfuscation":"0Icvry5xOU"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":".","logprobs":[],"obfuscation":"pmxPGojorJXet5q"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" Would","logprobs":[],"obfuscation":"qbbDMSp9OW"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":23,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" you","logprobs":[],"obfuscation":"aektY0mnj2fu"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":24,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" like","logprobs":[],"obfuscation":"WHfweP6M2nZ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":25,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" today","logprobs":[],"obfuscation":"vKe3upqWqt"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":26,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"’s","logprobs":[],"obfuscation":"NZe03vwqxO25tr"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":27,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" forecast","logprobs":[],"obfuscation":"Mm5i3mS"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":28,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" or","logprobs":[],"obfuscation":"SQ8WZNc7b96eu"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":29,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" hourly","logprobs":[],"obfuscation":"rNTUCs5ZP"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":30,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":" details","logprobs":[],"obfuscation":"DCaRtQ80"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":31,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"delta":"?","logprobs":[],"obfuscation":"CunNisEbweeNHGk"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":32,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"text":"It’s currently about 40°C (104°F) in Florence, Italy. Would you like today’s forecast or hourly details?","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":33,"item_id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"It’s currently about 40°C (104°F) in Florence, Italy. Would you like today’s forecast or hourly details?"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":34,"output_index":1,"item":{"id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"It’s currently about 40°C (104°F) in Florence, Italy. Would you like today’s forecast or hourly details?"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":35,"response":{"id":"resp_0eaa9d097b2a92720168f238043bb481929c94d445e6308cf0","object":"response","created_at":1760704516,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_0eaa9d097b2a92720168f23804ce888192b7336b8d4035a45d","type":"reasoning","summary":[]},{"id":"msg_0eaa9d097b2a92720168f238084de88192bd4307c15498a6c0","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"It’s currently about 40°C (104°F) in Florence, Italy. Would you like today’s forecast or hourly details?"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":97,"input_tokens_details":{"cached_tokens":0},"output_tokens":288,"output_tokens_details":{"reasoning_tokens":256},"total_tokens":385},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 316.59475ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0fa6e17ea7462b88e989a99dce35d41d2e043afa --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple.yaml @@ -0,0 +1,105 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 209 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"o4-mini"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_05edda4810c41de00168f23812e34481909c921eeab19085a0", + "object": "response", + "created_at": 1760704531, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "o4-mini-2025-04-16", + "output": [ + { + "id": "rs_05edda4810c41de00168f2381383e08190b96c0313059265a9", + "type": "reasoning", + "summary": [] + }, + { + "id": "msg_05edda4810c41de00168f23814db48819083a54f56411e35a5", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Oi!" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 19, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 136, + "output_tokens_details": { + "reasoning_tokens": 128 + }, + "total_tokens": 155 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.327569333s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e20550d6c587b1266cf80b11c54c1a321a73fdad --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/simple_streaming.yaml @@ -0,0 +1,68 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 223 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"Say hi in Portuguese","type":"input_text"}],"role":"user"}],"model":"o4-mini","stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0374dd39c9ea81bb0168f2381531e88192bcc27c60d5000651","object":"response","created_at":1760704533,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0374dd39c9ea81bb0168f2381531e88192bcc27c60d5000651","object":"response","created_at":1760704533,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_0374dd39c9ea81bb0168f23815fe108192a9693e4138d05838","type":"reasoning","summary":[]}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_0374dd39c9ea81bb0168f23815fe108192a9693e4138d05838","type":"reasoning","summary":[]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":5,"item_id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","output_index":1,"content_index":0,"delta":"Olá","logprobs":[],"obfuscation":"XyHUJi8uWmgQ3"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","output_index":1,"content_index":0,"delta":"!","logprobs":[],"obfuscation":"CKZwM0j52RoATdL"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":8,"item_id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","output_index":1,"content_index":0,"text":"Olá!","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":9,"item_id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":10,"output_index":1,"item":{"id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":11,"response":{"id":"resp_0374dd39c9ea81bb0168f2381531e88192bcc27c60d5000651","object":"response","created_at":1760704533,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[{"id":"rs_0374dd39c9ea81bb0168f23815fe108192a9693e4138d05838","type":"reasoning","summary":[]},{"id":"msg_0374dd39c9ea81bb0168f23816fc108192bbffb179beace674","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Olá!"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":19,"input_tokens_details":{"cached_tokens":0},"output_tokens":136,"output_tokens_details":{"reasoning_tokens":128},"total_tokens":155},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 283.477417ms diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool.yaml new file mode 100644 index 0000000000000000000000000000000000000000..34708fa7947c0592565e0e1fbe30dbabf909a37a --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool.yaml @@ -0,0 +1,234 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 488 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"o4-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_063e69ebba23c6e60168f238176014819580347bfecdcc350e", + "object": "response", + "created_at": 1760704535, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "o4-mini-2025-04-16", + "output": [ + { + "id": "rs_063e69ebba23c6e60168f2381811ac8195bb719fa83683583a", + "type": "reasoning", + "summary": [] + }, + { + "id": "fc_063e69ebba23c6e60168f238191b248195a04018e0d0c747bb", + "type": "function_call", + "status": "completed", + "arguments": "{\"location\":\"Florence, Italy\"}", + "call_id": "call_3gTKulKFbPDpkRO7k5I0ffH2", + "name": "weather" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 60, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 150, + "output_tokens_details": { + "reasoning_tokens": 128 + }, + "total_tokens": 210 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 2.194950333s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 723 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_3gTKulKFbPDpkRO7k5I0ffH2","name":"weather","type":"function_call"},{"call_id":"call_3gTKulKFbPDpkRO7k5I0ffH2","output":"40 C","type":"function_call_output"}],"model":"o4-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0bed20b0e88328550168f238198a5c81a0947a649d11fb2237", + "object": "response", + "created_at": 1760704537, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 4000, + "max_tool_calls": null, + "model": "o4-mini-2025-04-16", + "output": [ + { + "id": "msg_0bed20b0e88328550168f23819fad081a090a3ce83d605449e", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "The current temperature in Florence, Italy is 40\u00b0C. It\u2019s quite hot! Make sure to stay hydrated, wear light clothing, and seek shade or air-conditioned places when possible. If you plan to be outdoors, consider going early in the morning or later in the evening to avoid peak heat." + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 91, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 64, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 155 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.272683542s diff --git a/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool_streaming.yaml b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool_streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..92d95d25a84ea629edba89304e94746ed2e9412e --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesCommon/openai-o4-mini/tool_streaming.yaml @@ -0,0 +1,169 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 502 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"}],"model":"o4-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0fff4a7c1f563e500168f2381ad21c819e8d405acd7b5d620a","object":"response","created_at":1760704538,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0fff4a7c1f563e500168f2381ad21c819e8d405acd7b5d620a","object":"response","created_at":1760704538,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_0fff4a7c1f563e500168f2381b32b0819ead0ce19c5404dec1","type":"reasoning","summary":[]}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_0fff4a7c1f563e500168f2381b32b0819ead0ce19c5404dec1","type":"reasoning","summary":[]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","type":"function_call","status":"in_progress","arguments":"","call_id":"call_UszlYsP9zWWt4KA9WuQwyxdm","name":"weather"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":"{\"","obfuscation":"0VOTJGynsRMloj"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":"location","obfuscation":"43dCYsDX"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":"\":\"","obfuscation":"rc3sKD04Npkkf"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":"Flor","obfuscation":"s3bnH4WQP4Cb"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":"ence","obfuscation":"y9JNPlQMT6YX"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":10,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":",","obfuscation":"w8Zt7ULkOyHEuSK"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":11,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":" Italy","obfuscation":"6GaIjNSMTu"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":12,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"delta":"\"}","obfuscation":"4eavzEAMPbOXlx"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":13,"item_id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","output_index":1,"arguments":"{\"location\":\"Florence, Italy\"}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":14,"output_index":1,"item":{"id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_UszlYsP9zWWt4KA9WuQwyxdm","name":"weather"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":15,"response":{"id":"resp_0fff4a7c1f563e500168f2381ad21c819e8d405acd7b5d620a","object":"response","created_at":1760704538,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[{"id":"rs_0fff4a7c1f563e500168f2381b32b0819ead0ce19c5404dec1","type":"reasoning","summary":[]},{"id":"fc_0fff4a7c1f563e500168f2381c9e38819e9f1631fafe9b714d","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_UszlYsP9zWWt4KA9WuQwyxdm","name":"weather"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":60,"input_tokens_details":{"cached_tokens":0},"output_tokens":150,"output_tokens_details":{"reasoning_tokens":128},"total_tokens":210},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 241.611625ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 737 + host: "" + body: '{"max_output_tokens":4000,"store":false,"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence,Italy?","type":"input_text"}],"role":"user"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_UszlYsP9zWWt4KA9WuQwyxdm","name":"weather","type":"function_call"},{"call_id":"call_UszlYsP9zWWt4KA9WuQwyxdm","output":"40 C","type":"function_call_output"}],"model":"o4-mini","tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0dcc08c733ff71550168f2381d2a1081a2846a305f27bbc863","object":"response","created_at":1760704541,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0dcc08c733ff71550168f2381d2a1081a2846a305f27bbc863","object":"response","created_at":1760704541,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":"The","logprobs":[],"obfuscation":"eyjSsgALEwhaq"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":" current","logprobs":[],"obfuscation":"8lINdioG"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":" temperature","logprobs":[],"obfuscation":"iz5j"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":" in","logprobs":[],"obfuscation":"tJkN0FEyXaK8s"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":" Florence","logprobs":[],"obfuscation":"n0EpdRL"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"xAWfObum6kfDhuQ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":" Italy","logprobs":[],"obfuscation":"SJOq4btOnE"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"8HoJkvOcK3Jsc"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"51n6LMmqmV5C73I"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":"40","logprobs":[],"obfuscation":"MPplkcPECUV7Pv"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":"°C","logprobs":[],"obfuscation":"MiSC5pzAiiBwR4"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"delta":".","logprobs":[],"obfuscation":"H2yQ4qGmNmJhbhZ"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":16,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"text":"The current temperature in Florence, Italy is 40°C.","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":17,"item_id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C."}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":18,"output_index":0,"item":{"id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C."}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":19,"response":{"id":"resp_0dcc08c733ff71550168f2381d2a1081a2846a305f27bbc863","object":"response","created_at":1760704541,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":4000,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[{"id":"msg_0dcc08c733ff71550168f2381d703881a280ee31f3e6de9bdc","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":91,"input_tokens_details":{"cached_tokens":0},"output_tokens":16,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":107},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 235.374ms diff --git a/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking-streaming.yaml b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking-streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5c9da36e56222fb8131673759b274102115f0612 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking-streaming.yaml @@ -0,0 +1,499 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 565 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-5","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_00564a370f8761470168f239a3f90c819492eb21bd9b25c369","object":"response","created_at":1760704932,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_00564a370f8761470168f239a3f90c819492eb21bd9b25c369","object":"response","created_at":1760704932,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","type":"reasoning","encrypted_content":"gAAAAABo8jmkhn3gO_TMlHP7zrmqSQK6e2YwCe3YftZKY9Y9Am0N47nufS0EOe2c40Ie_ULjJ_I4NfuJMK2z4f-hl32bIn-6n_VLQtWy0JNg5qIiYspMtmsGPDKY0PqVj8rmYPrrH6UBrnmjOIwiBy-owTkt4-iRe7p39ooEi23aAg7edh9Cus926ptNWnCyRd5LBxp_pLeUBbjcnyZKbN8sHpHkYBXi-d3tKM1w5RKtWwNk1iYZeSpMnFeu-0Rh6ybotX-rx9IRZceu-zOBPpk0Be52EqZGZNZtB7mmsfX9VainX3PHsAviBrwTJH5dSBMpRft_Mw0YE-rVBCcCRk-aDqJbxDgxndIFci_GHsu-iPuwV-kyIGiIMT_m1n_DSnQAkdY5Ur9gLMu0x91oug9mePtyoUf5SEIw4HLUVRESBhxg1pZr-QR1dv-qTjjyaJnRVQFEFcaKxUxRbKUEoMP3T1sg72LBP2kh6t9GtwNjPD5S63TjWBGogzHfOlc2WmiMzG6B0kY9xFh7wIM9XqbRvggxnNK37ltLB57lL73RckCP_4A2rLypjDmeewnDF0xLsKjVh_KHMMMrcMro__2EDnCIMpyWn5PFlEqHoAn1XcL81NSSxqgc12LYfTy4AddcrLUyNY0TDoV7J40oprdDPmD7SdTPcg9j4NXyQcDwcs_rsa_mtY4XH--Qd7EdCCOETDAaHi8uzz1Ig1gHGE-2sivK_NCqIUjX9IifDBZ_EycsiRhvoqKK58aE6ZxAKMzuvQZSGid9avuGUzO_bSvuCLVfYMeLsR2twj__CX6yXLvkHy3WebfqsABEFbklAp1A3ZAn17FJ","summary":[]}} + + event: response.reasoning_summary_part.added + data: {"type":"response.reasoning_summary_part.added","sequence_number":3,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":""}} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":4,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":"I","obfuscation":"7DRBaSVGkoaUAGo"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":5,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" need","obfuscation":"1X0SoR7ISWG"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":6,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" to","obfuscation":"rthsd0jwgCyFz"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":7,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" remember","obfuscation":"ovHzzWZ"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":8,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" that","obfuscation":"uFz4k3UMlvC"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":9,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" the","obfuscation":"ltZlzfZ0yU6l"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":10,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" system","obfuscation":"8E6OkTKuV"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":11,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" indicates","obfuscation":"gTEV0Q"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":12,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" today's","obfuscation":"fpcWImre"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":13,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" date","obfuscation":"XYRrFEZomsM"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":14,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" as","obfuscation":"O3uyLbWk7Rkyf"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":15,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" October","obfuscation":"vqWPqbvD"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":16,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" 17","obfuscation":"nJ0JxYcuYNPaP"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":17,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":",","obfuscation":"zoEdGGnU4ew1zgL"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":18,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" 202","obfuscation":"YHWc9ZA6FhfW"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":19,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":"5","obfuscation":"ocF7ItddWql3cK8"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":20,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":".","obfuscation":"OFEXxPmTEfDageA"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":21,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" However","obfuscation":"AuUibTSe"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":22,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":",","obfuscation":"djJeFeKA9erQeeF"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":23,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" it","obfuscation":"oOgKLlZwbAhf2"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":24,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" seems","obfuscation":"ppPNCSReg7"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":25,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" the","obfuscation":"N1D0YyAZN45u"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":26,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" weather","obfuscation":"gy2PjbA7"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":27,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" tool","obfuscation":"ahaAH7nhXKw"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":28,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" will","obfuscation":"fELLVUIuNhf"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":29,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" return","obfuscation":"WJCOBWkkN"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":30,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" the","obfuscation":"HLJ5Lrkofh1F"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":31,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" current","obfuscation":"zDz8Xlwy"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":32,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" weather","obfuscation":"9sgtkxk6"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":33,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" for","obfuscation":"perCAhVfTp77"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":34,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" that","obfuscation":"IKnXSFx60T2"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":35,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" date","obfuscation":"wXTCiZMX0Yo"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":36,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":",","obfuscation":"OB0ZYz037xsGeqj"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":37,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" rather","obfuscation":"lwAfwyfW2"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":38,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" than","obfuscation":"jtqrK627sv2"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":39,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" needing","obfuscation":"4LIaWi4q"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":40,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" to","obfuscation":"LjZd0BxFmKd5P"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":41,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" compute","obfuscation":"ZY6FmwGa"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":42,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" anything","obfuscation":"GuLZ2Jd"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":43,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" myself","obfuscation":"xqbdXPCfq"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":44,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":".","obfuscation":"QgpXIz4jnu1hii2"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":45,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" So","obfuscation":"wtUgYnlNPIOWc"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":46,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":",","obfuscation":"tinbfhauzusl6jC"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":47,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" I","obfuscation":"Pk3zXd2ujZwFvW"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":48,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":"’ll","obfuscation":"x4BYAA4LKTuDo"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":49,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" just","obfuscation":"BIoUZZ3HSrt"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":50,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" go","obfuscation":"K7O5Owrq7A9lp"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":51,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" ahead","obfuscation":"is6hy5rFhR"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":52,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" and","obfuscation":"huqqJhQunTsB"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":53,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" call","obfuscation":"Bycx7BVhk4X"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":54,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" the","obfuscation":"2iNIq7zihEyp"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":55,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" tool","obfuscation":"z3ZmQv1NXDB"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":56,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" to","obfuscation":"TKdYfVpKhKutU"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":57,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" get","obfuscation":"bo91thYZp7Es"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":58,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" the","obfuscation":"BW2g8qL8CH85"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":59,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" accurate","obfuscation":"9lc5Jgv"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":60,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" weather","obfuscation":"sInoioSz"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":61,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" information","obfuscation":"eDxt"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":62,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":".","obfuscation":"JYedg23ufi7gUtZ"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":63,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" That","obfuscation":"g1t1lfgXbYY"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":64,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" way","obfuscation":"Ep5o4rLfxcIh"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":65,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":",","obfuscation":"TFbvXNdkkPBLVr1"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":66,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" I","obfuscation":"LcYUPQWtuYhWe0"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":67,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" ensure","obfuscation":"cyf4QhE27"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":68,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" I","obfuscation":"pn0OngyYqOV7mp"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":69,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" provide","obfuscation":"A92JWktU"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":70,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" the","obfuscation":"nXnGAWZBV0kV"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":71,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" user","obfuscation":"LIgDJRJ41DB"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":72,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" with","obfuscation":"yswEW2OEdl4"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":73,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" the","obfuscation":"X9UZPFhnozCc"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":74,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" most","obfuscation":"FF37xAFgTkH"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":75,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" reliable","obfuscation":"lZjxdzk"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":76,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" data","obfuscation":"DAev8Lq7rfQ"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":77,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":"!","obfuscation":"HSi5SufVKPmqOiw"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":78,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" Let","obfuscation":"TXlmZbtPAXTO"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":79,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":"’s","obfuscation":"ZLJc4VkP0brGTz"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":80,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" move","obfuscation":"RVe9znybaPh"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":81,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" forward","obfuscation":"yrlGbQ9b"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":82,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" with","obfuscation":"4TztdxQj7As"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":83,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" that","obfuscation":"6bxCZN3vOKW"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":84,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":" step","obfuscation":"XjgzqaaY7sM"} + + event: response.reasoning_summary_text.delta + data: {"type":"response.reasoning_summary_text.delta","sequence_number":85,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"delta":".","obfuscation":"qm9kF7pEPtNE806"} + + event: response.reasoning_summary_text.done + data: {"type":"response.reasoning_summary_text.done","sequence_number":86,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"text":"I need to remember that the system indicates today's date as October 17, 2025. However, it seems the weather tool will return the current weather for that date, rather than needing to compute anything myself. So, I’ll just go ahead and call the tool to get the accurate weather information. That way, I ensure I provide the user with the most reliable data! Let’s move forward with that step."} + + event: response.reasoning_summary_part.done + data: {"type":"response.reasoning_summary_part.done","sequence_number":87,"item_id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":"I need to remember that the system indicates today's date as October 17, 2025. However, it seems the weather tool will return the current weather for that date, rather than needing to compute anything myself. So, I’ll just go ahead and call the tool to get the accurate weather information. That way, I ensure I provide the user with the most reliable data! Let’s move forward with that step."}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":88,"output_index":0,"item":{"id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","type":"reasoning","encrypted_content":"gAAAAABo8jmqx_GyKbRHioPoEL-6klOC5pRoqBX4gYCToNEaQc9LNoM1o07M4sIhkTEvihiIOoesa-F7MxiNod6LQde6QfWApwtdzIjNnK1zEkWI90NQACdYu6xLrT7Rpf5ejTGLlLjIFfkIn0o6RdE1e1zu_Eu8j-u7CU1QEAvcST9rK8LpSCfn-QzK4jJ0WxzUpom7G2AHv1G948BUBFgdDAianK4XURVE-kU0Aof0fAOOYzx1L7PPj9Oefq5sWcpmgReb3xjMbjnMcHu951YgQ25tiku8iarv8Iy4U02TAHzuT5kSuBWwbuKiyOc0kYSkMNJYryEDaA2ShOyDILrCCSCXWGiUq_h7FoF5vwX3drvI1Kb7A4FYBtZQyaOLjjIFVA6_0ZJZ4aqYhEn6_aq7gIjo0_A70hKuxFtTSBz5KK1sC3NANhNjVNIRZByg1WOEY6izDlcdUtyZNbQdutPV_Ow5wv2AI8TiBrFnk5RdZ18KSjCyJiTbVoxATGSwlO4246vfZJxajW40RjJKMPcEmZZJD0TEGrFe1xWIJ9pCMFXbR5bEUznw9uGHMbHlTf3GjRlcp31pOPA7YyUdP-6Zo-j9bbs60mW16Bc7SfkzJ1mzcOlkTwh0g-FTX7Ihi-6148aO1bE9FBDsR8TOZCMwXDmid2vWWdvnCW-Ez5EWPE_rKsTOboPnXM_yQZyPcwIC8a6Zo7YWi-xu8bjlguWCHEm9FcKL7m0IfmVyfW5FzhrOEycEJirwGxB5tjEvaTIYSx_mLjdZoGs8qxoRji4_V4-prgKruqtNSTTwRRdR7taIReeLQElJPNrofBNdO1PO6nx2nUfdHsD0e9RdiKtoIptc4niNl6-cfut9rBMNhtDzs0mb5oOBQfCqnccu7tgm7CUdPi8uiYvYr4u6ZA_Q6mdd-dFswhVHdMQAhQ6UtRkvS2O3XX-6C7R8-xH7IsgrBaiNB--8h89qQfbaptnHj5dv4mRyrnD1SviGwAldHZtSttZTxanxQXt-GrvL7Tk20QF6bcant0xvlZcLWJEVoVrUYgSjlCDqo_ipXIoJ1-_O6zYo-kiWHVJkEA4Se9bO7jfjXs9tsbM6ByZgNoyShqPcPqLunrGkfaEwQHl6s91wKPzTvJz5tUisXfJWDqU38Xch4tha2yTN-NfeyLsp9voLfuRHjW-Cge3I_cPR49WgthgtsmWZLJ4HKQvYruU48Asydnw5izlU9pZJo1eaTK3adjSTcLZtUGHQcCGN3455gbFuJhSH38JllGxR4yzGAxyzWtbV0mYvWRaVaSrJY_qXpc0mAzwzGoMnPOrQWtvuwqPwEFJz5bNwe4aGccePtdLaM18YkOFI-kPqDjiC8bpaxNQm_Pq2fz2RRvsySwL-N3pg32grZMTU6CcWednX-fG4SS0_-OWNPwm815zV8AcZcAlOPtIeiLBkV6xZ2D2BrQbTMfIg9zMHVS43U8e_Okicf9JhGR3ej1UrtiQ6fUsm61xsI6GWUL1z8H3e6hHmZJdQm3zx8hFgpjRhsjinndGOmarCYscraxlGAPx7XFx1dCp-_0gHjKuFp4cmbXXJm4dKWPrcTvhaMGRHf2YGTADM62oQdZvoT-PGb9e2f4wkaMZZbKv1kZsAGcbjAPGB6PNffM3rLCoJ4qkJJJtBVWP2oZLWCtSKeXpii5vQe4_D-ewtS2Dyen0USCPjPLaLVC46E5j9EmmAFsWwl0EFPziFN5tMWqiJtNQrpcWs10jlPse9FhmEeUVzSuGtmzzfdcysPsduMTlvF1BSuhtiWVYbrnJyL7hyWWgBKcBTYJokC4k2HNJjQBI1O-LKyP_yznnXPdzIFgzC3X3CmegTw1uxBFhQs2UpN-b02xgmLerFOuw-Xr1BXvLlVEALnT44yqJYgZ6eTBiMiCnXwqwHWWdoCzll_sxhuwqZDtqj_V5C9oroqNhUnfKNo2Y4ASp4fqh6AfNhZkiBSbOh8t7sjv0QMYCv84bTIt1bVaR5LMc2pJ1t9kHKTD72ey-hQZIfIpclCsfoqp9RWDLbi6-QPmmMlLzVZnx4sCrMl3W8Se0lToXc5xFwKm9sC-kaQIfhXaymGgSc4ra53yy9XBoDMYUZQhqDJwTy7QHCmXFKt3JuxsF0yqf0T1IA1vZ68DPtczKxRlBcUgXKllXH9DbZVvyoivKgKruV-QaKT5Pl4dq82JhJUAKuYMb2trxXfdAVflBNYt8-WnDjk8FAMZ8k5EDddssL9E5M_KDEN8X1HpzEwiE7KPeYXo4E6kgCqwXpIiSJ6lc=","summary":[{"type":"summary_text","text":"I need to remember that the system indicates today's date as October 17, 2025. However, it seems the weather tool will return the current weather for that date, rather than needing to compute anything myself. So, I’ll just go ahead and call the tool to get the accurate weather information. That way, I ensure I provide the user with the most reliable data! Let’s move forward with that step."}]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":89,"output_index":1,"item":{"id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","type":"function_call","status":"in_progress","arguments":"","call_id":"call_8feZLXZajk3zUG5EkKIkQlwn","name":"weather"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":90,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":"{\"","obfuscation":"qPH2UN5JMBy1tg"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":91,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":"location","obfuscation":"8o2cDMaX"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":92,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":"\":\"","obfuscation":"atQHlPUQX3i0x"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":93,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":"Flor","obfuscation":"FyOWJCAJ812w"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":94,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":"ence","obfuscation":"LPVUL71dNKkj"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":95,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":",","obfuscation":"k3kZKdaocYlen8a"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":96,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":" Italy","obfuscation":"gD1hqivGgC"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":97,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"delta":"\"}","obfuscation":"HYSCdXOWhvBzKy"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":98,"item_id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","output_index":1,"arguments":"{\"location\":\"Florence, Italy\"}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":99,"output_index":1,"item":{"id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_8feZLXZajk3zUG5EkKIkQlwn","name":"weather"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":100,"response":{"id":"resp_00564a370f8761470168f239a3f90c819492eb21bd9b25c369","object":"response","created_at":1760704932,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","type":"reasoning","encrypted_content":"gAAAAABo8jmq8ZgK6_R2_mBtj66EaDbh24YJ4IzeZ8ry7g2vxl6uWYZxXWaiq0s0n6ynJc10mtSY1K2nLDwlcpxs3tahcZMYiwh879zVkpQfoH4ze1LFLRQ5MYJ7R5qvj8vLVXz7rFqKbCXWSXKpbCnqyRiURV8SG9f9rRLZ30IYDJHJPsSWJVD4e-ROkag4B7TnYTsPDfzga_eKKL7yi2AmVLpetADp7l_MBaLpUeqmOUUWp5ieyLZ-b8Cu1AovW2nnh79yNw5RiBuUYZeGyIRkjbUuTEohG8t2CIL4S2cUy60kia557RDbSZ0wscjY0M6ZkPwWY1kf08OSvcbKypyDOmwZdhYH_ABgTXFUDCUvSoCGAg9OGS4kqOOePY3wgmhPBK2Ufj3a1phYY7X53Rxb90CR4oueX5JI-HjhwV6Vzx1cia9XeGCTbPuyOAcd9k62z8bCKGPd9OAxLzn63u-o_NG1GvRIFtdOqOEpFo6hpfHR81nUzporv-Tfv2SXVlo8bKSWjOrHuYE0usqRXYB3UmZxEdXHcafOVDOUjJ49JrL3uutVQWXGCQnMqhjiefwzBvIa4BeelANG6GkfNNeGyD2mf0hn_5cUd6v__umQmBXIx1NkbG2iFwtbpaOD-BSU9DMOHBJ4PqUGDT6A4geVUrXBb6NwE11JHXHPBVZMVvc2pDERJciTxNTbNpqIbHPKkKmfcXBoxGCn6LMZVZaVygaGmlkkhAf5NfS4O5hPZMFyEDA0-PYzEEZ3IRA7V1rvIgNI5zv0wC2TyENiUIHsZcOwE7mA0Wnn_uapgzC8gI-D400m-3bi2JiXij8WvEL-_t09K5O7CWcewE5yClFVHSnSrWjyYY_U87aNX4gr4zdC2PP_vRKwE9DKqUXTgQpVQ73RMuXzbn37PEpZ0rappA-5cP2mjUUrhEiXl9_Ci3CbZ6Vt7qbCGrfAVwJ_Q2m7X2M1Rbbw2--JX2FRaxpJ0Mr90StSQI8cZ1H75VZXDZoUkmQv5BT2Ek17d9D-IF258u0PHykXiP7FAi4-HMsKToO3GPHqmuUvs7TAYvNXLBCRwOzP_Fv222dCbOnj7G3NNCSTuWwanayL1j2s0wYSqee5NIBoZHv2lhQzxWyTeNT1dw5eeuaLGgaBMFfgUjmh5vOxid_ablfG1hfp_a6sZ67uwA-_V8bUA8Hir1Binez5jjEXDLWXod3cjjx48kC2CiapP47L8qaeN2XPv4EcBO-iqdenpLKTQvtgUezMP2uuuXnXR6nIhrMJH_NxGyw7dcUyIq2j-WKBDHBkwMFuG9Pzpmbgx6jFgDZF_JDjnSwWSxp-sOr3Ofhmp9Ul8uS6hZtNeaOr4uKV80XhxjDyUiZOoNgOjdzD5sJFLU_xK3Chg3A61ujkSSkU-8gWkhGEbYF_6HkshTs3M-MmTUZ3FsIjYaW5EEJLcjN8Fth82FOK-28Oactl9gl79wMMXu3ORDbySgC10VVR_TFlxYX5moKLUDh5EheNBEAHG8PscCXxj1hro3uxXgJE3S_sYm9qV3kCU5XusY6Ql9M7CimpDvvUR2yf67ijxvh5gsVdxcAfUG9su6qLoXMUshs7MYP4sraKQ0Y4Awor6GrR23R_eHpLpzdlZ-eTNleoyuwZ_KmzgmHfr1Q4K4TV6GmSqhhm16bmjbCaeUmWagy7Ng0KL9JC1zeMgag1jh5ik4kCj0PB4_Z4fDFaM8cg2jScxIFo7CAAzYS2xBFmxihuBa1iW_P7E3gQjVwZyF7Qkjyhdb5HxsIXysmHOEc3ZBNK-cwWJRHYAHqWuIJ6z2iODE-4VBy29jHfieta0FRUeeWHT5mx5UQSB87sUJpqX1U_bIi315ZmVKwChSdKxBluLHkchpYt34f5eKtFpujzwMGQmSx1_ETIVCEUJG-MluiA2rZxQvtetLsVCUGXKf5zOgduI52skT_gxwGfG5QWYYgVxHiLICgTixgkDc6hQ9AJpw3YNZBmGXNMQPof9m5cXzj9Zni2_1SOKvez4RUujpD8g2cpn3O7t7qzK_-d-u3ZMNwTE-r6xToGEarAsoPSWSeNM_FSCqqsOFvr5yQc4NgTrQuY1NT0Zn-4WCyI9svGxdi8Y1kHIirZfBABsW-dDvFlnCU-LAFhz8K_Nv9-7LZGr--qEfuT9CjBtdQa3VD0UdN84uPOi-djuCEJLjTDPvcNc9it4Tkdc2zQJA_iaJ3-pNOzEP3clK-TD-jdNA9N_9kkpDhJtaHq1iyijEKBH1IGxctQsk3EySZGO5LiAgYoRXn5b8-6-EM=","summary":[{"type":"summary_text","text":"I need to remember that the system indicates today's date as October 17, 2025. However, it seems the weather tool will return the current weather for that date, rather than needing to compute anything myself. So, I’ll just go ahead and call the tool to get the accurate weather information. That way, I ensure I provide the user with the most reliable data! Let’s move forward with that step."}]},{"id":"fc_00564a370f8761470168f239aa85508194bd45f6a7c8b4c721","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_8feZLXZajk3zUG5EkKIkQlwn","name":"weather"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":66,"input_tokens_details":{"cached_tokens":0},"output_tokens":214,"output_tokens_details":{"reasoning_tokens":192},"total_tokens":280},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 543.7015ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 2191 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"},{"id":"rs_00564a370f8761470168f239a4f2fc8194b38541e473cdb603","summary":[{"text":"I need to remember that the system indicates today''s date as October 17, 2025. However, it seems the weather tool will return the current weather for that date, rather than needing to compute anything myself. So, I’ll just go ahead and call the tool to get the accurate weather information. That way, I ensure I provide the user with the most reliable data! Let’s move forward with that step.","type":"summary_text"}],"encrypted_content":"gAAAAABo8jmkhn3gO_TMlHP7zrmqSQK6e2YwCe3YftZKY9Y9Am0N47nufS0EOe2c40Ie_ULjJ_I4NfuJMK2z4f-hl32bIn-6n_VLQtWy0JNg5qIiYspMtmsGPDKY0PqVj8rmYPrrH6UBrnmjOIwiBy-owTkt4-iRe7p39ooEi23aAg7edh9Cus926ptNWnCyRd5LBxp_pLeUBbjcnyZKbN8sHpHkYBXi-d3tKM1w5RKtWwNk1iYZeSpMnFeu-0Rh6ybotX-rx9IRZceu-zOBPpk0Be52EqZGZNZtB7mmsfX9VainX3PHsAviBrwTJH5dSBMpRft_Mw0YE-rVBCcCRk-aDqJbxDgxndIFci_GHsu-iPuwV-kyIGiIMT_m1n_DSnQAkdY5Ur9gLMu0x91oug9mePtyoUf5SEIw4HLUVRESBhxg1pZr-QR1dv-qTjjyaJnRVQFEFcaKxUxRbKUEoMP3T1sg72LBP2kh6t9GtwNjPD5S63TjWBGogzHfOlc2WmiMzG6B0kY9xFh7wIM9XqbRvggxnNK37ltLB57lL73RckCP_4A2rLypjDmeewnDF0xLsKjVh_KHMMMrcMro__2EDnCIMpyWn5PFlEqHoAn1XcL81NSSxqgc12LYfTy4AddcrLUyNY0TDoV7J40oprdDPmD7SdTPcg9j4NXyQcDwcs_rsa_mtY4XH--Qd7EdCCOETDAaHi8uzz1Ig1gHGE-2sivK_NCqIUjX9IifDBZ_EycsiRhvoqKK58aE6ZxAKMzuvQZSGid9avuGUzO_bSvuCLVfYMeLsR2twj__CX6yXLvkHy3WebfqsABEFbklAp1A3ZAn17FJ","type":"reasoning"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_8feZLXZajk3zUG5EkKIkQlwn","name":"weather","type":"function_call"},{"call_id":"call_8feZLXZajk3zUG5EkKIkQlwn","output":"40 C","type":"function_call_output"}],"model":"gpt-5","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_00564a370f8761470168f239aaf05c8194ae07775650318b6e","object":"response","created_at":1760704939,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_00564a370f8761470168f239aaf05c8194ae07775650318b6e","object":"response","created_at":1760704939,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"Current","logprobs":[],"obfuscation":"AUMGN5Q3K"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" weather","logprobs":[],"obfuscation":"qLtTyxtr"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" in","logprobs":[],"obfuscation":"C66nAujPIMzSS"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" Florence","logprobs":[],"obfuscation":"SnIKR03"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"UUiwNeLx1iroF0t"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" Italy","logprobs":[],"obfuscation":"SuLohkrWW7"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":":","logprobs":[],"obfuscation":"2cSrgMrh5XW968L"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"SAQ3ByVC4tefn76"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"40","logprobs":[],"obfuscation":"umc9EEXQok47sF"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"°C","logprobs":[],"obfuscation":"NuJ1Rz9JIahUu2"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":".\n\n","logprobs":[],"obfuscation":"amqhasz75jUjb"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"If","logprobs":[],"obfuscation":"04w1vFvjNUodA8"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" you","logprobs":[],"obfuscation":"oMzpQiGKAyFs"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" want","logprobs":[],"obfuscation":"E1O6WPWxSO0"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" more","logprobs":[],"obfuscation":"kxFb99oWpSs"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" details","logprobs":[],"obfuscation":"J3UJtyM5"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" (","logprobs":[],"obfuscation":"9iydpihu9hCwNH"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"humidity","logprobs":[],"obfuscation":"DVhtywjq"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"d0ehS04wmj1oojH"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":23,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" wind","logprobs":[],"obfuscation":"HgSFvj4A844"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":24,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"AJkG4jtxZIlaBHM"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":25,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" forecast","logprobs":[],"obfuscation":"VLqVo3G"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":26,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"),","logprobs":[],"obfuscation":"s9Bj6OgwIIDG8S"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":27,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" tell","logprobs":[],"obfuscation":"THWK3ZVjtpB"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":28,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" me","logprobs":[],"obfuscation":"Zk9eOpTLijZxG"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":29,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" the","logprobs":[],"obfuscation":"O2NrpsXiaxeW"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":30,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" timeframe","logprobs":[],"obfuscation":"NoqO6v"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":31,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" or","logprobs":[],"obfuscation":"of77Q2mtoqU81"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":32,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" if","logprobs":[],"obfuscation":"IHhYXuUnYAjr2"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":33,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" you","logprobs":[],"obfuscation":"K97GCaBS1Brl"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":34,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"’d","logprobs":[],"obfuscation":"hb5TGRL7gboaIR"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":35,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" like","logprobs":[],"obfuscation":"YgNGCMS7ROq"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":36,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" a","logprobs":[],"obfuscation":"XlQDpZWGWK97Y4"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":37,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" multi","logprobs":[],"obfuscation":"V9W0gT0VFQ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":38,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":"-day","logprobs":[],"obfuscation":"NGHw8w8mjRsX"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":39,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":" outlook","logprobs":[],"obfuscation":"sQ1V9LLI"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":40,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"delta":".","logprobs":[],"obfuscation":"i7Z0ECrIuVBjuoj"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":41,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"text":"Current weather in Florence, Italy: 40°C.\n\nIf you want more details (humidity, wind, forecast), tell me the timeframe or if you’d like a multi-day outlook.","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":42,"item_id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"Current weather in Florence, Italy: 40°C.\n\nIf you want more details (humidity, wind, forecast), tell me the timeframe or if you’d like a multi-day outlook."}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":43,"output_index":0,"item":{"id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Current weather in Florence, Italy: 40°C.\n\nIf you want more details (humidity, wind, forecast), tell me the timeframe or if you’d like a multi-day outlook."}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":44,"response":{"id":"resp_00564a370f8761470168f239aaf05c8194ae07775650318b6e","object":"response","created_at":1760704939,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"msg_00564a370f8761470168f239ac082c8194bbbce632ff854fe4","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Current weather in Florence, Italy: 40°C.\n\nIf you want more details (humidity, wind, forecast), tell me the timeframe or if you’d like a multi-day outlook."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":102,"input_tokens_details":{"cached_tokens":0},"output_tokens":41,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":143},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 672.35975ms diff --git a/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking.yaml b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da73e32231e0bacefbf76de166632719ec0980ee --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-gpt-5/thinking.yaml @@ -0,0 +1,259 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 551 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"}],"model":"gpt-5","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0e319212d3811f510168f2398edbc8819eb99fffb643dfa9c3", + "object": "response", + "created_at": 1760704910, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "max_tool_calls": null, + "model": "gpt-5-2025-08-07", + "output": [ + { + "id": "rs_0e319212d3811f510168f2398f6140819ea426c36bb590abee", + "type": "reasoning", + "encrypted_content": "gAAAAABo8jmTBMurhS5oD-Y9cDAXlL496L8UQyznDBzW9nwpQfBEnXbCOU4m1NyS9wv5Q_u9-SJm8ge9KDN9YlxMjN9baf9xqGpkw3dNWkKNUgfB67evsG4asEPE6ODvJ2w8MfWiJyZNsGE414425cTxLw3RXBo5dQmx7gIsNj1XZoSRg8JOmxC9Wh2LeihVVY-_ilKi7-YrThT5KDGSJcHmCcT6gC-rIYX7XYjvBBsY3APQLEcGnRdGsWjIwUKVOZxyNMXUCTHkCHyBqnKRKkW_SIS2uuH-7qsFQ3Lx99vq6nRRxFsI9ITq3sYCPFAMYCNCguSVoXFNkB-xAMKczdtT9EKtocr781FYNgTWWC2SIu-ieuKqELsJ2JG46S04gEEhy4o5aDJ3qG3U57QSYOeNLXy9ePccJkMb0pzLwTCdVJy2Qbm4NVUk5976LEvgFV7dkZAsB4Gt3XPOUQT0pBAqOEwisubWMHn1JVdw0al0gyGzmXwYoxsJnPh3JLjsCsY2f4EyN-i41cMx3EzDEMEWiQxHT5BxYDRTAXg92L9Ryz1tyqrTZ29nxrcylvRB0lwa-zogOF_G4eTmxNfni3NeWAm1qlrO6ghO2xppEtp3w4dY--U-ZsV-WDMScu10TfBYyqw5MCgsUepm7zS6Vhoj4g7c17y-ebmhSOWX06pZQdlWJ1yBwiFs_rZ6Ta_1er5I7iQsHuTlfEdP55Eu3kOPmyoMfVyDZuFafGK4LwY2dgQtSoz3OpRZA4UGSJojD6tqmbK6HMmuVhgNqDMfGv7UfMJrURdoZiIQYo2qy556IgKckcXvJGLdWtsv-93Hef1uYSskR_P87E9FJv8mzZh0Lfh2aRRtqrG-wQKkMxesKLR8GeJKwhckJU9Rv__659Ci2LfOTIWAHHNZyKcZWiKqInUjkCvAXHzWUgxgP-RNMOEqstH10rvpf1UMpAKlGh47E1Ojo3sbCuO15FeYgiytOTo7KXMHDbcNI6CaHKiaq_QDhhstaelipfsNfvuPqaoU4suZ8-C1lYZzGK96yAuJzSbtdBxRkeMvlb0U71RBtOhPSG3YfPZ28W8kd17_iGUzskubjTSZUfSFlednoiRYOzDaMHV2uhbZhf160gxVKD4kSpZBfBZC4N4fVSoT8YtQwY91P1im6TVogfb1KwCoRPA-gk92-3fDPs2Vf7l1qKGGYR-6E35OG1Lbi5ni64Bjq-0rpNpJmw4wKQrgZYygbhLpL7e0UwJA71JQVtSb65AAc_Jxmk6MPiCakiUCrBD7ehtr3jv-E12XkybUiRbTFEcKEn-cIgbOhNgFo8ZHEjImnbpdMN9b8zrSjfWJ86sf7rpKrNf8l6EX-65Y2rdhrb_0feo0t9jbEuB9xkSa8e6Ldk1Il4dHIEpMpwwreeft7ozkqDzC87j97UTp4fXsXb6Aoh_Bb9OzMYK3f8Bxb5w6iu40u6JYAp4kNmFfPFWGfp4IDCun9RfM-elaqOD14VMnvOW-PyiMZrAgw4MQ9oRqeXU0TNRKKMtSyPPeGFeIsdBV8I23w0F0MdjeAqGnsYCiNpSPX3DxC5s7oQWfP92UDrsu9NwpGvyF6be9bP0lrBM-D0Xo3_T7LGznO71xytuLFA9tnUX0bw04SUvf2xdt5-teNooXaivERLiwlL_BCxZlN0A7TEo0LA6XnqEWR1LoifhHrb5KJCSzrkyFSNi6Rz3tyoLKKiERbY56PCZKcE255u3cLBf2NhN0ErR3K2DzOf6LHmsnrnG1S_BV61LZKlio7qQC_U0SvB_sP529mOCXGQ5JQ8YrXQ-M3mdkbAqsV0EF8QQ9qIxa0wiAa1eJ-u4GkdTy5jAYaEIRCXWCwP9NH0ho", + "summary": [ + { + "type": "summary_text", + "text": "**Fetching weather for Florence**\n\nI need to answer the question about the weather in Florence, Italy. There's a weather tool available in the functions namespace, and since we only need one call, I'll use it directly. I'll request the current weather with the location specified as \"Florence, Italy.\" It's important to keep in mind that I\u2019ll need to provide a concise summary of the results, including details like temperature and conditions while keeping formatting minimal. Let\u2019s get that information!" + } + ] + }, + { + "id": "fc_0e319212d3811f510168f239938014819eaa6a95792d6049d6", + "type": "function_call", + "status": "completed", + "arguments": "{\"location\":\"Florence, Italy\"}", + "call_id": "call_NBDHXdWp4Qr78bSaUnyNgsh8", + "name": "weather" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "high", + "summary": "detailed" + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 66, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 150, + "output_tokens_details": { + "reasoning_tokens": 128 + }, + "total_tokens": 216 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 5.100496208s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 3317 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"},{"id":"rs_0e319212d3811f510168f2398f6140819ea426c36bb590abee","summary":[{"text":"**Fetching weather for Florence**\n\nI need to answer the question about the weather in Florence, Italy. There''s a weather tool available in the functions namespace, and since we only need one call, I''ll use it directly. I''ll request the current weather with the location specified as \"Florence, Italy.\" It''s important to keep in mind that I’ll need to provide a concise summary of the results, including details like temperature and conditions while keeping formatting minimal. Let’s get that information!","type":"summary_text"}],"encrypted_content":"gAAAAABo8jmTBMurhS5oD-Y9cDAXlL496L8UQyznDBzW9nwpQfBEnXbCOU4m1NyS9wv5Q_u9-SJm8ge9KDN9YlxMjN9baf9xqGpkw3dNWkKNUgfB67evsG4asEPE6ODvJ2w8MfWiJyZNsGE414425cTxLw3RXBo5dQmx7gIsNj1XZoSRg8JOmxC9Wh2LeihVVY-_ilKi7-YrThT5KDGSJcHmCcT6gC-rIYX7XYjvBBsY3APQLEcGnRdGsWjIwUKVOZxyNMXUCTHkCHyBqnKRKkW_SIS2uuH-7qsFQ3Lx99vq6nRRxFsI9ITq3sYCPFAMYCNCguSVoXFNkB-xAMKczdtT9EKtocr781FYNgTWWC2SIu-ieuKqELsJ2JG46S04gEEhy4o5aDJ3qG3U57QSYOeNLXy9ePccJkMb0pzLwTCdVJy2Qbm4NVUk5976LEvgFV7dkZAsB4Gt3XPOUQT0pBAqOEwisubWMHn1JVdw0al0gyGzmXwYoxsJnPh3JLjsCsY2f4EyN-i41cMx3EzDEMEWiQxHT5BxYDRTAXg92L9Ryz1tyqrTZ29nxrcylvRB0lwa-zogOF_G4eTmxNfni3NeWAm1qlrO6ghO2xppEtp3w4dY--U-ZsV-WDMScu10TfBYyqw5MCgsUepm7zS6Vhoj4g7c17y-ebmhSOWX06pZQdlWJ1yBwiFs_rZ6Ta_1er5I7iQsHuTlfEdP55Eu3kOPmyoMfVyDZuFafGK4LwY2dgQtSoz3OpRZA4UGSJojD6tqmbK6HMmuVhgNqDMfGv7UfMJrURdoZiIQYo2qy556IgKckcXvJGLdWtsv-93Hef1uYSskR_P87E9FJv8mzZh0Lfh2aRRtqrG-wQKkMxesKLR8GeJKwhckJU9Rv__659Ci2LfOTIWAHHNZyKcZWiKqInUjkCvAXHzWUgxgP-RNMOEqstH10rvpf1UMpAKlGh47E1Ojo3sbCuO15FeYgiytOTo7KXMHDbcNI6CaHKiaq_QDhhstaelipfsNfvuPqaoU4suZ8-C1lYZzGK96yAuJzSbtdBxRkeMvlb0U71RBtOhPSG3YfPZ28W8kd17_iGUzskubjTSZUfSFlednoiRYOzDaMHV2uhbZhf160gxVKD4kSpZBfBZC4N4fVSoT8YtQwY91P1im6TVogfb1KwCoRPA-gk92-3fDPs2Vf7l1qKGGYR-6E35OG1Lbi5ni64Bjq-0rpNpJmw4wKQrgZYygbhLpL7e0UwJA71JQVtSb65AAc_Jxmk6MPiCakiUCrBD7ehtr3jv-E12XkybUiRbTFEcKEn-cIgbOhNgFo8ZHEjImnbpdMN9b8zrSjfWJ86sf7rpKrNf8l6EX-65Y2rdhrb_0feo0t9jbEuB9xkSa8e6Ldk1Il4dHIEpMpwwreeft7ozkqDzC87j97UTp4fXsXb6Aoh_Bb9OzMYK3f8Bxb5w6iu40u6JYAp4kNmFfPFWGfp4IDCun9RfM-elaqOD14VMnvOW-PyiMZrAgw4MQ9oRqeXU0TNRKKMtSyPPeGFeIsdBV8I23w0F0MdjeAqGnsYCiNpSPX3DxC5s7oQWfP92UDrsu9NwpGvyF6be9bP0lrBM-D0Xo3_T7LGznO71xytuLFA9tnUX0bw04SUvf2xdt5-teNooXaivERLiwlL_BCxZlN0A7TEo0LA6XnqEWR1LoifhHrb5KJCSzrkyFSNi6Rz3tyoLKKiERbY56PCZKcE255u3cLBf2NhN0ErR3K2DzOf6LHmsnrnG1S_BV61LZKlio7qQC_U0SvB_sP529mOCXGQ5JQ8YrXQ-M3mdkbAqsV0EF8QQ9qIxa0wiAa1eJ-u4GkdTy5jAYaEIRCXWCwP9NH0ho","type":"reasoning"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_NBDHXdWp4Qr78bSaUnyNgsh8","name":"weather","type":"function_call"},{"call_id":"call_NBDHXdWp4Qr78bSaUnyNgsh8","output":"40 C","type":"function_call_output"}],"model":"gpt-5","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_0e319212d3811f510168f23993d900819e8554549fa904f584", + "object": "response", + "created_at": 1760704916, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "max_tool_calls": null, + "model": "gpt-5-2025-08-07", + "output": [ + { + "id": "rs_0e319212d3811f510168f23994f608819eb5076ad513ad1579", + "type": "reasoning", + "encrypted_content": "gAAAAABo8jmjstHHULLsMGxy2E3-Xo0O0cUVNx6b8OSavmNWeweibhRqRuP7buLPHMcHqUXWMBtPsr5yH8B-jgFp1pOlLqCMYqu-_Zs7Y0i_vbCM6Qt0uimhYDddVqAw5Fy59--GAHN96mZOeIn0wfxfTqemDmMl1B2YpyM9uly7eQOUsja8oXMvb9ITk8r2DvQYPJ0L0JKxLV-_xC-bdb2GFJxv1eQ6kaHGvsozk5noabtZ9p0Ebj0_WHdtDqmU6RCsyaDWC3JvSEsJiJN2bVkWHu6MN71ufXGZUn6_m4_-8TiUVFQHNP-3iqbnn5gjt9MTunXDbjRGbgOifw8H7FXnW2n41lCF7N3eA59gcQ1rljRzCZtcrLZzW8UV0NWO74opKQOKn8e1En76A6kWVaDspeCQoFFWv-aYWY6i9CoBCerp_zKYbwEyqRgdj-lGg94R3KVGvVilAU2LwRt4btMU7HeeITiRObvcfxxiNGfr1ymt1bwo5aapEDMaf9Ahx16Aq_hE_AGLP_zSwpydNbLGeBSmXjDszP7BjFcsvkacVAZJjD4d2eaNg994g_kuqGmcinoKMJDPL4oskQidWG-KWBmb76Gr8kR8497T3j9X1PwRjKt24hDQGhuGB_EPUtVZpXOxrwSFeogPKJKK2sYIT8Z6_HpJfCchzxVHPpOt8n3GWpy3OvDkE21ZHXPt-d_EWRltCE_PUndIrGDcmj-7Wf4vV_Y_c3OKFNv_9jPIzMniYf-RfLCCkVR26lmZ8KRaqv7ijaTiqqiZ6MfG2YCBhMOeyb-3ZLYkJvd0neY6PZdx2v36TkVhdt545BCyB07ZPzrghYe2sJENnvzie5nc7yn5eDWkT6G7z0KI_6LcG2bGnlTEj2NnJ8SZORO0DY3DNd9j9M84emBySsnLQoEEGjfIpgR2FB_8M1XvN2JQM17m3R4rth-XsWToVJikou6VPV7eho39qnEsiUoksPgsElFoXC1ChXgJA64uuoPQ52zf-y4ctjayMDfyTUikOCDO64j3xT1xxKI4N6m25pzC__b7urRIUOxHd2MrrGaVMax9Tmep3NHwuWa9Zsa0-QDSW0fNOxCV5xcFczkSZxyA01UdiV-6wsFAn_Bjstd2F4kIPLcwpO7yYJUI806VlghIH0LZbQfbGuAkm3b9Pi424KVV9v1UcJ3vxD8c0-D9vu0qGxmXeS0UqF0VhxDZYwj2kVoINHZUf8OEZNnfuWNicbjjBGRjH_iYvrl0iQ3kdu6apBJuY27s7rv5ShqXSdUjMdIeAj7AznPVRB3w-tSW1Yg7pAUIjogr2BfmifBSy7sZA1ePjTRQnXb9-7x7z4fLs0FkatnRAaOnulb2X0sRucI38CZz6j8RuJomuSkI7LF7W5jKFHcaOe0N0kI0777XDFeDop66K5EN83MJ6jG3U4Fh8Fe-TtoTmuMHrs-zAo6u_8OgcsblF4YBc1Re-X0s9q2KSpLIie4z1sA0Cu6-PAPK12cu0aywx7hWe9Xk4tGkKJa2OAzJCUw0ResTn4By2iQxcLHMviw17J-M5ti4uZT7lLu2vNa_fJit2oB9pAN4uEvNHEN28HDK_xm_vJO1G-Mo8pDEOK4kR2SYMUOIq7HrtANeh5q-4IONCtDH_tC94xJxphnXO7Wo4oo9_iv88s6-BM614L_SHL0-sfU8ud26td__zDrVI5HM7-RsoyTFcovUA1SqtF0sfs2WNuCrImEy6Od0sneYzAbrHbdHiq7UL-qnohYSf-ki9PJ6yUrtrNQ9HT5J0dpVDjKRwoAt2g5cYRhxVBzc7zY6_amRwn4RI9oJNvYah8hiQlKaTRaLiuqqTGTKVxU3phLU5oSR9aWlk-Cqp0Fm1tdAQ8mSjC_VLWCZ8EyNIrt8FWfub6pQecfH9FJ2Tdd-2cwFGstI7YXTRiiFHHPluR8VYnRPySS6SEfQH-g3cUgMybM4BkzEbhf9Fqa-btIWfAItNQsZ63Lgd8xUab3Dd8N0BijFdBWC3N7jMg3rzJwqH3KFPiBClWQaOy9f5vim05Wd-TnUb1_PtYxTyDbSCy0fb9AJBZOGcHyg_VTuAGPjvE6AeQSUXixSWwALyTsGQUKqGKo-sltdenOR3fmwQsTZ3w1EAh5qrVnnpfDf2I1PkSKWG6SS7VmYmS3cf7RkzNm73ZBKZPBEFRNI5X1ZnZ5lt5CjGMSQJN63bGqAjuEYG7DJhRJJf9shh5afz4Jp3zbvaYxnnUVpXkm5FPdksn3KEq-DDOOD59dwoetWCzaNw44nY8ndpUiNn_dwtQb7VEQz55h5tc0NaPBaIaUTlMoPnEKOLnKEb5AgCNwSR9hu6fMRGucSrnoh3IBJhw_aP4pUyfJEMRqQsHG-H6kvjfVQogWDw0utrHSaWmubfpnmIKgbKIFNC0IP1ubTxPok9LQoHRwotesZ6FjneMfN_EGunqT6XhzTsU6SGW1fx_ov0NLN4o2ifovbc0hoTdZMedYvomGzY5Mw4euVEzbSNPlmGHU2ATXW9bb0uDM2TtCRVX2Hldy2ZJS6P_gxovrofW1u9Wb9Bv8K1jW4W5zKr_24UCGWfZoq5Th5qDoNB_iskRyBAlMRtFSXhmH7RPunaGjep3aV9r5L_gnfJaMS4MZmRdEU4YOxKevHoSvnxAGYJWh4sp4z87IczKoFi2uWDQtgOkKdP8RDbKjc_henAHcsJnDKfnnIrsWvrIuzpjGLrtQuAA3Dj28AaxbNw1K_wtTZFjaThRF7firN1LEn6WxCBAblULVwOEPJmf01vIVXGI4Me-ID57AgTEf9nBm7TeWDLLhAcWBWNepchyhIxiFjKS4wmzePThI6bf0Ny9TvD85kXG2LG8dl0v2cNo9k2yP7emoxbOHkATVkPxYBblIciIl3bzbTNCSL63K_2uu7sLJo1OXAYWqfzB2iIiTmKGvkd4PQdpiDdpYAGVWUBX5mf94sRryFIGkmGw7qKb7tyHcdh5Ox1hkaR8RUFCYit9lgTW883KxrbZoriWDhOEP_EPmdkBa6NRyEHP_jXL7lk_XO07C1vjtchS6CagBGh_yGOaL_plSNQ08sE127DtsQrnxnTFFxD5slH34NxHSShGRwonaNafyquj1z_D0ajQG1mD9LUz6d_Jdr6OvqsV7Mr5x5XiA_-Gp0MGreWK_vgRlsxDQnWTVC19EXWiliG3BGjW19z_7mwfwqYXO12lYq608pGLlPj7SK3US8PNVaS8CgiIzHHo95mFUfiRFHv1gguCuGRwMKQKUxpUC7XfvPabxGKHfo2ipHfVfiYNxz-78lpF5h3L3LAvBRCxSOd7iVaXFf6xn-wffhvfx4oIkW1lwZdMTASG1o5mixSQ38GRmg6cs8piag6h8BsDkhKWdr5w6WML6dlSQwQCjR6trVRJygUaOSP3ibyNrVt7TMY-gM60gtQkJVgXQHkJt5jK7lMJNQ18ODYRugXU3dbwliXGIKxFiEfie_Sm_U2FXTN-Ai16a_V5-xEidZC8y0WHpvfqQiBQbUcXYXBRsFnGpflsAccY5aP94R_2Dql40ZqfJ9bMPoXYI4eTkoUXqWTYh_u7ePFRaKsoDxsYKt0kJ4FLD5YWkRQYXLwZVTYtQOdMc6hnTqJSoJ6rPc8ag-z3eFJhenwwrtOee1q7vwJvQ-iEfcyM72NIraXHVR5TGNR359rWVCtl1jXagqGxdOfJP3b_yeZ7IBEX2dL2CR2NoOp3CN0KGimELQEXx7jtoOzHzL5JK3hI_FocKLivAYbWv-InE7vRsXfFGGOIuEDp1ErPtQ8hpQV5FB8TJzPmhjMEH_btjArfiHt1h8okUmperS-P2XCgAukmJUSRgFp-65q1noZjx1WgQJjSGm9dSVFcd7deepR2yS1HLG3UJNTUj0SmWUuWIowTWyY5ICr4ps5nuvqF4xKNZ4liSaBqKtQluc65ICFOhC4Mdt3JzxsYdA7uurIHg7PPmxSX2zYT_egt1PPl2GcqjEiA==", + "summary": [ + { + "type": "summary_text", + "text": "**Interpreting weather data**\n\nThe tool returned just \"40 C,\" which feels quite minimal. It lacks details like conditions, so I'll say: \"Currently around 40\u00b0C in Florence, Italy.\" I wonder if I should mention hydration since it\u2019s so hot. The user's question was clear, and they might expect more info. I shouldn't invent details, so I\u2019ll keep it concise and offer to check for more specifics if needed. My final output will be: \"It's 40\u00b0C in Florence, Italy right now.\"" + }, + { + "type": "summary_text", + "text": "**Providing weather details**\n\nI\u2019m considering whether to offer more weather details like the forecast, wind, and humidity. Including a temperature conversion to Fahrenheit seems helpful, so let's convert 40\u00b0C. The calculation shows that 40\u00b0C equals 104\u00b0F. I should phrase my response clearly: \"Currently, it's 40\u00b0C (104\u00b0F) in Florence.\" I also want to keep it minimal, maybe just one line, and follow up with a question about whether the user would like more details. Keeping it concise is key!" + }, + { + "type": "summary_text", + "text": "**Creating a concise weather response**\n\nI need to keep the formatting light, so I propose this output: \"Florence, Italy: 40\u00b0C (104\u00b0F) right now. Want the forecast or details like wind and humidity?\" Timezone disclaimers aren\u2019t necessary here. I could also suggest heat safety, but let's keep it minimal, just one short sentence is best. Since the tool only returned \"40\u00b0C,\" my final phrasing would be: \"Right now in Florence, Italy, it's about 40\u00b0C (104\u00b0F). Want the forecast or more details?\" That feels concise and clear!" + } + ] + }, + { + "id": "msg_0e319212d3811f510168f239a37318819e83590ffd0bf41e31", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Right now in Florence, Italy it\u2019s about 40\u00b0C (104\u00b0F). Want the forecast or details like wind and humidity?" + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "high", + "summary": "detailed" + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 261, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 544, + "output_tokens_details": { + "reasoning_tokens": 512 + }, + "total_tokens": 805 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 16.104320209s diff --git a/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking-streaming.yaml b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking-streaming.yaml new file mode 100644 index 0000000000000000000000000000000000000000..897d1665146aa2f5832dd342eaca400cdb5e7624 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking-streaming.yaml @@ -0,0 +1,232 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 567 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"}],"model":"o4-mini","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0d54375cbcd869820168f239bca94c819cb1dd488b92e67279","object":"response","created_at":1760704956,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0d54375cbcd869820168f239bca94c819cb1dd488b92e67279","object":"response","created_at":1760704956,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_0d54375cbcd869820168f239bd1e6c819cb857543cb0e2660c","type":"reasoning","encrypted_content":"gAAAAABo8jm966Ab9kxmDUu8vgpyqAPTcdexRXmAuzGq9I98ODGUbEphdXO5ikWTpzGh9YeGP_IkNo-9JsD1yJGbxWtqOGdDjTEs3QmNHUfa3UR-xqTzcjOvmq3thRE2DEQ5_-EXkPfYSAHkPn5lQXBECz6vkzRsncSK1EcTyGDrVXvnkRpiMdD3BWeA7wofiiZzcyk7j5R-BzDWH3TUE2ix3kqzCBY7dQJDHaLCqv-SSiIcmvqYNOxPmujSY_6O0PqJ6Ze5VzFs9pX3RLL2akYYKMjJF4gb6u7S_ZHKzjWWJcuywcn6t_b3l_PF3SL2MKPZLEGbHWIp8fCMo2FJbmHyJTI102X8rTLikr4qStE6oF0PzEHsbqrgXXE8BYDgGjF5dUbn_3Hm9yDJUWqZ4qoo8RuKLgBweNkaFOU_M3GC5vWHVSaAp5vNTwXZoWHm4sEa1Hp8tORuPFn-_Y-Tp6BuFViCZ86K9QIUcVRaTGYH_yFyqIKV7FhpQIbnp1p7GOEHUQksfk29ZlboKbylbOpTlt5sqgLY_MPUUiwJortZHikNr596BBhrGgylHBq57FK3hkIGYqBQ0XZQ9WT5jhNP3NmUDdjwNRfuh_nOGeRcXyP2otI9Cu_iWJF9lUBi4-1iwwEiTFrFc62WNGubgvYSd6nf4DcdDiO5VebGSrkdDKNt2lfV99wtHiVykHMtt6eNosHMdnmK1AVBNQhqEP94J-DnYEQeNgTzRsAUgjhiVG0UC5Gep5kYRA5oKlGZxIrmL9DD8kyCO7ASWltyv4y5sczvkQjS0LlulePcPPDofKaLZV8BzD7_alBKyeg1DrTxK0TRJWEP","summary":[]}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_0d54375cbcd869820168f239bd1e6c819cb857543cb0e2660c","type":"reasoning","encrypted_content":"gAAAAABo8jm_BRor21c1_tpxofq0vEOt2hnSz-KCJ6Opk0hPwYerfQOLqqDHRdvwI3i3kLTktso_kTh_2aTATZ8AOH05mJb_FjIjolDK8B4Rn8S4FAaM-nDjjBhiewwF_ssPYQiYSIS77kTHBCbhLFtQ5ke8EIk3Srnqj7QQoq3ibgxMpqsPcvQL1M5o4k2Iuk5wAc7TrQJVhowa4fXZom_UVcRk2k4TSMshd53M9vfINB5usceSHnhuUameDySH2OAMNGzL1WTnCHnoPz4pXbBRbaFRThkBwWJbFr3me-WYbXdf1w3c-HgcgdPcKu77yuqqIEn6Y4nD_G7duS9aRNZemTUp3azMxdXXROGHTRnlCJhsrlu3UNyagxF0kWq5nvDPBA_Fc_EUOkK9TOS4pzxow001dwlkfvCSH-aoeTGqL3WBtMs2uvWpR_z_jZ4X4uX4OdiCUNcSTJ5BNUB6A3r8K1XcFLDqbOXDcbnpz04d_loHMWmwcHLr2sXuKvAdc6t3LTxnprsyMCbkuBSNljvaLWD3BMot1v0tTkpuhYnafqCt9IM2OPVoVUcRewiuCHe9XDsiahpou2Q2vnJjbcOSZOjJDbpQQBnZ5ITsVz1ZkQTPL8LOQROfsN04q4PRIIQgd8qLcdl2NSO8UqYK6dQmyLbx26Qk07X3Q7nWamBPaaxRjjvryqgminDl6Cd-Hw-pMaWlwMxaeDZnrBLm6fVWFQJ71LE_2InuuZJoqcxYaaYsaeMAcWIaRrvjyL_7-F3YNDV4mSwfzmGr_XcE1DAX73l6OcwjLMMEQifxC-cl6xxFSXno5oXCKFiKDy_GFE52KXAahkORqpilPyALeE6H8VDnvOze-pWVUDaPBuWg3PcpIrmv56jcxf2VOIgyH2TweXzxwuZo4DIGKs3cTlc2xeWQhWtBOYPRMNx0RujyheKg1wygRMAiYrBWksSfXJWdWSjmjiXDOfIbYpscdZRpJK3rVs2zWbaPhpQasuLCHpama25lvCCHPqyGB5MVzaavk-17qqhBOejF7qbnfHcE6XpWWYQuOxNXffD-7a-3_p9Gljp8mzGHZl06o1_SE18eQU30ViNDQMnilAlQvcr99w7eBhlRRacUfdqkYdfbuQckZh5Q9Mo61nARmAtRtxNrJvmTr2K67QPehOd2i7whVWN02bRvKu_AuWCbJzwFD-x81p3K9tOdxND3blvq0PBCWWAPnYc4E8hMQcOrnU9te9zmfRDyJpt2dPYO2S1s_fXAjxPdeuMNe3gHGtbrnedbv7lXhgyR5Lka0Pn1lw0iGusfXW_kg4x7yW9y928GBLFpdMEjBgbsH8Mtddh8bjIyMKOjKoH1ZnoMikkm4A5C4CdSgSfj4UFeFE5teBLT4Gm0Pt2GFtjE8hs6fpEA5eaE2YG7U9Vz7TaxJQ90k2B2p9GmUInojbjQG4T6ZKxr7vHB62QsK_GA_NLINY9gIEzO_qrjqOayXmnm3fnhCXt7DYAG2FdQ5Ujbkaq5a5XlmKIFylV-1vqkZ77K7VbWxOf2ZW064-_onREmRQOU9IhjDzQ8M_bmOHWZkbZP-_a7Tj_fSbb_pFKfpEdG3DXAOrnA69yYfJuNx-TboGuca_EeNvZQlxkNjw9ufVCYgAHCo76-Vn9sjzXd51gM2YutpGondKE-as3L0a2PU46kQGI0LS-54v2ZLVhKx-qfIVzxLTV4dKOfzQZ9Cxpw1ce3mlo1QAPLm3W4pYCuuMbW2U1jBmcnzTTI39fiG5adZ8HC1CzoaUBKTd5E4vIId4Sidmif7QOVxw1bDegdRbuA51ft2irW1O0X8w==","summary":[]}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","type":"function_call","status":"in_progress","arguments":"","call_id":"call_xtoGn5KFzCOsLyeQv0INLRP3","name":"weather"}} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":"{\"","obfuscation":"7BtlAO7Mx2o6Z6"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":6,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":"location","obfuscation":"WF29iSKj"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":"\":\"","obfuscation":"6ZfrxGCQGengB"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":"Flor","obfuscation":"5kXd27iNahFd"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":"ence","obfuscation":"XWKU2l3KEWcH"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":10,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":",","obfuscation":"GY2UWsg8JTCe0zY"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":11,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":" Italy","obfuscation":"SOOx4hbvX7"} + + event: response.function_call_arguments.delta + data: {"type":"response.function_call_arguments.delta","sequence_number":12,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"delta":"\"}","obfuscation":"XHTX3DFoWYoYuA"} + + event: response.function_call_arguments.done + data: {"type":"response.function_call_arguments.done","sequence_number":13,"item_id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","output_index":1,"arguments":"{\"location\":\"Florence, Italy\"}"} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":14,"output_index":1,"item":{"id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_xtoGn5KFzCOsLyeQv0INLRP3","name":"weather"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":15,"response":{"id":"resp_0d54375cbcd869820168f239bca94c819cb1dd488b92e67279","object":"response","created_at":1760704956,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[{"id":"rs_0d54375cbcd869820168f239bd1e6c819cb857543cb0e2660c","type":"reasoning","encrypted_content":"gAAAAABo8jm_AGutqoL73fW2d0o9tLvHVjgEVOuAmdXp5TeNZFZFEMSdvxcpOzSdtd6yO0lEEb4PTvUcM994h_d4knd6Gz4-Iko3UJMnvBf4k6gEgtbuW8bRIHkVz1m9psGGU6BLJ-w44uNoLkA_Hly6eu7LUYLP4Gq6FVwGIeMhtCRxsuOMAyKbZRc1_-Keo7E_pK7V48KWSfZN5JrxhG5ddgtFJsGXd0ELhcv9tkh_bNrXsJS8ao3OeOq_oA9c2SqtUCiLzqfkTNwyvS1k6W0nGBoHQbz_y0YO8QUIvZLkbTBBu-axHjl_aLwFfo52e97hS_XnvDwPp4u718QWOkVtfr7OZgDOGJLO5PXPrnh2mSwDPYI73s6X_j4fA776FF4tiDLKkie35mUF8fixgwgPmZ9yyHtIJIDaNVYSYx0fy4P0-c_p7kTjIP8IiTxZl3aKmUa72mTYAk4Qhiby5ys5l3WtuBz38wjNg-yZPlY5xszPZe2y8THCr4viOqsbSh7mytEvjx7Kbe3OumVayR4nBGf2t4q720vsYm3gb9WPyjhjB_5qBZUoK7C6kItlF_wuwExIogZKLtNB2fmqHGye5h8KdZmEnnduqetRXSOAystOZngHwOJOyL4nJr5QbdIaWp5sv8UNxQaJLjokRV_LCjSB007SbpMOTWiJgblKlpTBWVjAxnmbyRF0qXQvMO-XfXOrMwPXdjq23EVhTmNDRkC8JCtjV38oVdoqe07_nfXBXtby55oxqjeOs98AJF6Ch_lQkWK8KelZ8NzpVBeJqD5tcnGNeDD8qxvSk-SOYkiyAmYyXlMLUNRHU531hLyfCoo7Yn07oVmEIwmwLvV7qqLTH_W_pQI84lCp0M1dgoQewG7xiyd8RfGgySii0C3yBaKGcWrNJjQ_9876SgfY3ZMA5ArN9X612ixck_5L0Ff9OzAPwzpXzRI_j1SzG_so8h3yFm0-hs8RWSkGZU-kuMOubfkon7QjDP_NGyDFREDGLxK4n_NxbXx86TzuoRXAJNcdGeRG-5L1HRqkOgBHMKSSnPCv0gY3UvbAwy1kOYmqLSOubZ685WbbNOMyJTx-qXQ2cGdnE0oqEmL-WKVmOv8iDVWZ52iHgFfSOOzR88zeDVBjdb96uZBcysIMMwkFEvfmHLckN48HXKqEDRV6RbTsSgBp1bC8oseCWhxdBBNnSjXFJ7hBub_ACEMM-N227mQIhdURYfIt06IZOCgBscApwMkSOexzxDD-sXszF6GtXQToPjXDEv9oRvciRq-QOaTg2-KwjCaEDsf3KcpF0MPHkoZxmQKGd1MlyLo2ACjmb-N4KCqITw0h9V7GQFYEJK-zNa7ksveM4nfVFkU52ygZSv-yBz2onwjbY_g5jZRZWxLApb1R6gNAuf-gv_6b-6rNfqskQpdlwFZInqHvZWsZ-MFEw35Ea2dgQgKjlE6fWP6RKrGRO23gYAWf47jxOFTNbc3TrvXQCfXC_lqDm8v9gEIYIePJx3u4tf8RaPQ7CiJfTBWP57npDVE2QvHIugPtUMr3GtJSMwYVnAAwLbhKTugCPl48K4EV7tMb8KHER7jxQibyvPzLg8UE_lbrKQYm30-eN-FVUJIo-wx9xFT3eYMHfu25NJKf1QGFoqJQQ5bE2tlwP8bzMxnJt4StLxrWWxVh3pByhEfq68r0ge7gqa-SQO34vJK8UYs_8YMhjnAz0lJu6D6MVOuBRxrXG_-q65LQZz2JK64EOl7zuogJI2LitaZ15MB5qjyOOyjNLLIj-SsZrNkk9vMc_EGabOSDxVYlAVmuJY1x0ElswJS2nX2gHg==","summary":[]},{"id":"fc_0d54375cbcd869820168f239bf07c8819c860ab0101d690dd0","type":"function_call","status":"completed","arguments":"{\"location\":\"Florence, Italy\"}","call_id":"call_xtoGn5KFzCOsLyeQv0INLRP3","name":"weather"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":60,"input_tokens_details":{"cached_tokens":0},"output_tokens":150,"output_tokens_details":{"reasoning_tokens":128},"total_tokens":210},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 294.551333ms +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1764 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"},{"id":"rs_0d54375cbcd869820168f239bd1e6c819cb857543cb0e2660c","summary":[],"encrypted_content":"gAAAAABo8jm966Ab9kxmDUu8vgpyqAPTcdexRXmAuzGq9I98ODGUbEphdXO5ikWTpzGh9YeGP_IkNo-9JsD1yJGbxWtqOGdDjTEs3QmNHUfa3UR-xqTzcjOvmq3thRE2DEQ5_-EXkPfYSAHkPn5lQXBECz6vkzRsncSK1EcTyGDrVXvnkRpiMdD3BWeA7wofiiZzcyk7j5R-BzDWH3TUE2ix3kqzCBY7dQJDHaLCqv-SSiIcmvqYNOxPmujSY_6O0PqJ6Ze5VzFs9pX3RLL2akYYKMjJF4gb6u7S_ZHKzjWWJcuywcn6t_b3l_PF3SL2MKPZLEGbHWIp8fCMo2FJbmHyJTI102X8rTLikr4qStE6oF0PzEHsbqrgXXE8BYDgGjF5dUbn_3Hm9yDJUWqZ4qoo8RuKLgBweNkaFOU_M3GC5vWHVSaAp5vNTwXZoWHm4sEa1Hp8tORuPFn-_Y-Tp6BuFViCZ86K9QIUcVRaTGYH_yFyqIKV7FhpQIbnp1p7GOEHUQksfk29ZlboKbylbOpTlt5sqgLY_MPUUiwJortZHikNr596BBhrGgylHBq57FK3hkIGYqBQ0XZQ9WT5jhNP3NmUDdjwNRfuh_nOGeRcXyP2otI9Cu_iWJF9lUBi4-1iwwEiTFrFc62WNGubgvYSd6nf4DcdDiO5VebGSrkdDKNt2lfV99wtHiVykHMtt6eNosHMdnmK1AVBNQhqEP94J-DnYEQeNgTzRsAUgjhiVG0UC5Gep5kYRA5oKlGZxIrmL9DD8kyCO7ASWltyv4y5sczvkQjS0LlulePcPPDofKaLZV8BzD7_alBKyeg1DrTxK0TRJWEP","type":"reasoning"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_xtoGn5KFzCOsLyeQv0INLRP3","name":"weather","type":"function_call"},{"call_id":"call_xtoGn5KFzCOsLyeQv0INLRP3","output":"40 C","type":"function_call_output"}],"model":"o4-mini","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}],"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + event: response.created + data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0d54375cbcd869820168f239bf6a9c819c801b36862f6e7a61","object":"response","created_at":1760704959,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.in_progress + data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0d54375cbcd869820168f239bf6a9c819c801b36862f6e7a61","object":"response","created_at":1760704959,"status":"in_progress","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} + + event: response.output_item.added + data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","type":"message","status":"in_progress","content":[],"role":"assistant"}} + + event: response.content_part.added + data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""}} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":"The","logprobs":[],"obfuscation":"cvpjFBvoJARCV"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" current","logprobs":[],"obfuscation":"r23DC7HG"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" temperature","logprobs":[],"obfuscation":"vw5U"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" in","logprobs":[],"obfuscation":"g51yWh34TxVhZ"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" Florence","logprobs":[],"obfuscation":"B8h9Wg6"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":",","logprobs":[],"obfuscation":"LH9ks9NYw3Q65KG"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" Italy","logprobs":[],"obfuscation":"KZ7KqLPvqg"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" is","logprobs":[],"obfuscation":"hZ0HxwBJjNUPc"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" ","logprobs":[],"obfuscation":"kHLsqD2S27DYjTo"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":"40","logprobs":[],"obfuscation":"qaVfQmMbDUPiGs"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":"°C","logprobs":[],"obfuscation":"KQr2dtLUTz416B"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":".","logprobs":[],"obfuscation":"5KwC7kdIdFYdnJ2"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" It","logprobs":[],"obfuscation":"XfIwteIiWTMyO"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":"’s","logprobs":[],"obfuscation":"8yRZZfbJxgatfU"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" quite","logprobs":[],"obfuscation":"ZF2PkVf3Pk"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" hot","logprobs":[],"obfuscation":"pkyDzfoOhyQk"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":"—","logprobs":[],"obfuscation":"OqqqjEzO8fLvvSu"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":"make","logprobs":[],"obfuscation":"3jf5lV3C84Ck"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" sure","logprobs":[],"obfuscation":"6dFqxVXpm8e"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":23,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" to","logprobs":[],"obfuscation":"4OusNjUQ4vIrW"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":24,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" stay","logprobs":[],"obfuscation":"5EejczIY03X"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":25,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" hydrated","logprobs":[],"obfuscation":"Rd1Fv9i"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":26,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" and","logprobs":[],"obfuscation":"jMUvUMm7IENg"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":27,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" avoid","logprobs":[],"obfuscation":"fmsDpQ3bzl"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":28,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" being","logprobs":[],"obfuscation":"fbE6ah2tDh"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":29,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" out","logprobs":[],"obfuscation":"RkCDBQ4hjbJD"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":30,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" in","logprobs":[],"obfuscation":"IZErEJhaQEKoc"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":31,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" the","logprobs":[],"obfuscation":"hqvyeJZJz4rH"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":32,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" midday","logprobs":[],"obfuscation":"FJSIzJ4WT"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":33,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" sun","logprobs":[],"obfuscation":"G8x1ix01cpoz"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":34,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" if","logprobs":[],"obfuscation":"BwsVzUaVVuLUv"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":35,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":" possible","logprobs":[],"obfuscation":"fxhEfn5"} + + event: response.output_text.delta + data: {"type":"response.output_text.delta","sequence_number":36,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"delta":"!","logprobs":[],"obfuscation":"HHcABqGoEgJfqI4"} + + event: response.output_text.done + data: {"type":"response.output_text.done","sequence_number":37,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"text":"The current temperature in Florence, Italy is 40°C. It’s quite hot—make sure to stay hydrated and avoid being out in the midday sun if possible!","logprobs":[]} + + event: response.content_part.done + data: {"type":"response.content_part.done","sequence_number":38,"item_id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","output_index":0,"content_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C. It’s quite hot—make sure to stay hydrated and avoid being out in the midday sun if possible!"}} + + event: response.output_item.done + data: {"type":"response.output_item.done","sequence_number":39,"output_index":0,"item":{"id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C. It’s quite hot—make sure to stay hydrated and avoid being out in the midday sun if possible!"}],"role":"assistant"}} + + event: response.completed + data: {"type":"response.completed","sequence_number":40,"response":{"id":"resp_0d54375cbcd869820168f239bf6a9c819c801b36862f6e7a61","object":"response","created_at":1760704959,"status":"completed","background":false,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"o4-mini-2025-04-16","output":[{"id":"msg_0d54375cbcd869820168f239c05098819c88648f5c1c886e75","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The current temperature in Florence, Italy is 40°C. It’s quite hot—make sure to stay hydrated and avoid being out in the midday sun if possible!"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"high","summary":"detailed"},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":96,"input_tokens_details":{"cached_tokens":0},"output_tokens":37,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":133},"user":null,"metadata":{}}} + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 545.923042ms diff --git a/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking.yaml b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking.yaml new file mode 100644 index 0000000000000000000000000000000000000000..99c58f066b0843d9655e7719c164130ae74e6d61 --- /dev/null +++ b/providertests/testdata/TestOpenAIResponsesWithSummaryThinking/openai-o4-mini/thinking.yaml @@ -0,0 +1,235 @@ +--- +version: 2 +interactions: +- id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 553 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"}],"model":"o4-mini","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_00f45739b037a2600168f239ace760819697f5959cb071a64f", + "object": "response", + "created_at": 1760704941, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "max_tool_calls": null, + "model": "o4-mini-2025-04-16", + "output": [ + { + "id": "rs_00f45739b037a2600168f239ada3208196b9f9ec02572cc644", + "type": "reasoning", + "encrypted_content": "gAAAAABo8jm7xqIpOPbNnX4taz-HWeJL_L229xxdawa7BOkJxAeAguZU9nRYIQSTsFCLW2EzdVhj6SlCTbGTuOzEr_CvqREKlQ1IrSfW4e2-guPg_G3krEKwWcOrm3K8dIg_BWJe5Y-ogjUn30m0wU_IoaS7iJhtoiX5xbwBB4m9pymDyTF3otHTPLpkUeHI6zGJyETZYQ32bjQl8PKqortMp6JmUdRAEnVfGnbuG1SNOVkXvkk-j47eS0kkWnk4ioNvAWZaY6iWSETR80gx5eP3gBVeo80v3-PiuxoZIpIs31C8Y0ISSwC-cTlSvs_KFwzbnpkAiORU_mJ1DFQ6O2GatOy4sZvVwYxdUX3LIZs0tKbMJSbOoNVHDuq7PiiX8FZEno40og2M7YxE0uKhd291GhqY20vEvDA2f1lM2ILTHWm3r-TePkSy3XNcT60jieAhHoztL8u6GzOvkM_y96qVQebbsi8_dhzljZj2LETiV_VcnjKB4hjnA_9KULZLlD06sWJDCj2ePdeH383jcFZfp-ikum-8bC0JjW690R3GKFfCvY8RZb2UqTTj84mZuPsZ1rrB9onA3tXRbn77iYPds6pAKE2G4rc09FMh6RBFTRP5RRhkHpHO5uDpsR66UUKLhnv81ndbwuovwlDy4fqSSiJ7WTWdsu8zjUFWc5VgGFewQhMfV4pS5ue-y7YYqNVYzAx9sMw14FvWF6SZBnfcpgepOcCGnulaOOFFUe75H3voaQ5EJ38pE0zAXcgUtiSx_YdhVEPIAf7BGbDjZrE6dAns0d7PIhSqXYsV6c34DMwh0HmfQkQPx3BupQaMgfDMKsDovFLW3GsXe-YVk6d01UnMYEsIIMLByF5FpGCuc9bwGpgwljNf42HPaARLdWCGY6WW_ysxFebewRqSGMkMWVAZuR6khBJ89YnNThLWWR64nTwr_32OO2cTStvcn1YLP4jKhgz0YBu2EJuBJIYeHCP2xNEY-zL4_8Uld0bZDKaE3W54GK-eHwEJ1hEQqHhheCbFTYRzQWQEWYqjMG4pQlMboJrcJAfd4QF3tWwp4lCwLr6WGBUPwK9J0chjILV6Ry78Z829dPl2YI_lBmOtG1FsmtKBCj-tXTOfN0_lhhy57upsu9M2oH5Mb8iNj1M-LXlsQdsFqLjBkssagUQFjlMmXJiF2LbUdVvjFMAbMyWmEJLV5UzqsaLClYA6sSun8dDpml4Z0FfxLysfmXUdo1NGYhrN166U_kC8779mREHTkGBvtHwsW_5CTQLIRbZtixV0yK0giOuUuVcxfnK6x0_Gcvu_frnUWji_FD71sa02y_1-3wrzyCckhzNhvb4nZEliu2DcuYk9LGrhbNZZRhBDKFwP2CMm4L3HLaPbThc7WCIaYa_pmoLGRQaWHjUoyU8yakbR3z8km1YEMHoxLIp2furli6y7S9KYSfO3ewh8AHrDf7JKesHEAynvYZp6qS3wehOIFwfewwZJhI09HOgpgRPTLc9PQcuEDSGj0BRzCAX6Iom06x-adsHrnJS9LtH1WcR8OOF4D02R9pjnXwvoSsWiUoSKbM3-b4HPdnupqq7FAQsvwlUy7n8yE8Mz0nIlejbOTCsg1nfJ2enzLD2JcdtPdG1bQI-GNGmBabPWt_YHolQ6pMlfhx8QZSn0gLgrL0nJeB5nZiP06xsEflkcVUXfiu8spA1tkxu8VYH_HuamCJlnr-BYXsiOuUmCYq5LJLB2dcVYoH_7HrQHE0m4vgl3abTNwBIsHyb-tomHiVQZoET9MfTYaNckcGQ-WAYjd5Eu37Tu13dfde_Nx7Wz0pRRPDonmBGRFuotdaL7Ey6WnzcDinRbqNke6tF1pIN9fjN5U5yYa0uvpbKVAVAO7kBdO7-Ns6MsqI21CdS0A6SS9C4n6sjCdiJ4vDzDJWXpH4PAytK6dLcW1KoRV9GXjYl5wfd2xcQeO0AVx9xfDHuQwk7i_CvDaaqqFq4tKCzKvOdc7bULf7xKyHxzrGbXoiH1EEWfrzIP8P7xZdPHNDPj9LS5iKDHM9SJX6Nfefnmjr6PX3C7imyiKebGT7Ap0sNjXsvpMRBtHNaVji29qjFXhXKBQSRnIjfng1bFboSpgqLUEzT8Z_K87cGkb4M8QcJgeiBOfAs0GSV5fE6OY-u1vOfuivmqjzxjWpstxrsUSnPPQtNk9NfJERLzhvUZmeZBExiN7O32_2iwExbFwxMCPn3XShR92CIHB7-rIeZV-gVPLcKJUy4EueclfHDFDZbbp5Pj37hZr3Q2dqarGyDcnMXIss_bsFHH73wOKiusvX5GR1LDFqKnTkDXwhkCUMIPwET9h6N9VaS_cAjFUwIfXc4KsbNCws2s3N8ZIGaQR1R1gIGxG7O0lfEA7kwDff76CT11G9I7De5GLCev5sJiZtT5qxjKUckKlM8WkfvwjhDHnhwV_rmiodeU5YnodTMHdzzd7FNBopEr9sOv2p9iiaxrVq0xcjw7sY3zd6yFnDPg4P5KEz2SieNYZi-KefO10KtjnaiqNnxxWmL8_wJhyRru_bwiU4X35Ajob7uYrV3yuo_IK_AJ49KuXsS8ISiSmFPiOyQPIhTPqbm1fN6o8WfAhVVuIcZ5xIOIzTaXLyHp7m3JkzXEbwTIZvJSKXXGyhj0XRZSCraQVj1MRYdhHBARORP0VrgQ7Nrg5ymIM7v0NFDSkSWDAVtIbvZIbQFzHkfiUh8W3CBe2XJNpsvyUAEi_yxCfEWOBdVuqqXQPwWFDI1dbPSmqq266JS4bJ9yBONfme0RZK1fFKCGtRFQQygHlF7NJMirCvYqKV4aZRA-mF36HlGRdSkDioZAyVHpMpZ4QVr2bUW0sx7wJMi3VhtLlCEzP5o2syZHPl5VaU70iyNkt9L5I3dIZVQ1z8ejV7Fh8oDjBoPcEhf8510ykm-wXgiqz9Kanb_fgQZX_PS66EY7EFTbGVmoDNlbwTg6XzjNYa8qPIP-rLL-sGkXubNT8l2xRZcehu7QQ4bG5X3sy6QA9lpGGD5sPk3aa3_F84FEclxIlmQOUy1Ng5bWgnzPRDWU4Bx4M6k6empXQZvOawobsA9EZOVoem0yB9WfcoVLVzFaGqUpZ00477PeLb37ARxN94hCo6z7Z39hbd3tHWji7Dv632im-S36nJIGLhFkR1idC0BtdDBRtG-RcCzBv2iPFflnmXe7f_j8TLyBcOZ0NoIcwpycD3ry6FWrYNlQuioNDZeqmBspShklQvfmeX7BVU9vJA3N1tdhjR4Go7uitaccWBSIEYPbnPe4rYBlFQ3iUaWKAf-_aszAArg8uOyKACBGltCzWWJjQsoivdMplSUtV9n7ZpcNcY3JZcSdWlkuDa6xFx1RnMKTuwbZZ7SuMcv9XX5Kp1tXbIdo1PYnECKHvkqICn5xSJyB9FP3XXoBmr1dpNucd4F288y0KuwTuDigViZnec_X4g81_tClm5634xyyH5-4Ew46hqre_UQULwnOtYjFIfnSmSwzmgLNGibE_h577aRO57miyAr05j-asTnpoOnDMIcw6yzQRdgToiiCmf4ZKRjKsKYCzYBLdobjxewLdF4BdeYIlbwyVy56nyn0fxo9ALvW_JRnEnWmkA_lvzn7qAlCm3Z1gWma2HGoCmnCGxTRSYc1LxLrSkR1-T17PiL-0uLVU_z7eve2d8FJ9x6HU4euqpeV7bcf2TIWsYXhiDbBO3UnU8OhkVlKpEMsQEX2-aljJvsz0StYaDpgU1ivBVW389ZR5No5YiE6_SVYxjAzL7JuONFbxrxZiurlZRsL966JEGUdjXQHgVd2R3NU7bfkNPHinLwb-31IYCxHccmW8xxHd8Gw0cSlZq2iMPQ4LVm7vLhexwuvqWfoV5agGmU8Oebxjbffm1f4QCIsc-AcdkEZ0OO1mAZUpvFI5XVUUF9xtCmFA06ML3VcGZi-j7I4bxJ6A70-S0Gko5vJW7s7obQGVrBqY9TINilJrUKhSGu5vqiQ_8uyfCk96pqFGSVi-jT1bKlUBbyrXcjqjMOgeiw3jluzDND-GM31wK7V-DzICcBNaGq9dws1HZXThm6-nwnEe6VxTTNidlr2NKkiGXufdGDSqb2MrwXca_-j0d1Y048QswFa5DJ6HRF-Y7vI6Td_3hjlXGhfo0XWKY00J6jFdnjEVAzcYF7rcruXQzHfT8FPp7SWgQeu6arM3VrIp4y1aFim_zypRRXs6HxRzPwf7gH9aaZ1-l2UpVOGRKtUUKIreWNlkZCFTifYEoxYrSAuxI53exaHN-y1fVthU5XD7oEf2rLrb1zRF8aqFf-v9bq_5ymWTDTkUjheS_qql-SWtvg1-yvNHjQSiljS4BN2GUUnmX69BxsuC31aTi0off6fgOB8oh3M9FvhkwlaP16oLvghsLMT8fiB8xC8voPXhxAAz8tsTWRDLihKqR7F4l7bmRBbi5dqIftL_UyzTiScRITUl1NMElID5Nu6nJI78rwpTDyj9cD9E7C8nxkqZ4xSlClwWkAfnl19h3jAvcoVamuayGXEdzUYQiQ9ZndH4Loi1MIPkcdek7VOJKbPFet9IwW1hYdH3KClVCbwzTgkIpwPVuAQnqY1wbe--wepgI-4n5EOn7UwN86EpMZ04V7tUw5VwTpEWKDvXaUdjcy8n91M5AOFAXP5PnhZwPGPUCzF69a7cvhSxlm3wwqqeUWEvQECfO37QjQ0kCgnXH6u66JooCvfw7gXau5ipfQ2sVXwCetc96R7QYA3eDNod7kWOYQFqJf98wnrXxM1mvuSo7pNcWoYH2yBOt-QEt6fPr_eGl0bzreAcW92SBwS4KNkFQCYyfM_5f2kvZO0-VoOYCIZJK_jfByWYLPaDGmm0q1QuziP4GvCaM2wIz8jnRSJCZct4scxZLv4zyzqwyALgXccUFMlpiSb_W6YNft7L0vUNNVCIW_o64dj7vrmmsu96qnK83TOK3QsPq48S1-C4bTB3eGgjFCs8aKh47u4W2EfJLNv5o_zEymCutj5cHRpIM-vvVfiVPAfaLp4uvHhPDGs_Ef2z980447hoqzIjlf5Dt8f-1P_oRFbhIJjH8QlkRXfHKYcpqw_Pj16bbPNRpybiVDndKVUH5-Bl9xRUeYlv5cWnoL9eqZaQMJuj8yzXLW-EHQtJzZxkc5ZpKAzxWHa6C2-yeC0ysjurv8dS8Toz2ADzaS0_q_jJTTUBTQLnzY2iKXgL8ieyxM6GeRrR3e9JzoIvR8mb-v6i8Mho4d1y8iGuEcPBuB9BXXdKNvI_QZY2s4j8Tot3WZszT7IeiD8xlRL59bSYMlZDubIEhrZa88g2UETPqWK8hQlPt4Faa1YfuU1O7PZr0pa82BJWZHxeDGDbLxbSzDg39cngXcKpaE-1TOm-dgzVvPc0oxxOhw9AkFQOqHuWbIQhLOH9rIsu6RPhaDspnW_o3XlzzkjPsqGg8wmMOwZQ9EAFKV7imlj93FjfqxHdTX061lBSl9euneWTSrTBQjqNx3jkUdfa5sOh8YGt-eycbISmPfvH5N0cAow3Y7MD2aEeG6xlHznVZPrZ4xBKjixX514THnQiaZwUFNjWPjXwT9rGBDHyMbEbNSrZF2bgd3KYexNTirLNX-wvJld6kb87Kk-WpDaaGxtyCOj02aoleC5Ph-GhkqVMsxncrcMZeN6liUxRfNWtuVbfkWj9Bp-xT0qi0Fb9vN-2T98GbS66zNpFa96lrf9IVMgWR6h3u8-TXL4WzdAg_YQpmWZpqVfj_1oWpCgS0DU1bSLz0iFRMYw4FRoKMLRx8mjfmoQnqzStrTNiyk9JjYte5_Uy9NeQaCcoEYBAs1n3JZb-HsnHxM3En4dL28snqfHAqfUBxX6u63uSsnF3lJhtry5vFpeIEN4lrrH10QIbLmjf-5fPHTq1QY31XaaZ3VkAtlOxgL2-jkQMynlcfXw8YrovBtetSozLXW_M0BS7N2kZOfLSd03Dd0BIoPOJ40VmlnXYmNanjb1wv_DJFaaT95Pp_idVoTFAztHW9F7XEMLpfXjH51j1Fe7MhZcgCy4Ef_gGrHFFc_gL0JD_xtnEjBnK8IZhufUrmJIgeDgsmQ3BcvW4qKJd7ot9BLwof7DP4stxD6_8lh62kosEoHog4HeUStwqa8S5NlOrlW5kSv9seQRr87hMIyX0NUJRkc6REAtgAygV9tceCVCh7P5KNaNWmuK-AoLLsQJLK59kiV-UdjUxXWWloKZh541qf-ua_kc0ne1Y8W6yet4Mw7bbgQGMQcuUUOz17E5EQBJrm4ZVV3iRv9N71h8qZi7aiCzsIWEE350K9T9F2py91ObA-Xi4SXQK4WEd05O1lLi4ag4XNvZ0x34p2nPoaxpoCNvCVp1icxwjlCagZ-qjjKwmNt83SRRAe7uwyDVwB8G2tkh9Paqt4TFTcjOJhEwVrLm1SlLV8oBLVKsmtnT9fW2DKlZNdfMVOwYzkufwc7W25i5yVj2fYdgJlQvSkwZx5a5JN8kuO0NIQwJ6NFla_qW7io0_BwE_zvgMgZ2HNUc4lGY1K0sEmAsm8Yv7b4qxhx0o829wdsBcBSWVhUMdSuksOisr4WiSurexcKkhJVufl7NspCVFHeNeYr2c07dS06bk_xafqIxkuyn0mQt5fYjFbLN-oZiN2txDLzx3KIuYOe1Z9_EsjEbWPp7uNNRfEpynlf0EGJ_ZFW1_zkgyuBNoWwcwZnyQOAN12EbGwnw1RzGfPouzgxKAKAcJEuJHhbyghWOC4Yk2lK56QuiZss4CFlTThhFCTFJ1fF3N6VWoPwUUzY5UWfsIlqIgOCUHNDKCI18pDuYd2rCixKHs7PLOoVdUOU1lv-6iKuGfPrhG9Xo56KX9PDOfVwO1TRa-hICs8oF7vnlFiCDnMO2Kgt_NKLDpvE3apafxx8a4PIFNc1EUjA6kZzCVjILgksTrZOUDqZP2AdpEMPU4Vg2v-IxZSqEY0arQsAtMkdESS437QvDoa-UJhMv0Rid27HUAKgkKA7yVZCsC_n1xiOm-cqGD_jei_iAakDPnBQdX678UG9kJmcuyj__C8tPmRnRVZwt1peaMqo-Z2xISMH3BzxI1S2HrLgiSp4epUo3nAFfN1M0ugQdK8mTKSzBjxCeL13-bQa7vaAqtFjrMQrwTlRJpL1tUQKjC_nrjgYY4sObO8FokbFx9rH_aPH9I0IXrd2lFktTMRtp0ETSmzc7FKyzMLZRxAP6x84Mv3hXmT82e96LbE4maeFJTkaILrV8e03x-CetgcsIzCN9PvQdTQqcUw9Ml-GxL1896zBje5lwEZEtDXVyfpwr-cE8NGiRp59dE2Fs47ogMgZsHJqpYJlimj2lP2ExgHYgogsNOj9yM7YxlbVJpLlo5RtynA6GWzLnV9BSSjrkXBM444SZILrx2-rBSDeAlQH4ViYa16EHunLPXyWBzCxth2ubmoAkqxsPTr-fa6JjoZlWecg0QH6H6PTXVd01QwS68Bbwrcj8n35LLNaWVm5Dpy46lMzPaYFJlW4dpXVRJ2WVkLnTyPdsnWIqQ22K4xeZP1mTxZPf-XYVC6eHD5PBQmx8cUiqYLe0WA9pvtKwkfLjAuGlZbm-N6SMgs1Wcik2dlFL15TDJJv58DHxZcEGk5RNz4daVQNQLMyav5AhcwF8wC20AcjS0pjsEKGXPXKur7CtyfkPHA0MBlDEZre6nenkXo6jp-ZTgqxYJCXZXgZqLX9Qw9tibmt1Sf9x85XaAkq7hXikPZdHyWczjdS4YA-3gSnwpJ5gS-0tetWag6fkzkI4qHFMg9UrNXGVxrxsEUH9Jbwj49VJAJkgSJWVJgOSPtKPPwzAiSMWWttiFTVCVLXB3tbn-kHMUlvlf_zlTyS2HXHFyIZpqTpwyco6LyST7PBvJan_c99eAGmkOW5Yzua_EeVwSOlHs9s-1cDxkxGPVyz3GXRm_T1qKZ68ILQtUc8c8hNbvgbn7ctnkSIMHSzHoBw0rHaMRX1KDB3j-s-3Uys9myyChiqufM4L9V5aaXlnN91mv4vPURzIVS5TReWqjN7z7lm4M8WgcjkDj9Rvx60qD73CDkJLy77uFT6iJXKDneM1YSKse4r20zQ0OkwcDjb7iEowcqHgvx5KEppKdBWccZWVNHJXZl-tfGI5lWbDPwuWuEK64RIXZJe6JykSphNbWzz5oSp4aMqv4MFWggcKdYkVrlGovI3EpLElDHqBswUUxNJ2JWyJfdtWujOWmNrhpKZbq6EvqrqFd94X2Ay5D_Xz3EO4jRJZhbw4uRUAlrFDRoBUtZ0gFeL-N6ab6_sVdR3U6BV1hchCT-v7Zbt5No_4ULgQ4xb4QYqHL3DVwqfm8UPlGhivAc5n8QFjv-e86xERdWI39x7fE6v2oWCzLmQKW5GBX7ohbbQyOU3c96Haa-N2EQOjms5pQfa4-YJ5E_o4n6LSLtprIfY-3O316UfQNTvbsSkYv447LwoyS-9sHBklvC8RbN36s71UOrCLbGk9S6ypfxnIRYPmrhpd1wHT_jB0fCqQJZwgI5mILYqXnH-uqoHKjUqSPgHnhzT-iVqVSBE6Zq8xqUut-LqESULZ81A35SiGwlYrIQy5dHs5wadUIdbNz1ZWWI2ZybVTE39Ukv1DQp9MrhmYJZYrapTpguEN2me-EBjNNnpLRDsO86eSQAhVzV9J000jIvXxGdlUo3SKwZfM-1P0L2CdhicIgI7-KVSGrpJPxQA00Keey2Oj4P6Vdzsrp362WNlkuMIqueVSfRl8P63JzASuXCRlPwDKZ19D15h36uiyvgtBsKhPeAbzGfM7UTLFU-q5vP1gHgpiLqs6Bw61oo7E51yTu6zrmHukuao-AOGhKbctckfrvrVuZ7PpxD_tuQCoYeHUCW8-cjsh8rVsaA0TOo8g_TGpM-c47gXMYjUbfoo-mJV2hBZSW4a3npoZMgCCgPchFzJONFqs7VEcaVS6a6oXDl3woqq0v_LzNLfoGll6ixi9c5okjLeTvf3z6MROAabvxedMD8u8dkLqvL86q7d4FDrvBZDM8E5DbryvvVRPp9rfSa7KLwInjrM9bzpnV4e7TTk7-LDKg54YU8GF_RLC2vIdOvCRGE23BfG2KZVZof3rmhMITLEbGCSL9zd34d2YXhdqbOsTJ2DaZq_Nwii1lx5RBSf_6RSKyPwm0Q7vP30QKAE6FBMHqr2CQwsldDC9R-nI9Y_FNIrbo03lkz7TQe66pBOCUL22IXO1tcdw6PHnowVfOoI_pzrEAwP66gwnTC7Ysb7hREsTH9SIO-EZvPAb_045jovUfYTQmdYZmTgyr-zPzWn-jkprYnHEUX82Hn7LN3cTjRRNvhH9ELSmfrWYhRaW2Q==", + "summary": [] + }, + { + "id": "fc_00f45739b037a2600168f239bb58b88196b17b26934fd24de2", + "type": "function_call", + "status": "completed", + "arguments": "{\"location\":\"Florence, Italy\"}", + "call_id": "call_ewLJJaD4OO6pdsTnaDtMuNn0", + "name": "weather" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "high", + "summary": "detailed" + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 60, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 1302, + "output_tokens_details": { + "reasoning_tokens": 1280 + }, + "total_tokens": 1362 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 14.800628916s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 10319 + host: "" + body: '{"store":false,"include":["reasoning.encrypted_content"],"input":[{"content":"You are a helpful assistant","role":"developer"},{"content":[{"text":"What''s the weather in Florence, Italy?","type":"input_text"}],"role":"user"},{"id":"rs_00f45739b037a2600168f239ada3208196b9f9ec02572cc644","summary":[{"text":"","type":"summary_text"}],"encrypted_content":"gAAAAABo8jm7xqIpOPbNnX4taz-HWeJL_L229xxdawa7BOkJxAeAguZU9nRYIQSTsFCLW2EzdVhj6SlCTbGTuOzEr_CvqREKlQ1IrSfW4e2-guPg_G3krEKwWcOrm3K8dIg_BWJe5Y-ogjUn30m0wU_IoaS7iJhtoiX5xbwBB4m9pymDyTF3otHTPLpkUeHI6zGJyETZYQ32bjQl8PKqortMp6JmUdRAEnVfGnbuG1SNOVkXvkk-j47eS0kkWnk4ioNvAWZaY6iWSETR80gx5eP3gBVeo80v3-PiuxoZIpIs31C8Y0ISSwC-cTlSvs_KFwzbnpkAiORU_mJ1DFQ6O2GatOy4sZvVwYxdUX3LIZs0tKbMJSbOoNVHDuq7PiiX8FZEno40og2M7YxE0uKhd291GhqY20vEvDA2f1lM2ILTHWm3r-TePkSy3XNcT60jieAhHoztL8u6GzOvkM_y96qVQebbsi8_dhzljZj2LETiV_VcnjKB4hjnA_9KULZLlD06sWJDCj2ePdeH383jcFZfp-ikum-8bC0JjW690R3GKFfCvY8RZb2UqTTj84mZuPsZ1rrB9onA3tXRbn77iYPds6pAKE2G4rc09FMh6RBFTRP5RRhkHpHO5uDpsR66UUKLhnv81ndbwuovwlDy4fqSSiJ7WTWdsu8zjUFWc5VgGFewQhMfV4pS5ue-y7YYqNVYzAx9sMw14FvWF6SZBnfcpgepOcCGnulaOOFFUe75H3voaQ5EJ38pE0zAXcgUtiSx_YdhVEPIAf7BGbDjZrE6dAns0d7PIhSqXYsV6c34DMwh0HmfQkQPx3BupQaMgfDMKsDovFLW3GsXe-YVk6d01UnMYEsIIMLByF5FpGCuc9bwGpgwljNf42HPaARLdWCGY6WW_ysxFebewRqSGMkMWVAZuR6khBJ89YnNThLWWR64nTwr_32OO2cTStvcn1YLP4jKhgz0YBu2EJuBJIYeHCP2xNEY-zL4_8Uld0bZDKaE3W54GK-eHwEJ1hEQqHhheCbFTYRzQWQEWYqjMG4pQlMboJrcJAfd4QF3tWwp4lCwLr6WGBUPwK9J0chjILV6Ry78Z829dPl2YI_lBmOtG1FsmtKBCj-tXTOfN0_lhhy57upsu9M2oH5Mb8iNj1M-LXlsQdsFqLjBkssagUQFjlMmXJiF2LbUdVvjFMAbMyWmEJLV5UzqsaLClYA6sSun8dDpml4Z0FfxLysfmXUdo1NGYhrN166U_kC8779mREHTkGBvtHwsW_5CTQLIRbZtixV0yK0giOuUuVcxfnK6x0_Gcvu_frnUWji_FD71sa02y_1-3wrzyCckhzNhvb4nZEliu2DcuYk9LGrhbNZZRhBDKFwP2CMm4L3HLaPbThc7WCIaYa_pmoLGRQaWHjUoyU8yakbR3z8km1YEMHoxLIp2furli6y7S9KYSfO3ewh8AHrDf7JKesHEAynvYZp6qS3wehOIFwfewwZJhI09HOgpgRPTLc9PQcuEDSGj0BRzCAX6Iom06x-adsHrnJS9LtH1WcR8OOF4D02R9pjnXwvoSsWiUoSKbM3-b4HPdnupqq7FAQsvwlUy7n8yE8Mz0nIlejbOTCsg1nfJ2enzLD2JcdtPdG1bQI-GNGmBabPWt_YHolQ6pMlfhx8QZSn0gLgrL0nJeB5nZiP06xsEflkcVUXfiu8spA1tkxu8VYH_HuamCJlnr-BYXsiOuUmCYq5LJLB2dcVYoH_7HrQHE0m4vgl3abTNwBIsHyb-tomHiVQZoET9MfTYaNckcGQ-WAYjd5Eu37Tu13dfde_Nx7Wz0pRRPDonmBGRFuotdaL7Ey6WnzcDinRbqNke6tF1pIN9fjN5U5yYa0uvpbKVAVAO7kBdO7-Ns6MsqI21CdS0A6SS9C4n6sjCdiJ4vDzDJWXpH4PAytK6dLcW1KoRV9GXjYl5wfd2xcQeO0AVx9xfDHuQwk7i_CvDaaqqFq4tKCzKvOdc7bULf7xKyHxzrGbXoiH1EEWfrzIP8P7xZdPHNDPj9LS5iKDHM9SJX6Nfefnmjr6PX3C7imyiKebGT7Ap0sNjXsvpMRBtHNaVji29qjFXhXKBQSRnIjfng1bFboSpgqLUEzT8Z_K87cGkb4M8QcJgeiBOfAs0GSV5fE6OY-u1vOfuivmqjzxjWpstxrsUSnPPQtNk9NfJERLzhvUZmeZBExiN7O32_2iwExbFwxMCPn3XShR92CIHB7-rIeZV-gVPLcKJUy4EueclfHDFDZbbp5Pj37hZr3Q2dqarGyDcnMXIss_bsFHH73wOKiusvX5GR1LDFqKnTkDXwhkCUMIPwET9h6N9VaS_cAjFUwIfXc4KsbNCws2s3N8ZIGaQR1R1gIGxG7O0lfEA7kwDff76CT11G9I7De5GLCev5sJiZtT5qxjKUckKlM8WkfvwjhDHnhwV_rmiodeU5YnodTMHdzzd7FNBopEr9sOv2p9iiaxrVq0xcjw7sY3zd6yFnDPg4P5KEz2SieNYZi-KefO10KtjnaiqNnxxWmL8_wJhyRru_bwiU4X35Ajob7uYrV3yuo_IK_AJ49KuXsS8ISiSmFPiOyQPIhTPqbm1fN6o8WfAhVVuIcZ5xIOIzTaXLyHp7m3JkzXEbwTIZvJSKXXGyhj0XRZSCraQVj1MRYdhHBARORP0VrgQ7Nrg5ymIM7v0NFDSkSWDAVtIbvZIbQFzHkfiUh8W3CBe2XJNpsvyUAEi_yxCfEWOBdVuqqXQPwWFDI1dbPSmqq266JS4bJ9yBONfme0RZK1fFKCGtRFQQygHlF7NJMirCvYqKV4aZRA-mF36HlGRdSkDioZAyVHpMpZ4QVr2bUW0sx7wJMi3VhtLlCEzP5o2syZHPl5VaU70iyNkt9L5I3dIZVQ1z8ejV7Fh8oDjBoPcEhf8510ykm-wXgiqz9Kanb_fgQZX_PS66EY7EFTbGVmoDNlbwTg6XzjNYa8qPIP-rLL-sGkXubNT8l2xRZcehu7QQ4bG5X3sy6QA9lpGGD5sPk3aa3_F84FEclxIlmQOUy1Ng5bWgnzPRDWU4Bx4M6k6empXQZvOawobsA9EZOVoem0yB9WfcoVLVzFaGqUpZ00477PeLb37ARxN94hCo6z7Z39hbd3tHWji7Dv632im-S36nJIGLhFkR1idC0BtdDBRtG-RcCzBv2iPFflnmXe7f_j8TLyBcOZ0NoIcwpycD3ry6FWrYNlQuioNDZeqmBspShklQvfmeX7BVU9vJA3N1tdhjR4Go7uitaccWBSIEYPbnPe4rYBlFQ3iUaWKAf-_aszAArg8uOyKACBGltCzWWJjQsoivdMplSUtV9n7ZpcNcY3JZcSdWlkuDa6xFx1RnMKTuwbZZ7SuMcv9XX5Kp1tXbIdo1PYnECKHvkqICn5xSJyB9FP3XXoBmr1dpNucd4F288y0KuwTuDigViZnec_X4g81_tClm5634xyyH5-4Ew46hqre_UQULwnOtYjFIfnSmSwzmgLNGibE_h577aRO57miyAr05j-asTnpoOnDMIcw6yzQRdgToiiCmf4ZKRjKsKYCzYBLdobjxewLdF4BdeYIlbwyVy56nyn0fxo9ALvW_JRnEnWmkA_lvzn7qAlCm3Z1gWma2HGoCmnCGxTRSYc1LxLrSkR1-T17PiL-0uLVU_z7eve2d8FJ9x6HU4euqpeV7bcf2TIWsYXhiDbBO3UnU8OhkVlKpEMsQEX2-aljJvsz0StYaDpgU1ivBVW389ZR5No5YiE6_SVYxjAzL7JuONFbxrxZiurlZRsL966JEGUdjXQHgVd2R3NU7bfkNPHinLwb-31IYCxHccmW8xxHd8Gw0cSlZq2iMPQ4LVm7vLhexwuvqWfoV5agGmU8Oebxjbffm1f4QCIsc-AcdkEZ0OO1mAZUpvFI5XVUUF9xtCmFA06ML3VcGZi-j7I4bxJ6A70-S0Gko5vJW7s7obQGVrBqY9TINilJrUKhSGu5vqiQ_8uyfCk96pqFGSVi-jT1bKlUBbyrXcjqjMOgeiw3jluzDND-GM31wK7V-DzICcBNaGq9dws1HZXThm6-nwnEe6VxTTNidlr2NKkiGXufdGDSqb2MrwXca_-j0d1Y048QswFa5DJ6HRF-Y7vI6Td_3hjlXGhfo0XWKY00J6jFdnjEVAzcYF7rcruXQzHfT8FPp7SWgQeu6arM3VrIp4y1aFim_zypRRXs6HxRzPwf7gH9aaZ1-l2UpVOGRKtUUKIreWNlkZCFTifYEoxYrSAuxI53exaHN-y1fVthU5XD7oEf2rLrb1zRF8aqFf-v9bq_5ymWTDTkUjheS_qql-SWtvg1-yvNHjQSiljS4BN2GUUnmX69BxsuC31aTi0off6fgOB8oh3M9FvhkwlaP16oLvghsLMT8fiB8xC8voPXhxAAz8tsTWRDLihKqR7F4l7bmRBbi5dqIftL_UyzTiScRITUl1NMElID5Nu6nJI78rwpTDyj9cD9E7C8nxkqZ4xSlClwWkAfnl19h3jAvcoVamuayGXEdzUYQiQ9ZndH4Loi1MIPkcdek7VOJKbPFet9IwW1hYdH3KClVCbwzTgkIpwPVuAQnqY1wbe--wepgI-4n5EOn7UwN86EpMZ04V7tUw5VwTpEWKDvXaUdjcy8n91M5AOFAXP5PnhZwPGPUCzF69a7cvhSxlm3wwqqeUWEvQECfO37QjQ0kCgnXH6u66JooCvfw7gXau5ipfQ2sVXwCetc96R7QYA3eDNod7kWOYQFqJf98wnrXxM1mvuSo7pNcWoYH2yBOt-QEt6fPr_eGl0bzreAcW92SBwS4KNkFQCYyfM_5f2kvZO0-VoOYCIZJK_jfByWYLPaDGmm0q1QuziP4GvCaM2wIz8jnRSJCZct4scxZLv4zyzqwyALgXccUFMlpiSb_W6YNft7L0vUNNVCIW_o64dj7vrmmsu96qnK83TOK3QsPq48S1-C4bTB3eGgjFCs8aKh47u4W2EfJLNv5o_zEymCutj5cHRpIM-vvVfiVPAfaLp4uvHhPDGs_Ef2z980447hoqzIjlf5Dt8f-1P_oRFbhIJjH8QlkRXfHKYcpqw_Pj16bbPNRpybiVDndKVUH5-Bl9xRUeYlv5cWnoL9eqZaQMJuj8yzXLW-EHQtJzZxkc5ZpKAzxWHa6C2-yeC0ysjurv8dS8Toz2ADzaS0_q_jJTTUBTQLnzY2iKXgL8ieyxM6GeRrR3e9JzoIvR8mb-v6i8Mho4d1y8iGuEcPBuB9BXXdKNvI_QZY2s4j8Tot3WZszT7IeiD8xlRL59bSYMlZDubIEhrZa88g2UETPqWK8hQlPt4Faa1YfuU1O7PZr0pa82BJWZHxeDGDbLxbSzDg39cngXcKpaE-1TOm-dgzVvPc0oxxOhw9AkFQOqHuWbIQhLOH9rIsu6RPhaDspnW_o3XlzzkjPsqGg8wmMOwZQ9EAFKV7imlj93FjfqxHdTX061lBSl9euneWTSrTBQjqNx3jkUdfa5sOh8YGt-eycbISmPfvH5N0cAow3Y7MD2aEeG6xlHznVZPrZ4xBKjixX514THnQiaZwUFNjWPjXwT9rGBDHyMbEbNSrZF2bgd3KYexNTirLNX-wvJld6kb87Kk-WpDaaGxtyCOj02aoleC5Ph-GhkqVMsxncrcMZeN6liUxRfNWtuVbfkWj9Bp-xT0qi0Fb9vN-2T98GbS66zNpFa96lrf9IVMgWR6h3u8-TXL4WzdAg_YQpmWZpqVfj_1oWpCgS0DU1bSLz0iFRMYw4FRoKMLRx8mjfmoQnqzStrTNiyk9JjYte5_Uy9NeQaCcoEYBAs1n3JZb-HsnHxM3En4dL28snqfHAqfUBxX6u63uSsnF3lJhtry5vFpeIEN4lrrH10QIbLmjf-5fPHTq1QY31XaaZ3VkAtlOxgL2-jkQMynlcfXw8YrovBtetSozLXW_M0BS7N2kZOfLSd03Dd0BIoPOJ40VmlnXYmNanjb1wv_DJFaaT95Pp_idVoTFAztHW9F7XEMLpfXjH51j1Fe7MhZcgCy4Ef_gGrHFFc_gL0JD_xtnEjBnK8IZhufUrmJIgeDgsmQ3BcvW4qKJd7ot9BLwof7DP4stxD6_8lh62kosEoHog4HeUStwqa8S5NlOrlW5kSv9seQRr87hMIyX0NUJRkc6REAtgAygV9tceCVCh7P5KNaNWmuK-AoLLsQJLK59kiV-UdjUxXWWloKZh541qf-ua_kc0ne1Y8W6yet4Mw7bbgQGMQcuUUOz17E5EQBJrm4ZVV3iRv9N71h8qZi7aiCzsIWEE350K9T9F2py91ObA-Xi4SXQK4WEd05O1lLi4ag4XNvZ0x34p2nPoaxpoCNvCVp1icxwjlCagZ-qjjKwmNt83SRRAe7uwyDVwB8G2tkh9Paqt4TFTcjOJhEwVrLm1SlLV8oBLVKsmtnT9fW2DKlZNdfMVOwYzkufwc7W25i5yVj2fYdgJlQvSkwZx5a5JN8kuO0NIQwJ6NFla_qW7io0_BwE_zvgMgZ2HNUc4lGY1K0sEmAsm8Yv7b4qxhx0o829wdsBcBSWVhUMdSuksOisr4WiSurexcKkhJVufl7NspCVFHeNeYr2c07dS06bk_xafqIxkuyn0mQt5fYjFbLN-oZiN2txDLzx3KIuYOe1Z9_EsjEbWPp7uNNRfEpynlf0EGJ_ZFW1_zkgyuBNoWwcwZnyQOAN12EbGwnw1RzGfPouzgxKAKAcJEuJHhbyghWOC4Yk2lK56QuiZss4CFlTThhFCTFJ1fF3N6VWoPwUUzY5UWfsIlqIgOCUHNDKCI18pDuYd2rCixKHs7PLOoVdUOU1lv-6iKuGfPrhG9Xo56KX9PDOfVwO1TRa-hICs8oF7vnlFiCDnMO2Kgt_NKLDpvE3apafxx8a4PIFNc1EUjA6kZzCVjILgksTrZOUDqZP2AdpEMPU4Vg2v-IxZSqEY0arQsAtMkdESS437QvDoa-UJhMv0Rid27HUAKgkKA7yVZCsC_n1xiOm-cqGD_jei_iAakDPnBQdX678UG9kJmcuyj__C8tPmRnRVZwt1peaMqo-Z2xISMH3BzxI1S2HrLgiSp4epUo3nAFfN1M0ugQdK8mTKSzBjxCeL13-bQa7vaAqtFjrMQrwTlRJpL1tUQKjC_nrjgYY4sObO8FokbFx9rH_aPH9I0IXrd2lFktTMRtp0ETSmzc7FKyzMLZRxAP6x84Mv3hXmT82e96LbE4maeFJTkaILrV8e03x-CetgcsIzCN9PvQdTQqcUw9Ml-GxL1896zBje5lwEZEtDXVyfpwr-cE8NGiRp59dE2Fs47ogMgZsHJqpYJlimj2lP2ExgHYgogsNOj9yM7YxlbVJpLlo5RtynA6GWzLnV9BSSjrkXBM444SZILrx2-rBSDeAlQH4ViYa16EHunLPXyWBzCxth2ubmoAkqxsPTr-fa6JjoZlWecg0QH6H6PTXVd01QwS68Bbwrcj8n35LLNaWVm5Dpy46lMzPaYFJlW4dpXVRJ2WVkLnTyPdsnWIqQ22K4xeZP1mTxZPf-XYVC6eHD5PBQmx8cUiqYLe0WA9pvtKwkfLjAuGlZbm-N6SMgs1Wcik2dlFL15TDJJv58DHxZcEGk5RNz4daVQNQLMyav5AhcwF8wC20AcjS0pjsEKGXPXKur7CtyfkPHA0MBlDEZre6nenkXo6jp-ZTgqxYJCXZXgZqLX9Qw9tibmt1Sf9x85XaAkq7hXikPZdHyWczjdS4YA-3gSnwpJ5gS-0tetWag6fkzkI4qHFMg9UrNXGVxrxsEUH9Jbwj49VJAJkgSJWVJgOSPtKPPwzAiSMWWttiFTVCVLXB3tbn-kHMUlvlf_zlTyS2HXHFyIZpqTpwyco6LyST7PBvJan_c99eAGmkOW5Yzua_EeVwSOlHs9s-1cDxkxGPVyz3GXRm_T1qKZ68ILQtUc8c8hNbvgbn7ctnkSIMHSzHoBw0rHaMRX1KDB3j-s-3Uys9myyChiqufM4L9V5aaXlnN91mv4vPURzIVS5TReWqjN7z7lm4M8WgcjkDj9Rvx60qD73CDkJLy77uFT6iJXKDneM1YSKse4r20zQ0OkwcDjb7iEowcqHgvx5KEppKdBWccZWVNHJXZl-tfGI5lWbDPwuWuEK64RIXZJe6JykSphNbWzz5oSp4aMqv4MFWggcKdYkVrlGovI3EpLElDHqBswUUxNJ2JWyJfdtWujOWmNrhpKZbq6EvqrqFd94X2Ay5D_Xz3EO4jRJZhbw4uRUAlrFDRoBUtZ0gFeL-N6ab6_sVdR3U6BV1hchCT-v7Zbt5No_4ULgQ4xb4QYqHL3DVwqfm8UPlGhivAc5n8QFjv-e86xERdWI39x7fE6v2oWCzLmQKW5GBX7ohbbQyOU3c96Haa-N2EQOjms5pQfa4-YJ5E_o4n6LSLtprIfY-3O316UfQNTvbsSkYv447LwoyS-9sHBklvC8RbN36s71UOrCLbGk9S6ypfxnIRYPmrhpd1wHT_jB0fCqQJZwgI5mILYqXnH-uqoHKjUqSPgHnhzT-iVqVSBE6Zq8xqUut-LqESULZ81A35SiGwlYrIQy5dHs5wadUIdbNz1ZWWI2ZybVTE39Ukv1DQp9MrhmYJZYrapTpguEN2me-EBjNNnpLRDsO86eSQAhVzV9J000jIvXxGdlUo3SKwZfM-1P0L2CdhicIgI7-KVSGrpJPxQA00Keey2Oj4P6Vdzsrp362WNlkuMIqueVSfRl8P63JzASuXCRlPwDKZ19D15h36uiyvgtBsKhPeAbzGfM7UTLFU-q5vP1gHgpiLqs6Bw61oo7E51yTu6zrmHukuao-AOGhKbctckfrvrVuZ7PpxD_tuQCoYeHUCW8-cjsh8rVsaA0TOo8g_TGpM-c47gXMYjUbfoo-mJV2hBZSW4a3npoZMgCCgPchFzJONFqs7VEcaVS6a6oXDl3woqq0v_LzNLfoGll6ixi9c5okjLeTvf3z6MROAabvxedMD8u8dkLqvL86q7d4FDrvBZDM8E5DbryvvVRPp9rfSa7KLwInjrM9bzpnV4e7TTk7-LDKg54YU8GF_RLC2vIdOvCRGE23BfG2KZVZof3rmhMITLEbGCSL9zd34d2YXhdqbOsTJ2DaZq_Nwii1lx5RBSf_6RSKyPwm0Q7vP30QKAE6FBMHqr2CQwsldDC9R-nI9Y_FNIrbo03lkz7TQe66pBOCUL22IXO1tcdw6PHnowVfOoI_pzrEAwP66gwnTC7Ysb7hREsTH9SIO-EZvPAb_045jovUfYTQmdYZmTgyr-zPzWn-jkprYnHEUX82Hn7LN3cTjRRNvhH9ELSmfrWYhRaW2Q==","type":"reasoning"},{"arguments":"\"{\\\"location\\\":\\\"Florence, Italy\\\"}\"","call_id":"call_ewLJJaD4OO6pdsTnaDtMuNn0","name":"weather","type":"function_call"},{"call_id":"call_ewLJJaD4OO6pdsTnaDtMuNn0","output":"40 C","type":"function_call_output"}],"model":"o4-mini","reasoning":{"effort":"high","summary":"auto"},"tool_choice":"auto","tools":[{"strict":false,"parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location","type":"function"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/responses + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: |- + { + "id": "resp_00f45739b037a2600168f239bbb9188196b53e629e83c81309", + "object": "response", + "created_at": 1760704955, + "status": "completed", + "background": false, + "billing": { + "payer": "developer" + }, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "max_tool_calls": null, + "model": "o4-mini-2025-04-16", + "output": [ + { + "id": "msg_00f45739b037a2600168f239bc36348196b6b0cfe62701d820", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "It\u2019s currently 40\u00b0C in Florence, Italy." + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "prompt_cache_key": null, + "reasoning": { + "effort": "high", + "summary": "detailed" + }, + "safety_identifier": null, + "service_tier": "default", + "store": false, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get weather information for a location", + "name": "weather", + "parameters": { + "properties": { + "location": { + "description": "the city", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "strict": false + } + ], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 1406, + "input_tokens_details": { + "cached_tokens": 1152 + }, + "output_tokens": 15, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 1421 + }, + "user": null, + "metadata": {} + } + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 972.409834ms