Skip to content

Commit 147f0a4

Browse files
fix: bump sorbet version and fix new type errors from the breaking change
1 parent f6a214c commit 147f0a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+193
-475
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Naming/ClassAndModuleCamelCase:
149149
Naming/MethodParameterName:
150150
Enabled: false
151151

152-
Naming/PredicateName:
152+
Naming/PredicatePrefix:
153153
Exclude:
154154
- "**/*.rbi"
155155

Gemfile.lock

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ PATH
1717
GEM
1818
remote: https://rubygems.org/
1919
specs:
20-
activesupport (8.0.2)
20+
activesupport (8.0.2.1)
2121
base64
2222
benchmark (>= 0.3)
2323
bigdecimal
@@ -33,46 +33,50 @@ GEM
3333
addressable (2.8.7)
3434
public_suffix (>= 2.0.2, < 7.0)
3535
ast (2.4.3)
36-
async (2.24.0)
36+
async (2.27.3)
3737
console (~> 1.29)
3838
fiber-annotation
39-
io-event (~> 1.9)
39+
io-event (~> 1.11)
4040
metrics (~> 0.12)
4141
traces (~> 0.15)
42-
base64 (0.2.0)
43-
benchmark (0.4.0)
44-
bigdecimal (3.1.9)
42+
base64 (0.3.0)
43+
benchmark (0.4.1)
44+
bigdecimal (3.2.2)
4545
concurrent-ruby (1.3.5)
4646
connection_pool (2.5.3)
47-
console (1.30.2)
47+
console (1.33.0)
4848
fiber-annotation
4949
fiber-local (~> 1.1)
5050
json
5151
crack (1.0.0)
5252
bigdecimal
5353
rexml
54-
csv (3.3.4)
55-
drb (2.2.1)
54+
csv (3.3.5)
55+
drb (2.2.3)
5656
erubi (1.13.1)
57+
ffi (1.17.2-aarch64-linux-gnu)
58+
ffi (1.17.2-aarch64-linux-musl)
5759
ffi (1.17.2-arm64-darwin)
60+
ffi (1.17.2-x86_64-darwin)
5861
ffi (1.17.2-x86_64-linux-gnu)
62+
ffi (1.17.2-x86_64-linux-musl)
5963
fiber-annotation (0.2.0)
6064
fiber-local (1.1.0)
6165
fiber-storage
6266
fiber-storage (1.0.1)
6367
fileutils (1.7.3)
64-
hashdiff (1.1.2)
68+
hashdiff (1.2.0)
6569
i18n (1.14.7)
6670
concurrent-ruby (~> 1.0)
67-
io-event (1.10.0)
68-
json (2.11.3)
69-
language_server-protocol (3.17.0.4)
71+
io-event (1.11.2)
72+
json (2.13.2)
73+
language_server-protocol (3.17.0.5)
7074
lint_roller (1.1.0)
7175
listen (3.9.0)
7276
rb-fsevent (~> 0.10, >= 0.10.3)
7377
rb-inotify (~> 0.9, >= 0.9.10)
7478
logger (1.7.0)
75-
metrics (0.12.2)
79+
metrics (0.13.0)
7680
minitest (5.25.5)
7781
minitest-focus (1.4.0)
7882
minitest (>= 4, < 6)
@@ -85,55 +89,56 @@ GEM
8589
mutex_m (0.3.0)
8690
netrc (0.11.0)
8791
parallel (1.27.0)
88-
parser (3.3.8.0)
92+
parser (3.3.9.0)
8993
ast (~> 2.4.1)
9094
racc
9195
prettier_print (1.2.1)
9296
prism (1.4.0)
9397
public_suffix (6.0.2)
9498
racc (1.8.1)
9599
rainbow (3.1.1)
96-
rake (13.2.1)
100+
rake (13.3.0)
97101
rb-fsevent (0.11.2)
98102
rb-inotify (0.11.1)
99103
ffi (~> 1.0)
100-
rbi (0.3.2)
104+
rbi (0.3.6)
101105
prism (~> 1.0)
102106
rbs (>= 3.4.4)
103-
sorbet-runtime (>= 0.5.9204)
104-
rbs (3.9.2)
107+
rbs (3.9.4)
105108
logger
106109
redcarpet (3.6.1)
107-
regexp_parser (2.10.0)
110+
regexp_parser (2.11.2)
108111
rexml (3.4.1)
109-
rubocop (1.75.5)
112+
rubocop (1.79.2)
110113
json (~> 2.3)
111114
language_server-protocol (~> 3.17.0.2)
112115
lint_roller (~> 1.1.0)
113116
parallel (~> 1.10)
114117
parser (>= 3.3.0.2)
115118
rainbow (>= 2.2.2, < 4.0)
116119
regexp_parser (>= 2.9.3, < 3.0)
117-
rubocop-ast (>= 1.44.0, < 2.0)
120+
rubocop-ast (>= 1.46.0, < 2.0)
118121
ruby-progressbar (~> 1.7)
119122
unicode-display_width (>= 2.4.0, < 4.0)
120-
rubocop-ast (1.44.1)
123+
rubocop-ast (1.46.0)
121124
parser (>= 3.3.7.2)
122125
prism (~> 1.4)
123126
ruby-progressbar (1.13.0)
124127
securerandom (0.4.1)
125-
sorbet (0.5.12067)
126-
sorbet-static (= 0.5.12067)
127-
sorbet-runtime (0.5.12067)
128-
sorbet-static (0.5.12067-universal-darwin)
129-
sorbet-static (0.5.12067-x86_64-linux)
130-
sorbet-static-and-runtime (0.5.12067)
131-
sorbet (= 0.5.12067)
132-
sorbet-runtime (= 0.5.12067)
133-
spoom (1.6.1)
128+
sorbet (0.5.12424)
129+
sorbet-static (= 0.5.12424)
130+
sorbet-runtime (0.5.12424)
131+
sorbet-static (0.5.12424-aarch64-linux)
132+
sorbet-static (0.5.12424-universal-darwin)
133+
sorbet-static (0.5.12424-x86_64-linux)
134+
sorbet-static-and-runtime (0.5.12424)
135+
sorbet (= 0.5.12424)
136+
sorbet-runtime (= 0.5.12424)
137+
spoom (1.6.3)
134138
erubi (>= 1.10.0)
135139
prism (>= 0.28.0)
136-
rbi (>= 0.2.3)
140+
rbi (>= 0.3.3)
141+
rexml (>= 3.2.6)
137142
sorbet-static-and-runtime (>= 0.5.10187)
138143
thor (>= 0.19.2)
139144
steep (1.10.0)
@@ -154,7 +159,7 @@ GEM
154159
terminal-table (>= 2, < 5)
155160
uri (>= 0.12.0)
156161
strscan (3.1.5)
157-
syntax_tree (6.2.0)
162+
syntax_tree (6.3.0)
158163
prettier_print (>= 1.2.0)
159164
tapioca (0.16.11)
160165
benchmark
@@ -168,11 +173,11 @@ GEM
168173
yard-sorbet
169174
terminal-table (4.0.0)
170175
unicode-display_width (>= 1.1.1, < 4)
171-
thor (1.3.2)
172-
traces (0.15.2)
176+
thor (1.4.0)
177+
traces (0.17.0)
173178
tzinfo (2.0.6)
174179
concurrent-ruby (~> 1.0)
175-
unicode-display_width (3.1.4)
180+
unicode-display_width (3.1.5)
176181
unicode-emoji (~> 4.0, >= 4.0.4)
177182
unicode-emoji (4.0.4)
178183
uri (1.0.3)
@@ -187,8 +192,14 @@ GEM
187192
yard
188193

