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.4.1"
".": "0.5.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: 109
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fc64d7c2c8f51f750813375356c3f3fdfc7fc1b1b34f19c20a5410279d445d37.yml
openapi_spec_hash: 618285fc70199ee32b9ebe4bf72f7e4c
config_hash: 535b6e5f26a295d609b259c8cb8f656c
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d4bcffecf0cdadf746faa6708ed1ec81fac451f9b857deabbab26f0a343b9314.yml
openapi_spec_hash: 7c54a18b4381248bda7cc34c52142615
config_hash: d23f847b9ebb3f427d0f198035bd3e9f
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.5.0 (2025-05-29)

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

### Features

* **api:** Config update for pakrym-stream-param ([214e516](https://github.com/openai/openai-ruby/commit/214e516f286a026e5b040ffd76b930cad7d5eabf))


### Bug Fixes

* **client:** return binary content from `get /containers/{container_id}/files/{file_id}/content` ([2b7122a](https://github.com/openai/openai-ruby/commit/2b7122ad724620269c3b403d5a584d710bed5b5c))
* sorbet types for enums, and make tapioca detection ignore `tapioca dsl` ([0e24b3e](https://github.com/openai/openai-ruby/commit/0e24b3e0a574de5c0544067c53b9e693e4cec3b1))


### Chores

* deprecate Assistants API ([4ce7530](https://github.com/openai/openai-ruby/commit/4ce753088e18a3331fccf6608889243809ce187b))

## 0.4.1 (2025-05-23)

Full Changelog: [v0.4.0-beta.1...v0.4.1](https://github.com/openai/openai-ruby/compare/v0.4.0-beta.1...v0.4.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.4.1)
openai (0.5.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.4.1"
gem "openai", "~> 0.5.0"
```

<!-- x-release-please-end -->
Expand Down
4 changes: 3 additions & 1 deletion lib/openai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
require "uri"
# We already ship the preferred sorbet manifests in the package itself.
# `tapioca` currently does not offer us a way to opt out of unnecessary compilation.
if Object.const_defined?(:Tapioca) && caller.chain([$PROGRAM_NAME]).chain(ARGV).grep(/tapioca/)
if Object.const_defined?(:Tapioca) &&
caller.chain([$PROGRAM_NAME]).chain(ARGV).any?(/tapioca/) &&
ARGV.none?(/dsl/)
return
end

Expand Down
6 changes: 5 additions & 1 deletion lib/openai/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,12 @@ def to_sorbet_type(type)
case type
in OpenAI::Internal::Util::SorbetRuntimeSupport
type.to_sorbet_type
else
in Class | Module
type
in true | false
T::Boolean
else
type.class
end
end
end
Expand Down
69 changes: 68 additions & 1 deletion lib/openai/models/responses/response_output_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,23 @@ class ResponseOutputText < OpenAI::Internal::Type::BaseModel
# @return [Symbol, :output_text]
required :type, const: :output_text

# @!method initialize(annotations:, text:, type: :output_text)
# @!attribute logprobs
#
# @return [Array<OpenAI::Models::Responses::ResponseOutputText::Logprob>, nil]
optional :logprobs,
-> {
OpenAI::Internal::Type::ArrayOf[OpenAI::Responses::ResponseOutputText::Logprob]
}

# @!method initialize(annotations:, text:, logprobs: nil, type: :output_text)
# A text output from the model.
#
# @param annotations [Array<OpenAI::Models::Responses::ResponseOutputText::Annotation::FileCitation, OpenAI::Models::Responses::ResponseOutputText::Annotation::URLCitation, OpenAI::Models::Responses::ResponseOutputText::Annotation::FilePath>] The annotations of the text output.
#
# @param text [String] The text output from the model.
#
# @param logprobs [Array<OpenAI::Models::Responses::ResponseOutputText::Logprob>]
#
# @param type [Symbol, :output_text] The type of the output text. Always `output_text`.

# A citation to a file.
Expand Down Expand Up @@ -165,6 +175,63 @@ class FilePath < OpenAI::Internal::Type::BaseModel
# @!method self.variants
# @return [Array(OpenAI::Models::Responses::ResponseOutputText::Annotation::FileCitation, OpenAI::Models::Responses::ResponseOutputText::Annotation::URLCitation, OpenAI::Models::Responses::ResponseOutputText::Annotation::FilePath)]
end

class Logprob < OpenAI::Internal::Type::BaseModel
# @!attribute token
#
# @return [String]
required :token, String

# @!attribute bytes
#
# @return [Array<Integer>]
required :bytes, OpenAI::Internal::Type::ArrayOf[Integer]

# @!attribute logprob
#
# @return [Float]
required :logprob, Float

# @!attribute top_logprobs
#
# @return [Array<OpenAI::Models::Responses::ResponseOutputText::Logprob::TopLogprob>]
required :top_logprobs,
-> {
OpenAI::Internal::Type::ArrayOf[OpenAI::Responses::ResponseOutputText::Logprob::TopLogprob]
}

# @!method initialize(token:, bytes:, logprob:, top_logprobs:)
# The log probability of a token.
#
# @param token [String]
# @param bytes [Array<Integer>]
# @param logprob [Float]
# @param top_logprobs [Array<OpenAI::Models::Responses::ResponseOutputText::Logprob::TopLogprob>]

class TopLogprob < OpenAI::Internal::Type::BaseModel
# @!attribute token
#
# @return [String]
required :token, String

# @!attribute bytes
#
# @return [Array<Integer>]
required :bytes, OpenAI::Internal::Type::ArrayOf[Integer]

# @!attribute logprob
#
# @return [Float]
required :logprob, Float

# @!method initialize(token:, bytes:, logprob:)
# The top log probability of a token.
#
# @param token [String]
# @param bytes [Array<Integer>]
# @param logprob [Float]
end
end
end
end
end
Expand Down
12 changes: 11 additions & 1 deletion lib/openai/models/responses/response_retrieve_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module OpenAI
module Models
module Responses
# @see OpenAI::Resources::Responses#retrieve
#
# @see OpenAI::Resources::Responses#retrieve_streaming
class ResponseRetrieveParams < OpenAI::Internal::Type::BaseModel
extend OpenAI::Internal::Type::RequestParameters::Converter
include OpenAI::Internal::Type::RequestParameters
Expand All @@ -15,12 +17,20 @@ class ResponseRetrieveParams < OpenAI::Internal::Type::BaseModel
# @return [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>, nil]
optional :include, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Responses::ResponseIncludable] }

# @!method initialize(include: nil, request_options: {})
# @!attribute starting_after
# The sequence number of the event after which to start streaming.
#
# @return [Integer, nil]
optional :starting_after, Integer

# @!method initialize(include: nil, starting_after: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Responses::ResponseRetrieveParams} for more details.
#
# @param include [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>] Additional fields to include in the response. See the `include`
#
# @param starting_after [Integer] The sequence number of the event after which to start streaming.
#
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
17 changes: 15 additions & 2 deletions lib/openai/resources/beta/threads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
module OpenAI
module Resources
class Beta
# @deprecated The Assistants API is deprecated in favor of the Responses API
class Threads
# @return [OpenAI::Resources::Beta::Threads::Runs]
attr_reader :runs

# @return [OpenAI::Resources::Beta::Threads::Messages]
attr_reader :messages

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::ThreadCreateParams} for more details.
#
Expand Down Expand Up @@ -39,6 +42,8 @@
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Retrieves a thread.
#
# @overload retrieve(thread_id, request_options: {})
Expand All @@ -59,6 +64,8 @@
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::ThreadUpdateParams} for more details.
#
Expand Down Expand Up @@ -88,6 +95,8 @@
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Delete a thread.
#
# @overload delete(thread_id, request_options: {})
Expand All @@ -108,6 +117,8 @@
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# See {OpenAI::Resources::Beta::Threads#stream_raw} for streaming counterpart.
#
# Some parameter documentations has been truncated, see
Expand Down Expand Up @@ -166,11 +177,13 @@
options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
)
end

Check failure on line 180 in lib/openai/resources/beta/threads.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/TrailingWhitespace: Trailing whitespace detected.
def stream
raise NotImplementedError.new("higher level helpers are coming soon!")
end


Check failure on line 184 in lib/openai/resources/beta/threads.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/TrailingWhitespace: Trailing whitespace detected.
# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# See {OpenAI::Resources::Beta::Threads#create_and_run} for non-streaming
# counterpart.
#
Expand Down
11 changes: 11 additions & 0 deletions lib/openai/resources/beta/threads/messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ module OpenAI
module Resources
class Beta
class Threads
# @deprecated The Assistants API is deprecated in favor of the Responses API
class Messages
# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::Threads::MessageCreateParams} for more details.
#
Expand Down Expand Up @@ -38,6 +41,8 @@ def create(thread_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::Threads::MessageRetrieveParams} for more details.
#
Expand Down Expand Up @@ -68,6 +73,8 @@ def retrieve(message_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::Threads::MessageUpdateParams} for more details.
#
Expand Down Expand Up @@ -101,6 +108,8 @@ def update(message_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::Threads::MessageListParams} for more details.
#
Expand Down Expand Up @@ -137,6 +146,8 @@ def list(thread_id, params = {})
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Deletes a message.
#
# @overload delete(message_id, thread_id:, request_options: {})
Expand Down
17 changes: 17 additions & 0 deletions lib/openai/resources/beta/threads/runs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ module OpenAI
module Resources
class Beta
class Threads
# @deprecated The Assistants API is deprecated in favor of the Responses API
class Runs
# @return [OpenAI::Resources::Beta::Threads::Runs::Steps]
attr_reader :steps

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# See {OpenAI::Resources::Beta::Threads::Runs#create_stream_raw} for streaming
# counterpart.
#
Expand Down Expand Up @@ -76,6 +79,8 @@ def create(thread_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# See {OpenAI::Resources::Beta::Threads::Runs#create} for non-streaming
# counterpart.
#
Expand Down Expand Up @@ -147,6 +152,8 @@ def create_stream_raw(thread_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::Threads::RunRetrieveParams} for more details.
#
Expand Down Expand Up @@ -177,6 +184,8 @@ def retrieve(run_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::Threads::RunUpdateParams} for more details.
#
Expand Down Expand Up @@ -210,6 +219,8 @@ def update(run_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Beta::Threads::RunListParams} for more details.
#
Expand Down Expand Up @@ -244,6 +255,8 @@ def list(thread_id, params = {})
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# Cancels a run that is `in_progress`.
#
# @overload cancel(run_id, thread_id:, request_options: {})
Expand Down Expand Up @@ -271,6 +284,8 @@ def cancel(run_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs_stream_raw} for
# streaming counterpart.
#
Expand Down Expand Up @@ -314,6 +329,8 @@ def submit_tool_outputs(run_id, params)
)
end

# @deprecated The Assistants API is deprecated in favor of the Responses API
#
# See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs} for
# non-streaming counterpart.
#
Expand Down
Loading
Loading