chore(internal): use different example values for some enums

This commit is contained in:
stainless-app[bot]
2026-01-06 18:27:58 +00:00
parent 0b289eb524
commit f3799fe2bf
17 changed files with 39 additions and 39 deletions

View File

@@ -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),
)

View File

@@ -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),

View File

@@ -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](),
},

View File

@@ -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{

View File

@@ -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](),

View File

@@ -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{

View File

@@ -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{

View File

@@ -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)),
)

View File

@@ -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."),
},

View File

@@ -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"),

View File

@@ -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{

View File

@@ -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),

View File

@@ -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

View File

@@ -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",

View File

@@ -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",

View File

@@ -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())

View File

@@ -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,
})