From f3799fe2bfcc5be4284d3b6146930f0802f5f65e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 18:27:58 +0000 Subject: [PATCH] chore(internal): use different example values for some enums --- README.md | 10 +++++----- audiospeech_test.go | 4 ++-- audiotranscription_test.go | 2 +- betaassistant_test.go | 4 ++-- betathread_test.go | 2 +- betathreadrun_test.go | 2 +- chatcompletion_test.go | 4 ++-- client_test.go | 20 ++++++++++---------- completion_test.go | 2 +- embedding_test.go | 2 +- finetuningjob_test.go | 2 +- image_test.go | 6 +++--- moderation_test.go | 2 +- realtime/call_test.go | 6 +++--- realtime/clientsecret_test.go | 6 +++--- usage_test.go | 2 +- video_test.go | 2 +- 17 files changed, 39 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index e7fc2b4..e390e15 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ func main() { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err != nil { panic(err.Error()) @@ -339,7 +339,7 @@ To handle errors, we recommend that you use the `errors.As` pattern: ```go _, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{ - Model: openai.FineTuningJobNewParamsModelBabbage002, + Model: openai.FineTuningJobNewParamsModel("gpt-4o"), TrainingFile: "file-abc123", }) if err != nil { @@ -376,7 +376,7 @@ client.Chat.Completions.New( }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }, // This sets the per-retry timeout option.WithRequestTimeout(20*time.Second), @@ -442,7 +442,7 @@ client.Chat.Completions.New( }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }, option.WithMaxRetries(5), ) @@ -466,7 +466,7 @@ chatCompletion, err := client.Chat.Completions.New( }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }, option.WithResponseInto(&response), ) diff --git a/audiospeech_test.go b/audiospeech_test.go index 27b031a..c8dced3 100644 --- a/audiospeech_test.go +++ b/audiospeech_test.go @@ -28,8 +28,8 @@ func TestAudioSpeechNewWithOptionalParams(t *testing.T) { ) resp, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{ Input: "input", - Model: openai.SpeechModelTTS1, - Voice: openai.AudioSpeechNewParamsVoiceAlloy, + Model: openai.SpeechModel("string"), + Voice: openai.AudioSpeechNewParamsVoiceAsh, Instructions: openai.String("instructions"), ResponseFormat: openai.AudioSpeechNewParamsResponseFormatMP3, Speed: openai.Float(0.25), diff --git a/audiotranscription_test.go b/audiotranscription_test.go index 6441b40..83fb495 100644 --- a/audiotranscription_test.go +++ b/audiotranscription_test.go @@ -30,7 +30,7 @@ func TestAudioTranscriptionNewWithOptionalParams(t *testing.T) { ) _, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{ File: io.Reader(bytes.NewBuffer([]byte("some file contents"))), - Model: openai.AudioModelWhisper1, + Model: openai.AudioModelGPT4oTranscribe, ChunkingStrategy: openai.AudioTranscriptionNewParamsChunkingStrategyUnion{ OfAuto: constant.ValueOf[constant.Auto](), }, diff --git a/betaassistant_test.go b/betaassistant_test.go index aeea9cd..ee5bb34 100644 --- a/betaassistant_test.go +++ b/betaassistant_test.go @@ -28,7 +28,7 @@ func TestBetaAssistantNewWithOptionalParams(t *testing.T) { option.WithAPIKey("My API Key"), ) _, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{ - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, Description: openai.String("description"), Instructions: openai.String("instructions"), Metadata: shared.Metadata{ @@ -114,7 +114,7 @@ func TestBetaAssistantUpdateWithOptionalParams(t *testing.T) { Metadata: shared.Metadata{ "foo": "string", }, - Model: openai.BetaAssistantUpdateParamsModelGPT5, + Model: openai.BetaAssistantUpdateParamsModel("string"), Name: openai.String("name"), ReasoningEffort: shared.ReasoningEffortNone, ResponseFormat: openai.AssistantResponseFormatOptionUnionParam{ diff --git a/betathread_test.go b/betathread_test.go index 0b49ee2..f379d62 100644 --- a/betathread_test.go +++ b/betathread_test.go @@ -175,7 +175,7 @@ func TestBetaThreadNewAndRunWithOptionalParams(t *testing.T) { Metadata: shared.Metadata{ "foo": "string", }, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModel("string"), ParallelToolCalls: openai.Bool(true), ResponseFormat: openai.AssistantResponseFormatOptionUnionParam{ OfAuto: constant.ValueOf[constant.Auto](), diff --git a/betathreadrun_test.go b/betathreadrun_test.go index 8a61cc6..2830518 100644 --- a/betathreadrun_test.go +++ b/betathreadrun_test.go @@ -55,7 +55,7 @@ func TestBetaThreadRunNewWithOptionalParams(t *testing.T) { Metadata: shared.Metadata{ "foo": "string", }, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModel("string"), ParallelToolCalls: openai.Bool(true), ReasoningEffort: shared.ReasoningEffortNone, ResponseFormat: openai.AssistantResponseFormatOptionUnionParam{ diff --git a/chatcompletion_test.go b/chatcompletion_test.go index a44f459..a129a5a 100644 --- a/chatcompletion_test.go +++ b/chatcompletion_test.go @@ -35,10 +35,10 @@ func TestChatCompletionNewWithOptionalParams(t *testing.T) { Name: openai.String("name"), }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, Audio: openai.ChatCompletionAudioParam{ Format: openai.ChatCompletionAudioParamFormatWAV, - Voice: openai.ChatCompletionAudioParamVoiceAlloy, + Voice: openai.ChatCompletionAudioParamVoiceAsh, }, FrequencyPenalty: openai.Float(-2), FunctionCall: openai.ChatCompletionNewParamsFunctionCallUnion{ diff --git a/client_test.go b/client_test.go index ad9d1a3..9377be8 100644 --- a/client_test.go +++ b/client_test.go @@ -48,7 +48,7 @@ func TestUserAgentHeader(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if userAgent != fmt.Sprintf("OpenAI/Go %s", internal.PackageVersion) { t.Errorf("Expected User-Agent to be correct, but got: %#v", userAgent) @@ -81,7 +81,7 @@ func TestRetryAfter(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err == nil { t.Error("Expected there to be a cancel error") @@ -125,7 +125,7 @@ func TestDeleteRetryCountHeader(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err == nil { t.Error("Expected there to be a cancel error") @@ -164,7 +164,7 @@ func TestOverwriteRetryCountHeader(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err == nil { t.Error("Expected there to be a cancel error") @@ -202,7 +202,7 @@ func TestRetryAfterMs(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err == nil { t.Error("Expected there to be a cancel error") @@ -234,7 +234,7 @@ func TestContextCancel(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err == nil { t.Error("Expected there to be a cancel error") @@ -263,7 +263,7 @@ func TestContextCancelDelay(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err == nil { t.Error("expected there to be a cancel error") @@ -298,7 +298,7 @@ func TestContextDeadline(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err == nil { t.Error("expected there to be a deadline error") @@ -352,7 +352,7 @@ func TestContextDeadlineStreaming(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) for stream.Next() { _ = stream.Current() @@ -408,7 +408,7 @@ func TestContextDeadlineStreamingWithRequestTimeout(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }, option.WithRequestTimeout((100 * time.Millisecond)), ) diff --git a/completion_test.go b/completion_test.go index a928b68..4826bbe 100644 --- a/completion_test.go +++ b/completion_test.go @@ -26,7 +26,7 @@ func TestCompletionNewWithOptionalParams(t *testing.T) { option.WithAPIKey("My API Key"), ) _, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{ - Model: openai.CompletionNewParamsModelGPT3_5TurboInstruct, + Model: openai.CompletionNewParamsModel("string"), Prompt: openai.CompletionNewParamsPromptUnion{ OfString: openai.String("This is a test."), }, diff --git a/embedding_test.go b/embedding_test.go index afe13d9..eb54318 100644 --- a/embedding_test.go +++ b/embedding_test.go @@ -29,7 +29,7 @@ func TestEmbeddingNewWithOptionalParams(t *testing.T) { Input: openai.EmbeddingNewParamsInputUnion{ OfString: openai.String("The quick brown fox jumped over the lazy dog"), }, - Model: openai.EmbeddingModelTextEmbeddingAda002, + Model: openai.EmbeddingModelTextEmbedding3Small, Dimensions: openai.Int(1), EncodingFormat: openai.EmbeddingNewParamsEncodingFormatFloat, User: openai.String("user-1234"), diff --git a/finetuningjob_test.go b/finetuningjob_test.go index ea32dc7..0265eca 100644 --- a/finetuningjob_test.go +++ b/finetuningjob_test.go @@ -28,7 +28,7 @@ func TestFineTuningJobNewWithOptionalParams(t *testing.T) { option.WithAPIKey("My API Key"), ) _, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{ - Model: openai.FineTuningJobNewParamsModelBabbage002, + Model: openai.FineTuningJobNewParamsModelGPT4oMini, TrainingFile: "file-abc123", Hyperparameters: openai.FineTuningJobNewParamsHyperparameters{ BatchSize: openai.FineTuningJobNewParamsHyperparametersBatchSizeUnion{ diff --git a/image_test.go b/image_test.go index e95512b..6ebf45c 100644 --- a/image_test.go +++ b/image_test.go @@ -29,7 +29,7 @@ func TestImageNewVariationWithOptionalParams(t *testing.T) { ) _, err := client.Images.NewVariation(context.TODO(), openai.ImageNewVariationParams{ Image: io.Reader(bytes.NewBuffer([]byte("some file contents"))), - Model: openai.ImageModelGPTImage1_5, + Model: openai.ImageModel("string"), N: openai.Int(1), ResponseFormat: openai.ImageNewVariationParamsResponseFormatURL, Size: openai.ImageNewVariationParamsSize1024x1024, @@ -64,7 +64,7 @@ func TestImageEditWithOptionalParams(t *testing.T) { Background: openai.ImageEditParamsBackgroundTransparent, InputFidelity: openai.ImageEditParamsInputFidelityHigh, Mask: io.Reader(bytes.NewBuffer([]byte("some file contents"))), - Model: openai.ImageModelGPTImage1_5, + Model: openai.ImageModel("string"), N: openai.Int(1), OutputCompression: openai.Int(100), OutputFormat: openai.ImageEditParamsOutputFormatPNG, @@ -98,7 +98,7 @@ func TestImageGenerateWithOptionalParams(t *testing.T) { _, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{ Prompt: "A cute baby sea otter", Background: openai.ImageGenerateParamsBackgroundTransparent, - Model: openai.ImageModelGPTImage1_5, + Model: openai.ImageModel("string"), Moderation: openai.ImageGenerateParamsModerationLow, N: openai.Int(1), OutputCompression: openai.Int(100), diff --git a/moderation_test.go b/moderation_test.go index 8554ef4..c8fec43 100644 --- a/moderation_test.go +++ b/moderation_test.go @@ -29,7 +29,7 @@ func TestModerationNewWithOptionalParams(t *testing.T) { Input: openai.ModerationNewParamsInputUnion{ OfString: openai.String("I want to kill them."), }, - Model: openai.ModerationModelOmniModerationLatest, + Model: openai.ModerationModel("string"), }) if err != nil { var apierr *openai.Error diff --git a/realtime/call_test.go b/realtime/call_test.go index d02e1d7..f9bbcdc 100644 --- a/realtime/call_test.go +++ b/realtime/call_test.go @@ -46,7 +46,7 @@ func TestCallAcceptWithOptionalParams(t *testing.T) { }, Transcription: realtime.AudioTranscriptionParam{ Language: openai.String("language"), - Model: realtime.AudioTranscriptionModelWhisper1, + Model: realtime.AudioTranscriptionModel("string"), Prompt: openai.String("prompt"), }, TurnDetection: realtime.RealtimeAudioInputTurnDetectionUnionParam{ @@ -68,7 +68,7 @@ func TestCallAcceptWithOptionalParams(t *testing.T) { }, }, Speed: openai.Float(0.25), - Voice: realtime.RealtimeAudioConfigOutputVoiceAlloy, + Voice: realtime.RealtimeAudioConfigOutputVoiceAsh, }, }, Include: []string{"item.input_audio_transcription.logprobs"}, @@ -76,7 +76,7 @@ func TestCallAcceptWithOptionalParams(t *testing.T) { MaxOutputTokens: realtime.RealtimeSessionCreateRequestMaxOutputTokensUnionParam{ OfInt: openai.Int(0), }, - Model: realtime.RealtimeSessionCreateRequestModelGPTRealtime, + Model: realtime.RealtimeSessionCreateRequestModel("string"), OutputModalities: []string{"text"}, Prompt: responses.ResponsePromptParam{ ID: "id", diff --git a/realtime/clientsecret_test.go b/realtime/clientsecret_test.go index feeca1c..db64688 100644 --- a/realtime/clientsecret_test.go +++ b/realtime/clientsecret_test.go @@ -48,7 +48,7 @@ func TestClientSecretNewWithOptionalParams(t *testing.T) { }, Transcription: realtime.AudioTranscriptionParam{ Language: openai.String("language"), - Model: realtime.AudioTranscriptionModelWhisper1, + Model: realtime.AudioTranscriptionModel("string"), Prompt: openai.String("prompt"), }, TurnDetection: realtime.RealtimeAudioInputTurnDetectionUnionParam{ @@ -70,7 +70,7 @@ func TestClientSecretNewWithOptionalParams(t *testing.T) { }, }, Speed: openai.Float(0.25), - Voice: realtime.RealtimeAudioConfigOutputVoiceAlloy, + Voice: realtime.RealtimeAudioConfigOutputVoiceAsh, }, }, Include: []string{"item.input_audio_transcription.logprobs"}, @@ -78,7 +78,7 @@ func TestClientSecretNewWithOptionalParams(t *testing.T) { MaxOutputTokens: realtime.RealtimeSessionCreateRequestMaxOutputTokensUnionParam{ OfInt: openai.Int(0), }, - Model: realtime.RealtimeSessionCreateRequestModelGPTRealtime, + Model: realtime.RealtimeSessionCreateRequestModel("string"), OutputModalities: []string{"text"}, Prompt: responses.ResponsePromptParam{ ID: "id", diff --git a/usage_test.go b/usage_test.go index 528ad3f..8457419 100644 --- a/usage_test.go +++ b/usage_test.go @@ -33,7 +33,7 @@ func TestUsage(t *testing.T) { }, }, }}, - Model: shared.ChatModelGPT5_2, + Model: shared.ChatModelGPT4o, }) if err != nil { t.Fatalf("err should be nil: %s", err.Error()) diff --git a/video_test.go b/video_test.go index 3d87c30..a91b5a8 100644 --- a/video_test.go +++ b/video_test.go @@ -32,7 +32,7 @@ func TestVideoNewWithOptionalParams(t *testing.T) { _, err := client.Videos.New(context.TODO(), openai.VideoNewParams{ Prompt: "x", InputReference: io.Reader(bytes.NewBuffer([]byte("some file contents"))), - Model: openai.VideoModelSora2, + Model: openai.VideoModel("string"), Seconds: openai.VideoSeconds4, Size: openai.VideoSize720x1280, })