Skip to content

release: 0.6.0 #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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.5.1"
".": "0.6.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 109
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2bcc845d8635bf93ddcf9ee723af4d7928248412a417bee5fc10d863a1e13867.yml
openapi_spec_hash: 865230cb3abeb01bd85de05891af23c4
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0205acb1015d29b2312a48526734c0399f93026d4fe2dff5c7768f566e333fd2.yml
openapi_spec_hash: 1772cc9056c2f6dfb2a4e9cb77ee6343
config_hash: ed1e6b3c5f93d12b80d31167f55c557c
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.6.0 (2025-06-03)

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

### Features

* **api:** add new realtime and audio models, realtime session options ([315f0b0](https://github.com/openai/openai-ruby/commit/315f0b0ec3a663a7bc1f2c05ecc6ebfe8af99796))


### Bug Fixes

* `to_sorbet_type` should not return branded types ([4a1f14b](https://github.com/openai/openai-ruby/commit/4a1f14beeea6f1ef08d753fb3c3fa8607ebbe2c2))


### Chores

* prune whitespace ([d7335ac](https://github.com/openai/openai-ruby/commit/d7335ac4942eeccfa341eaf2fb2d45ec83df4dd3))

## 0.5.1 (2025-06-02)

Full Changelog: [v0.5.0...v0.5.1](https://github.com/openai/openai-ruby/compare/v0.5.0...v0.5.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.5.1)
openai (0.6.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.5.1"
gem "openai", "~> 0.6.0"
```

<!-- x-release-please-end -->
Expand Down
9 changes: 6 additions & 3 deletions lib/openai/internal/type/enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ def coerce(value, state:)
#
# @return [Object]
def to_sorbet_type
case values
types = values.map { OpenAI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
case types
in []
T.noreturn
in [value, *_]
T.all(OpenAI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(value), self)
in [type]
type
else
T.any(*types)
end
end

Expand Down
7 changes: 5 additions & 2 deletions lib/openai/internal/type/union.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,14 @@ def dump(value, state:)
#
# @return [Object]
def to_sorbet_type
case (v = variants)
types = variants.map { OpenAI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
case types
in []
T.noreturn
in [type]
type
else
T.any(*v.map { OpenAI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) })
T.any(*types)
end
end

Expand Down
8 changes: 4 additions & 4 deletions lib/openai/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ module OpenAI
mod.constants.each do |name|
case mod.const_get(name)
in true | false
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } }
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } }
mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
in Integer
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } }
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } }
mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
in Float
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } }
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } }
mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
in Symbol
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } }
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } }
mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
else
end
Expand Down
1 change: 1 addition & 0 deletions lib/openai/models/chat_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module ChatModel
GPT_4O_AUDIO_PREVIEW = :"gpt-4o-audio-preview"
GPT_4O_AUDIO_PREVIEW_2024_10_01 = :"gpt-4o-audio-preview-2024-10-01"
GPT_4O_AUDIO_PREVIEW_2024_12_17 = :"gpt-4o-audio-preview-2024-12-17"
GPT_4O_AUDIO_PREVIEW_2025_06_03 = :"gpt-4o-audio-preview-2025-06-03"
GPT_4O_MINI_AUDIO_PREVIEW = :"gpt-4o-mini-audio-preview"
GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17 = :"gpt-4o-mini-audio-preview-2024-12-17"
GPT_4O_SEARCH_PREVIEW = :"gpt-4o-search-preview"
Expand Down
4 changes: 2 additions & 2 deletions lib/openai/resources/beta/threads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ def create_and_run(params)
options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
)
end

def stream
raise NotImplementedError.new("higher level helpers are coming soon!")
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# See {OpenAI::Resources::Beta::Threads#create_and_run} for non-streaming
Expand Down
2 changes: 1 addition & 1 deletion lib/openai/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module OpenAI
VERSION = "0.5.1"
VERSION = "0.6.0"
end
5 changes: 5 additions & 0 deletions rbi/openai/models/chat_model.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ module OpenAI
:"gpt-4o-audio-preview-2024-12-17",
OpenAI::ChatModel::TaggedSymbol
)
GPT_4O_AUDIO_PREVIEW_2025_06_03 =
T.let(
:"gpt-4o-audio-preview-2025-06-03",
OpenAI::ChatModel::TaggedSymbol
)
GPT_4O_MINI_AUDIO_PREVIEW =
T.let(:"gpt-4o-mini-audio-preview", OpenAI::ChatModel::TaggedSymbol)
GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17 =
Expand Down
2 changes: 2 additions & 0 deletions sig/openai/models/chat_model.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module OpenAI
| :"gpt-4o-audio-preview"
| :"gpt-4o-audio-preview-2024-10-01"
| :"gpt-4o-audio-preview-2024-12-17"
| :"gpt-4o-audio-preview-2025-06-03"
| :"gpt-4o-mini-audio-preview"
| :"gpt-4o-mini-audio-preview-2024-12-17"
| :"gpt-4o-search-preview"
Expand Down Expand Up @@ -84,6 +85,7 @@ module OpenAI
GPT_4O_AUDIO_PREVIEW: :"gpt-4o-audio-preview"
GPT_4O_AUDIO_PREVIEW_2024_10_01: :"gpt-4o-audio-preview-2024-10-01"
GPT_4O_AUDIO_PREVIEW_2024_12_17: :"gpt-4o-audio-preview-2024-12-17"
GPT_4O_AUDIO_PREVIEW_2025_06_03: :"gpt-4o-audio-preview-2025-06-03"
GPT_4O_MINI_AUDIO_PREVIEW: :"gpt-4o-mini-audio-preview"
GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17: :"gpt-4o-mini-audio-preview-2024-12-17"
GPT_4O_SEARCH_PREVIEW: :"gpt-4o-search-preview"
Expand Down