189194
PLATFORMS
190-
arm64-darwin-24
191-
x86_64-linux
195+
aarch64-linux
196+
aarch64-linux-gnu
197+
aarch64-linux-musl
198+
arm64-darwin
199+
universal-darwin
200+
x86_64-darwin
201+
x86_64-linux-gnu
202+
x86_64-linux-musl
192203

193204
DEPENDENCIES
194205
async

lib/openai/helpers/structured_output/boolean.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module StructuredOutput
88
# Ruby does not have a "boolean" Class, this is something for models to refer to.
99
class Boolean < OpenAI::Internal::Type::Boolean
1010
extend OpenAI::Helpers::StructuredOutput::JsonSchemaConverter
11+
1112
# rubocop:disable Lint/UnusedMethodArgument
1213

1314
# @api private

lib/openai/internal/transport/base_client.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,7 @@ def inspect
539539
)
540540
),
541541
page: T.nilable(T::Class[OpenAI::Internal::Type::BasePage[OpenAI::Internal::Type::BaseModel]]),
542-
stream: T.nilable(
543-
T::Class[OpenAI::Internal::Type::BaseStream[T.anything,
544-
OpenAI::Internal::Type::BaseModel]]
545-
),
542+
stream: T.nilable(T::Class[OpenAI::Internal::Type::BaseStream[T.anything, OpenAI::Internal::Type::BaseModel]]),
546543
model: T.nilable(OpenAI::Internal::Type::Converter::Input),
547544
options: T.nilable(OpenAI::RequestOptions::OrHash)
548545
}

lib/openai/internal/transport/pooled_net_requester.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,7 @@ def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
193193
end
194194

