Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 80
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
openapi_spec_hash: 0c255269b89767eae26f4d4dc22d3cbd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
config_hash: d36e491b0afc4f79e3afad4b3c9bec70
50 changes: 39 additions & 11 deletions lib/openai/models/audio/speech_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class SpeechCreateParams < OpenAI::BaseModel

# @!attribute voice
# The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
# voices are available in the
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
# `verse`. Previews of the voices are available in the
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
#
# @return [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice]
required :voice, enum: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice }
# @return [String, Symbol]
required :voice, union: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice }

# @!attribute [r] instructions
# Control the voice of your generated audio with additional instructions. Does not
Expand Down Expand Up @@ -66,7 +66,7 @@ class SpeechCreateParams < OpenAI::BaseModel
# @!parse
# # @param input [String]
# # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel]
# # @param voice [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice]
# # @param voice [String, Symbol]
# # @param instructions [String]
# # @param response_format [Symbol, OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat]
# # @param speed [Float]
Expand All @@ -92,27 +92,55 @@ module Model
end

# The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
# voices are available in the
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
# `verse`. Previews of the voices are available in the
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
module Voice
extend OpenAI::Enum
extend OpenAI::Union

# @!group

ALLOY = :alloy
ASH = :ash
BALLAD = :ballad
CORAL = :coral
ECHO = :echo
FABLE = :fable
ONYX = :onyx
NOVA = :nova
SAGE = :sage
SHIMMER = :shimmer
VERSE = :verse

finalize!
# @!endgroup

variant String

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ALLOY

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ASH

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::BALLAD

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::CORAL

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ECHO

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::FABLE

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ONYX

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::NOVA

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::SAGE

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::SHIMMER

variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::VERSE

# @!parse
# # @return [Array<Symbol>]
# def self.values; end
# # @return [Array(String, Symbol)]
# def self.variants; end
end

# The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
Expand Down
43 changes: 36 additions & 7 deletions lib/openai/models/chat/chat_completion_audio_param.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ class ChatCompletionAudioParam < OpenAI::BaseModel
# The voice the model uses to respond. Supported voices are `alloy`, `ash`,
# `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
#
# @return [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
required :voice, enum: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice }
# @return [String, Symbol]
required :voice, union: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice }

# @!parse
# # Parameters for audio output. Required when audio output is requested with
# # `modalities: ["audio"]`.
# # [Learn more](https://platform.openai.com/docs/guides/audio).
# #
# # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format]
# # @param voice [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
# # @param voice [String, Symbol]
# #
# def initialize(format_:, voice:, **) = super

Expand All @@ -51,22 +51,51 @@ module Format
# The voice the model uses to respond. Supported voices are `alloy`, `ash`,
# `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
module Voice
extend OpenAI::Enum
extend OpenAI::Union

# @!group

ALLOY = :alloy
ASH = :ash
BALLAD = :ballad
CORAL = :coral
ECHO = :echo
FABLE = :fable
ONYX = :onyx
NOVA = :nova
SAGE = :sage
SHIMMER = :shimmer
VERSE = :verse

finalize!
# @!endgroup

variant String

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ALLOY

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ASH

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::BALLAD

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::CORAL

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ECHO

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::FABLE

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ONYX

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::NOVA

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::SAGE

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::SHIMMER

variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::VERSE

# @!parse
# # @return [Array<Symbol>]
# def self.values; end
# # @return [Array(String, Symbol)]
# def self.variants; end
end
end
end
Expand Down
14 changes: 13 additions & 1 deletion lib/openai/models/responses/input_item_list_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ class InputItemListParams < OpenAI::BaseModel
# # @return [String]
# attr_writer :before

# @!attribute [r] include
# Additional fields to include in the response. See the `include` parameter for
# Response creation above for more information.
#
# @return [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>, nil]
optional :include, -> { OpenAI::ArrayOf[enum: OpenAI::Models::Responses::ResponseIncludable] }

# @!parse
# # @return [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>]
# attr_writer :include

# @!attribute [r] limit
# A limit on the number of objects to be returned. Limit can range between 1 and
# 100, and the default is 20.
Expand Down Expand Up @@ -55,11 +66,12 @@ class InputItemListParams < OpenAI::BaseModel
# @!parse
# # @param after [String]
# # @param before [String]
# # @param include [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>]
# # @param limit [Integer]
# # @param order [Symbol, OpenAI::Models::Responses::InputItemListParams::Order]
# # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
# #
# def initialize(after: nil, before: nil, limit: nil, order: nil, request_options: {}, **) = super
# def initialize(after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}, **) = super

# def initialize: (Hash | OpenAI::BaseModel) -> void

Expand Down
4 changes: 2 additions & 2 deletions lib/openai/models/responses/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Response < OpenAI::BaseModel
# context.
#
# When using along with `previous_response_id`, the instructions from a previous
# response will be not be carried over to the next response. This makes it simple
# to swap out system (or developer) messages in new responses.
# response will not be carried over to the next response. This makes it simple to
# swap out system (or developer) messages in new responses.
#
# @return [String, nil]
required :instructions, String, nil?: true
Expand Down
4 changes: 2 additions & 2 deletions lib/openai/models/responses/response_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class ResponseCreateParams < OpenAI::BaseModel
# context.
#
# When using along with `previous_response_id`, the instructions from a previous
# response will be not be carried over to the next response. This makes it simple
# to swap out system (or developer) messages in new responses.
# response will not be carried over to the next response. This makes it simple to
# swap out system (or developer) messages in new responses.
#
# @return [String, nil]
optional :instructions, String, nil?: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ module OpenAI
module Models
module Responses
class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel
# @!attribute name
# The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
# and dashes, with a maximum length of 64.
#
# @return [String]
required :name, String

