diff --git a/.stats.yml b/.stats.yml index 4e4cb55..6cc7757 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 68 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-77cfff37114bc9f141c7e6107eb5f1b38d8cc99bc3d4ce03a066db2b6b649c69.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-b04761ffd2adad3cc19a6dc6fc696ac445878219972f891881a967340fa9a6b0.yml diff --git a/audio.go b/audio.go index 3828a8b..1d40eff 100644 --- a/audio.go +++ b/audio.go @@ -31,16 +31,8 @@ func NewAudioService(opts ...option.RequestOption) (r *AudioService) { return } -type AudioModel string +type AudioModel = string const ( AudioModelWhisper1 AudioModel = "whisper-1" ) - -func (r AudioModel) IsKnown() bool { - switch r { - case AudioModelWhisper1: - return true - } - return false -} diff --git a/audiospeech.go b/audiospeech.go index 2f97f16..780d957 100644 --- a/audiospeech.go +++ b/audiospeech.go @@ -40,21 +40,13 @@ func (r *AudioSpeechService) New(ctx context.Context, body AudioSpeechNewParams, return } -type SpeechModel string +type SpeechModel = string const ( SpeechModelTTS1 SpeechModel = "tts-1" SpeechModelTTS1HD SpeechModel = "tts-1-hd" ) -func (r SpeechModel) IsKnown() bool { - switch r { - case SpeechModelTTS1, SpeechModelTTS1HD: - return true - } - return false -} - type AudioSpeechNewParams struct { // The text to generate audio for. The maximum length is 4096 characters. Input param.Field[string] `json:"input,required"` diff --git a/chat.go b/chat.go index 999df42..404be7a 100644 --- a/chat.go +++ b/chat.go @@ -27,7 +27,7 @@ func NewChatService(opts ...option.RequestOption) (r *ChatService) { return } -type ChatModel string +type ChatModel = string const ( ChatModelGPT4o ChatModel = "gpt-4o" @@ -54,11 +54,3 @@ const ( ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125" ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613" ) - -func (r ChatModel) IsKnown() bool { - switch r { - case ChatModelGPT4o, ChatModelGPT4o2024_05_13, ChatModelGPT4oMini, ChatModelGPT4oMini2024_07_18, ChatModelGPT4Turbo, ChatModelGPT4Turbo2024_04_09, ChatModelGPT4_0125Preview, ChatModelGPT4TurboPreview, ChatModelGPT4_1106Preview, ChatModelGPT4VisionPreview, ChatModelGPT4, ChatModelGPT4_0314, ChatModelGPT4_0613, ChatModelGPT4_32k, ChatModelGPT4_32k0314, ChatModelGPT4_32k0613, ChatModelGPT3_5Turbo, ChatModelGPT3_5Turbo16k, ChatModelGPT3_5Turbo0301, ChatModelGPT3_5Turbo0613, ChatModelGPT3_5Turbo1106, ChatModelGPT3_5Turbo0125, ChatModelGPT3_5Turbo16k0613: - return true - } - return false -} diff --git a/image.go b/image.go index 73b0c3f..7a17c05 100644 --- a/image.go +++ b/image.go @@ -89,21 +89,13 @@ func (r imageJSON) RawJSON() string { return r.raw } -type ImageModel string +type ImageModel = string const ( ImageModelDallE2 ImageModel = "dall-e-2" ImageModelDallE3 ImageModel = "dall-e-3" ) -func (r ImageModel) IsKnown() bool { - switch r { - case ImageModelDallE2, ImageModelDallE3: - return true - } - return false -} - type ImagesResponse struct { Created int64 `json:"created,required"` Data []Image `json:"data,required"` diff --git a/moderation.go b/moderation.go index d42ad21..7cf711d 100644 --- a/moderation.go +++ b/moderation.go @@ -185,21 +185,13 @@ func (r moderationCategoryScoresJSON) RawJSON() string { return r.raw } -type ModerationModel string +type ModerationModel = string const ( ModerationModelTextModerationLatest ModerationModel = "text-moderation-latest" ModerationModelTextModerationStable ModerationModel = "text-moderation-stable" ) -func (r ModerationModel) IsKnown() bool { - switch r { - case ModerationModelTextModerationLatest, ModerationModelTextModerationStable: - return true - } - return false -} - // Represents if a given text input is potentially harmful. type ModerationNewResponse struct { // The unique identifier for the moderation request.