openai 0.35.1 → 0.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/openai/helpers/structured_output/union_of.rb +5 -1
- data/lib/openai/internal/transport/pooled_net_requester.rb +6 -2
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +1 -0
- data/manifest.yaml +1 -0
- data/rbi/openai/internal/transport/pooled_net_requester.rbi +6 -2
- data/sig/openai/internal/transport/pooled_net_requester.rbs +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a382ad359ddcf643add7dacb494b3ae4a168613ef39f5bcd42714fc1442d02ba
|
|
4
|
+
data.tar.gz: f28ed9c7f0e0a90a962568a3ae3ae47a07b8bd563b2a81720499c7ba7ec8fb6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 445ec7a996ba1f852090a1c0b7c6b1f5a3b448ab5bdb94be1475b6fae76b25085dd6e494d8e811e7c440978783b8c10e559665ded5a294c69d00006c86d3e774
|
|
7
|
+
data.tar.gz: 9407b17d49a8749eb432a60348b382176ff19663f321dd3283d38848a7a9247be3f480b3e46d002b028580a9c045f63fe0a48436a8447fae225cb602b93c8fce
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.35.2 (2025-11-05)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.35.1...v0.35.2](https://github.com/openai/openai-ruby/compare/v0.35.1...v0.35.2)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* better thread safety via early initializing SSL store during HTTP client creation ([e7d9a3d](https://github.com/openai/openai-ruby/commit/e7d9a3d70c0930ac248b4da680296213cb3e163d))
|
|
10
|
+
* schema generation ([#862](https://github.com/openai/openai-ruby/issues/862)) ([2c9b91a](https://github.com/openai/openai-ruby/commit/2c9b91acc79262dd56ef52854ad64384f172984b))
|
|
11
|
+
|
|
3
12
|
## 0.35.1 (2025-11-04)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.35.0...v0.35.1](https://github.com/openai/openai-ruby/compare/v0.35.0...v0.35.1)
|
data/README.md
CHANGED
|
@@ -21,6 +21,7 @@ module OpenAI
|
|
|
21
21
|
#
|
|
22
22
|
# @return [Hash{Symbol=>Object}]
|
|
23
23
|
def to_json_schema_inner(state:)
|
|
24
|
+
# rubocop:disable Metrics/BlockLength
|
|
24
25
|
OpenAI::Helpers::StructuredOutput::JsonSchemaConverter.cache_def!(state, type: self) do
|
|
25
26
|
path = state.fetch(:path)
|
|
26
27
|
mergeable_keys = {[:anyOf] => 0, [:type] => 0}
|
|
@@ -33,7 +34,9 @@ module OpenAI
|
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
schemas.each do |schema|
|
|
36
|
-
mergeable_keys.each_key
|
|
37
|
+
mergeable_keys.each_key do
|
|
38
|
+
mergeable_keys[_1] += 1 if schema.keys == _1 && schema[_1].is_a?(Array)
|
|
39
|
+
end
|
|
37
40
|
end
|
|
38
41
|
mergeable = mergeable_keys.any? { _1.last == schemas.length }
|
|
39
42
|
if mergeable
|
|
@@ -48,6 +51,7 @@ module OpenAI
|
|
|
48
51
|
}
|
|
49
52
|
end
|
|
50
53
|
end
|
|
54
|
+
# rubocop:enable Metrics/BlockLength
|
|
51
55
|
end
|
|
52
56
|
|
|
53
57
|
private_class_method :new
|
|
@@ -16,10 +16,11 @@ module OpenAI
|
|
|
16
16
|
class << self
|
|
17
17
|
# @api private
|
|
18
18
|
#
|
|
19
|
+
# @param cert_store [OpenSSL::X509::Store]
|
|
19
20
|
# @param url [URI::Generic]
|
|
20
21
|
#
|
|
21
22
|
# @return [Net::HTTP]
|
|
22
|
-
def connect(url)
|
|
23
|
+
def connect(cert_store:, url:)
|
|
23
24
|
port =
|
|
24
25
|
case [url.port, url.scheme]
|
|
25
26
|
in [Integer, _]
|
|
@@ -33,6 +34,8 @@ module OpenAI
|
|
|
33
34
|
Net::HTTP.new(url.host, port).tap do
|
|
34
35
|
_1.use_ssl = %w[https wss].include?(url.scheme)
|
|
35
36
|
_1.max_retries = 0
|
|
37
|
+
|
|
38
|
+
(_1.cert_store = cert_store) if _1.use_ssl?
|
|
36
39
|
end
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -102,7 +105,7 @@ module OpenAI
|
|
|
102
105
|
pool =
|
|
103
106
|
@mutex.synchronize do
|
|
104
107
|
@pools[origin] ||= ConnectionPool.new(size: @size) do
|
|
105
|
-
self.class.connect(url)
|
|
108
|
+
self.class.connect(cert_store: @cert_store, url: url)
|
|
106
109
|
end
|
|
107
110
|
end
|
|
108
111
|
|
|
@@ -192,6 +195,7 @@ module OpenAI
|
|
|
192
195
|
def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
|
|
193
196
|
@mutex = Mutex.new
|
|
194
197
|
@size = size
|
|
198
|
+
@cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
|
195
199
|
@pools = {}
|
|
196
200
|
end
|
|
197
201
|
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
data/manifest.yaml
CHANGED
|
@@ -26,8 +26,12 @@ module OpenAI
|
|
|
26
26
|
|
|
27
27
|
class << self
|
|
28
28
|
# @api private
|
|
29
|
-
sig
|
|
30
|
-
|
|
29
|
+
sig do
|
|
30
|
+
params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
|
|
31
|
+
Net::HTTP
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def connect(cert_store:, url:)
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
# @api private
|
|
@@ -17,7 +17,10 @@ module OpenAI
|
|
|
17
17
|
|
|
18
18
|
DEFAULT_MAX_CONNECTIONS: Integer
|
|
19
19
|
|
|
20
|
-
def self.connect: (
|
|
20
|
+
def self.connect: (
|
|
21
|
+
cert_store: OpenSSL::X509::Store,
|
|
22
|
+
url: URI::Generic
|
|
23
|
+
) -> top
|
|
21
24
|
|
|
22
25
|
def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
|
|
23
26
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.35.
|
|
4
|
+
version: 0.35.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|