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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.22.1"
".": "0.23.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-51afd6abbcb18c3086f62993f9379c18443b9e516cbc0548ddfb932e835657f8.yml
openapi_spec_hash: dae6afeaefa15cb8700c7a870531e06f
config_hash: b854932c0ea24b400bdd64e4376936bd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-7807ec6037efcee1af7decbfd3974a42b761fb6c6a71b4050fe43484d7fcbac4.yml
openapi_spec_hash: da6851e3891ad2659a50ed6a736fd32a
config_hash: 74d955cdc2377213f5268ea309090f6c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.23.0 (2025-09-08)

Full Changelog: [v0.22.1...v0.23.0](https://github.com/openai/openai-ruby/compare/v0.22.1...v0.23.0)

### Features

* **api:** ship the RealtimeGA API shape ([6c59e2c](https://github.com/openai/openai-ruby/commit/6c59e2c78ea130b626442e2230676afcca3a906f))

## 0.22.1 (2025-09-05)

Full Changelog: [v0.22.0...v0.22.1](https://github.com/openai/openai-ruby/compare/v0.22.0...v0.22.1)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
openai (0.22.1)
openai (0.23.0)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "openai", "~> 0.22.1"
gem "openai", "~> 0.23.0"
```

<!-- x-release-please-end -->
Expand Down
20 changes: 19 additions & 1 deletion lib/openai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
require_relative "openai/models/moderation_multi_modal_input"
require_relative "openai/models/moderation_text_input"
require_relative "openai/models/other_file_chunking_strategy_object"
require_relative "openai/models/realtime/audio_transcription"
require_relative "openai/models/realtime/client_secret_create_params"
require_relative "openai/models/realtime/client_secret_create_response"
require_relative "openai/models/realtime/conversation_created_event"
Expand Down Expand Up @@ -410,11 +411,16 @@
require_relative "openai/models/realtime/mcp_list_tools_completed"
require_relative "openai/models/realtime/mcp_list_tools_failed"
require_relative "openai/models/realtime/mcp_list_tools_in_progress"
require_relative "openai/models/realtime/models"
require_relative "openai/models/realtime/noise_reduction_type"
require_relative "openai/models/realtime/output_audio_buffer_clear_event"
require_relative "openai/models/realtime/rate_limits_updated_event"
require_relative "openai/models/realtime/realtime_audio_config"
require_relative "openai/models/realtime/realtime_audio_config_input"
require_relative "openai/models/realtime/realtime_audio_config_output"
require_relative "openai/models/realtime/realtime_audio_formats"
require_relative "openai/models/realtime/realtime_audio_input_turn_detection"
require_relative "openai/models/realtime/realtime_client_event"
require_relative "openai/models/realtime/realtime_client_secret_config"
require_relative "openai/models/realtime/realtime_conversation_item_assistant_message"
require_relative "openai/models/realtime/realtime_conversation_item_function_call"
require_relative "openai/models/realtime/realtime_conversation_item_function_call_output"
Expand All @@ -430,20 +436,32 @@
require_relative "openai/models/realtime/realtime_mcp_tool_call"
require_relative "openai/models/realtime/realtime_mcp_tool_execution_error"
require_relative "openai/models/realtime/realtime_response"
require_relative "openai/models/realtime/realtime_response_create_audio_output"
require_relative "openai/models/realtime/realtime_response_create_mcp_tool"
require_relative "openai/models/realtime/realtime_response_create_params"
require_relative "openai/models/realtime/realtime_response_status"
require_relative "openai/models/realtime/realtime_response_usage"
require_relative "openai/models/realtime/realtime_response_usage_input_token_details"
require_relative "openai/models/realtime/realtime_response_usage_output_token_details"
require_relative "openai/models/realtime/realtime_server_event"
require_relative "openai/models/realtime/realtime_session"
require_relative "openai/models/realtime/realtime_session_client_secret"
require_relative "openai/models/realtime/realtime_session_create_request"
require_relative "openai/models/realtime/realtime_session_create_response"
require_relative "openai/models/realtime/realtime_tool_choice_config"
require_relative "openai/models/realtime/realtime_tools_config"
require_relative "openai/models/realtime/realtime_tools_config_union"
require_relative "openai/models/realtime/realtime_tracing_config"
require_relative "openai/models/realtime/realtime_transcription_session_audio"
require_relative "openai/models/realtime/realtime_transcription_session_audio_input"
require_relative "openai/models/realtime/realtime_transcription_session_audio_input_turn_detection"
require_relative "openai/models/realtime/realtime_transcription_session_client_secret"
require_relative "openai/models/realtime/realtime_transcription_session_create_request"
require_relative "openai/models/realtime/realtime_transcription_session_create_response"
require_relative "openai/models/realtime/realtime_transcription_session_input_audio_transcription"
require_relative "openai/models/realtime/realtime_transcription_session_turn_detection"
require_relative "openai/models/realtime/realtime_truncation"
require_relative "openai/models/realtime/realtime_truncation_retention_ratio"
require_relative "openai/models/realtime/response_audio_delta_event"
require_relative "openai/models/realtime/response_audio_done_event"
require_relative "openai/models/realtime/response_audio_transcript_delta_event"
Expand Down
60 changes: 60 additions & 0 deletions lib/openai/models/realtime/audio_transcription.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# frozen_string_literal: true

module OpenAI
module Models
module Realtime
class AudioTranscription < OpenAI::Internal::Type::BaseModel
# @!attribute language
# The language of the input audio. Supplying the input language in
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
# format will improve accuracy and latency.
#
# @return [String, nil]
optional :language, String

# @!attribute model
# The model to use for transcription. Current options are `whisper-1`,
# `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, and `gpt-4o-transcribe`.
#
# @return [Symbol, OpenAI::Models::Realtime::AudioTranscription::Model, nil]
optional :model, enum: -> { OpenAI::Realtime::AudioTranscription::Model }

# @!attribute prompt
# An optional text to guide the model's style or continue a previous audio
# segment. For `whisper-1`, the
# [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
# For `gpt-4o-transcribe` models, the prompt is a free text string, for example
# "expect words related to technology".
#
# @return [String, nil]
optional :prompt, String

# @!method initialize(language: nil, model: nil, prompt: nil)
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Realtime::AudioTranscription} for more details.
#
# @param language [String] The language of the input audio. Supplying the input language in
#
# @param model [Symbol, OpenAI::Models::Realtime::AudioTranscription::Model] The model to use for transcription. Current options are `whisper-1`, `gpt-4o-tra
#
# @param prompt [String] An optional text to guide the model's style or continue a previous audio

# The model to use for transcription. Current options are `whisper-1`,
# `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, and `gpt-4o-transcribe`.
#
# @see OpenAI::Models::Realtime::AudioTranscription#model
module Model
extend OpenAI::Internal::Type::Enum

WHISPER_1 = :"whisper-1"
GPT_4O_TRANSCRIBE_LATEST = :"gpt-4o-transcribe-latest"
GPT_4O_MINI_TRANSCRIBE = :"gpt-4o-mini-transcribe"
GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"

# @!method self.values
# @return [Array<Symbol>]
end
end
end
end
end
27 changes: 18 additions & 9 deletions lib/openai/models/realtime/client_secret_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ class ClientSecretCreateParams < OpenAI::Internal::Type::BaseModel
include OpenAI::Internal::Type::RequestParameters

# @!attribute expires_after
# Configuration for the ephemeral token expiration.
# Configuration for the client secret expiration. Expiration refers to the time
# after which a client secret will no longer be valid for creating sessions. The
# session itself may continue after that time once started. A secret can be used
# to create multiple sessions until it expires.
#
# @return [OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter, nil]
optional :expires_after, -> { OpenAI::Realtime::ClientSecretCreateParams::ExpiresAfter }
Expand All @@ -25,23 +28,25 @@ class ClientSecretCreateParams < OpenAI::Internal::Type::BaseModel
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Realtime::ClientSecretCreateParams} for more details.
#
# @param expires_after [OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter] Configuration for the ephemeral token expiration.
# @param expires_after [OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter] Configuration for the client secret expiration. Expiration refers to the time af
#
# @param session [OpenAI::Models::Realtime::RealtimeSessionCreateRequest, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest] Session configuration to use for the client secret. Choose either a realtime
#
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]

class ExpiresAfter < OpenAI::Internal::Type::BaseModel
# @!attribute anchor
# The anchor point for the ephemeral token expiration. Only `created_at` is
# currently supported.
# The anchor point for the client secret expiration, meaning that `seconds` will
# be added to the `created_at` time of the client secret to produce an expiration
# timestamp. Only `created_at` is currently supported.
#
# @return [Symbol, OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter::Anchor, nil]
optional :anchor, enum: -> { OpenAI::Realtime::ClientSecretCreateParams::ExpiresAfter::Anchor }

# @!attribute seconds
# The number of seconds from the anchor point to the expiration. Select a value
# between `10` and `7200`.
# between `10` and `7200` (2 hours). This default to 600 seconds (10 minutes) if
# not specified.
#
# @return [Integer, nil]
optional :seconds, Integer
Expand All @@ -51,14 +56,18 @@ class ExpiresAfter < OpenAI::Internal::Type::BaseModel
# {OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter} for more
# details.
#
# Configuration for the ephemeral token expiration.
# Configuration for the client secret expiration. Expiration refers to the time
# after which a client secret will no longer be valid for creating sessions. The
# session itself may continue after that time once started. A secret can be used
# to create multiple sessions until it expires.
#
# @param anchor [Symbol, OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter::Anchor] The anchor point for the ephemeral token expiration. Only `created_at` is curren
# @param anchor [Symbol, OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter::Anchor] The anchor point for the client secret expiration, meaning that `seconds` will b
#
# @param seconds [Integer] The number of seconds from the anchor point to the expiration. Select a value be

# The anchor point for the ephemeral token expiration. Only `created_at` is
# currently supported.
# The anchor point for the client secret expiration, meaning that `seconds` will
# be added to the `created_at` time of the client secret to produce an expiration
# timestamp. Only `created_at` is currently supported.
#
# @see OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter#anchor
module Anchor
Expand Down
Loading