# @!attribute schema
# The schema for the response format, described as a JSON Schema object. Learn how
# to build JSON schemas [here](https://json-schema.org/).
Expand All @@ -28,17 +35,6 @@ class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel
# # @return [String]
# attr_writer :description

# @!attribute [r] name
# The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
# and dashes, with a maximum length of 64.
#
# @return [String, nil]
optional :name, String

# @!parse
# # @return [String]
# attr_writer :name

# @!attribute strict
# Whether to enable strict schema adherence when generating the output. If set to
# true, the model will always follow the exact schema defined in the `schema`
Expand All @@ -54,13 +50,13 @@ class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel
# # more about
# # [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
# #
# # @param name [String]
# # @param schema [Hash{Symbol=>Object}]
# # @param description [String]
# # @param name [String]
# # @param strict [Boolean, nil]
# # @param type [Symbol, :json_schema]
# #
# def initialize(schema:, description: nil, name: nil, strict: nil, type: :json_schema, **) = super
# def initialize(name:, schema:, description: nil, strict: nil, type: :json_schema, **) = super

# def initialize: (Hash | OpenAI::BaseModel) -> void
end
Expand Down
6 changes: 3 additions & 3 deletions lib/openai/resources/audio/speech.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class Speech
# @option params [String, Symbol, OpenAI::Models::Audio::SpeechModel] :model One of the available [TTS models](https://platform.openai.com/docs/models#tts):
# `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
#
# @option params [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] :voice The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
# voices are available in the
# @option params [String, Symbol] :voice The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
# `verse`. Previews of the voices are available in the
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
#
# @option params [String] :instructions Control the voice of your generated audio with additional instructions. Does not
Expand Down
8 changes: 4 additions & 4 deletions lib/openai/resources/responses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class Responses
# context.
#
# When using along with `previous_response_id`, the instructions from a previous
# response will be not be carried over to the next response. This makes it simple
# to swap out system (or developer) messages in new responses.
# response will not be carried over to the next response. This makes it simple to
# swap out system (or developer) messages in new responses.
#
# @option params [Integer, nil] :max_output_tokens An upper bound for the number of tokens that can be generated for a response,
# including visible output tokens and
Expand Down Expand Up @@ -185,8 +185,8 @@ def create(params)
# context.
#
# When using along with `previous_response_id`, the instructions from a previous
# response will be not be carried over to the next response. This makes it simple
# to swap out system (or developer) messages in new responses.
# response will not be carried over to the next response. This makes it simple to
# swap out system (or developer) messages in new responses.
#
# @option params [Integer, nil] :max_output_tokens An upper bound for the number of tokens that can be generated for a response,
# including visible output tokens and
Expand Down
3 changes: 3 additions & 0 deletions lib/openai/resources/responses/input_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class InputItems
#
# @option params [String] :before An item ID to list items before, used in pagination.
#
# @option params [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>] :include Additional fields to include in the response. See the `include` parameter for
# Response creation above for more information.
#
# @option params [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and
# 100, and the default is 20.
#
Expand Down
22 changes: 12 additions & 10 deletions rbi/lib/openai/models/audio/speech_create_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ module OpenAI
attr_accessor :model

# The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
# voices are available in the
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
# `verse`. Previews of the voices are available in the
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
sig { returns(OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol) }
sig { returns(T.any(String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol)) }
attr_accessor :voice

# Control the voice of your generated audio with additional instructions. Does not
Expand Down Expand Up @@ -51,7 +51,7 @@ module OpenAI
params(
input: String,
model: T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol),
voice: OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol,
voice: T.any(String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol),
instructions: String,
response_format: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol,
speed: Float,
Expand All @@ -68,7 +68,7 @@ module OpenAI
{
input: String,
model: T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol),
voice: OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol,
voice: T.any(String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol),
instructions: String,
response_format: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol,
speed: Float,
Expand All @@ -90,27 +90,29 @@ module OpenAI
end

# The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
# voices are available in the
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
# `verse`. Previews of the voices are available in the
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
module Voice
extend OpenAI::Enum
extend OpenAI::Union

TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice) }
OrSymbol = T.type_alias { T.any(Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) }

ALLOY = T.let(:alloy, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
ASH = T.let(:ash, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
BALLAD = T.let(:ballad, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
CORAL = T.let(:coral, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
ECHO = T.let(:echo, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
FABLE = T.let(:fable, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
ONYX = T.let(:onyx, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
NOVA = T.let(:nova, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
SAGE = T.let(:sage, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
SHIMMER = T.let(:shimmer, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)
VERSE = T.let(:verse, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol)

sig { override.returns(T::Array[OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol]) }
def self.values
sig { override.returns([String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol]) }
def self.variants
end
end

Expand Down
Loading