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.0-beta.1"
".": "0.4.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 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)

### Bug Fixes

* prevent rubocop from mangling `===` to `is_a?` check ([c3a61c9](https://github.com/openai/openai-ruby/commit/c3a61c9f83b8cb79b41edadadca1a241de03d10f))

## 0.4.0-beta.1 (2025-05-23)

Full Changelog: [v0.1.0-beta.2...v0.4.0-beta.1](https://github.com/openai/openai-ruby/compare/v0.1.0-beta.2...v0.4.0-beta.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.0.pre.beta.1)
openai (0.4.1)
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.0.pre.beta.1"
gem "openai", "~> 0.4.1"
```

<!-- x-release-please-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 @@ -600,11 +600,13 @@ class << self
#
# @return [Object]
def encode_content(headers, body)
# rubocop:disable Style/CaseEquality
# rubocop:disable Layout/LineLength
content_type = headers["content-type"]
case [content_type, body]
in [OpenAI::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }]
[headers, JSON.generate(body)]
in [OpenAI::Internal::Util::JSONL_CONTENT, Enumerable] unless body.is_a?(OpenAI::Internal::Type::FileInput)
in [OpenAI::Internal::Util::JSONL_CONTENT, Enumerable] unless OpenAI::Internal::Type::FileInput === body
[headers, body.lazy.map { JSON.generate(_1) }]
in [%r{^multipart/form-data}, Hash | OpenAI::Internal::Type::FileInput]
boundary, strio = encode_multipart_streaming(body)
Expand All @@ -619,6 +621,8 @@ def encode_content(headers, body)
else
[headers, body]
end
# rubocop:enable Layout/LineLength
# rubocop:enable Style/CaseEquality
end

# @api private
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.4.0.pre.beta.1"
VERSION = "0.4.1"
end