195195
define_sorbet_constant!(:Request) do
196-
T.type_alias do
197-
{
198-
method: Symbol,
199-
url: URI::Generic,
200-
headers: T::Hash[String, String],
201-
body: T.anything,
202-
deadline: Float
203-
}
204-
end
196+
T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} }
205197
end
206198
end
207199
end

lib/openai/internal/util.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class << self
244244
#
245245
# @return [String]
246246
def uri_origin(uri)
247-
"#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}"
247+
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248248
end
249249

250250
# @api private

lib/openai/models/audio/transcription.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ class Tokens < OpenAI::Internal::Type::BaseModel
107107
# Details about the input tokens billed for this request.
108108
#
109109
# @return [OpenAI::Models::Audio::Transcription::Usage::Tokens::InputTokenDetails, nil]
110-
optional :input_token_details,
111-
-> {
112-
OpenAI::Audio::Transcription::Usage::Tokens::InputTokenDetails
113-
}
110+
optional :input_token_details, -> { OpenAI::Audio::Transcription::Usage::Tokens::InputTokenDetails }
114111

115112
# @!method initialize(input_tokens:, output_tokens:, total_tokens:, input_token_details: nil, type: :tokens)
116113
# Usage statistics for models billed by token usage.

lib/openai/models/audio/transcription_create_params.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ class TranscriptionCreateParams < OpenAI::Internal::Type::BaseModel
9090
#
9191
# @return [Array<Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity>, nil]
9292
optional :timestamp_granularities,
93-
-> {
94-
OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionCreateParams::TimestampGranularity]
95-
}
93+
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionCreateParams::TimestampGranularity] }
9694

9795
# @!method initialize(file:, model:, chunking_strategy: nil, include: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {})
9896
# Some parameter documentations has been truncated, see
@@ -150,10 +148,7 @@ class VadConfig < OpenAI::Internal::Type::BaseModel
150148
# Must be set to `server_vad` to enable manual chunking using server side VAD.
151149
#
152150
# @return [Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig::Type]
153-
required :type,
154-
enum: -> {
155-
OpenAI::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig::Type
156-
}
151+
required :type, enum: -> { OpenAI::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig::Type }
157152

158153
# @!attribute prefix_padding_ms
159154
# Amount of audio to include before the VAD detected speech (in milliseconds).

lib/openai/models/audio/transcription_text_done_event.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ class Usage < OpenAI::Internal::Type::BaseModel
109109
# Details about the input tokens billed for this request.
110110
#
111111
# @return [OpenAI::Models::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails, nil]
112-
optional :input_token_details,
113-
-> {
114-
OpenAI::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails
115-
}
112+
optional :input_token_details, -> { OpenAI::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails }
116113

117114
# @!method initialize(input_tokens:, output_tokens:, total_tokens:, input_token_details: nil, type: :tokens)
118115
# Usage statistics for models billed by token usage.

lib/openai/models/beta/assistant_create_params.rb

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ class ToolResources < OpenAI::Internal::Type::BaseModel
167167
# @!attribute code_interpreter
168168
#
169169
# @return [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::CodeInterpreter, nil]
170-
optional :code_interpreter,
171-
-> {
172-
OpenAI::Beta::AssistantCreateParams::ToolResources::CodeInterpreter
173-
}
170+
optional :code_interpreter, -> { OpenAI::Beta::AssistantCreateParams::ToolResources::CodeInterpreter }
174171

175172
# @!attribute file_search
176173
#
@@ -223,9 +220,7 @@ class FileSearch < OpenAI::Internal::Type::BaseModel
223220
#
224221
# @return [Array<OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore>, nil]
225222
optional :vector_stores,
226-
-> {
227-
OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore]
228-
}
223+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore] }
229224

230225
# @!method initialize(vector_store_ids: nil, vector_stores: nil)
231226
# Some parameter documentations has been truncated, see
@@ -243,9 +238,7 @@ class VectorStore < OpenAI::Internal::Type::BaseModel
243238
#
244239
# @return [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static, nil]
245240
optional :chunking_strategy,
246-
union: -> {
247-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy
248-
}
241+
union: -> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy }
249242

250243
# @!attribute file_ids
251244
# A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
@@ -288,14 +281,10 @@ module ChunkingStrategy
288281

289282
# The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
290283
variant :auto,
291-
-> {
292-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto
293-
}
284+
-> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto }
294285

295286
variant :static,
296-
-> {
297-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static
298-
}
287+
-> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static }
299288

300289
class Auto < OpenAI::Internal::Type::BaseModel
301290
# @!attribute type
@@ -316,9 +305,7 @@ class Static < OpenAI::Internal::Type::BaseModel
316305
#
317306
# @return [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static]
318307
required :static,
319-
-> {
320-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static
321-
}
308+
-> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static }
322309

323310
# @!attribute type
324311
# Always `static`.

0 commit comments

Comments
 (0)