Skip to content

Commit 1815c45

Browse files
chore: reorganize type aliases
1 parent 2306cb4 commit 1815c45

File tree

50 files changed

+112
-92
lines changed

Some content is hidden

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

50 files changed

+112
-92
lines changed

lib/openai.rb

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
require_relative "openai/models/eval_update_response"
252252
require_relative "openai/models/file_chunking_strategy"
253253
require_relative "openai/models/file_chunking_strategy_param"
254+
require_relative "openai/models/file_content"
254255
require_relative "openai/models/file_content_params"
255256
require_relative "openai/models/file_create_params"
256257
require_relative "openai/models/file_deleted"

lib/openai/models/file_content.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
module OpenAI
4+
module Models
5+
FileContent = String
6+
end
7+
end

rbi/openai/models/beta/threads/runs/run_step.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module OpenAI
44
module Models
55
module Beta
66
module Threads
7+
RunStep = Runs::RunStep
8+
79
module Runs
810
class RunStep < OpenAI::Internal::Type::BaseModel
911
# The identifier of the run step, which can be referenced in API endpoints.
@@ -337,8 +339,6 @@ module OpenAI
337339
end
338340
end
339341
end
340-
341-
RunStep = Runs::RunStep
342342
end
343343
end
344344
end

rbi/openai/models/beta/threads/runs/run_step_delta.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module OpenAI
44
module Models
55
module Beta
66
module Threads
7+
RunStepDelta = Runs::RunStepDelta
8+
79
module Runs
810
class RunStepDelta < OpenAI::Internal::Type::BaseModel
911
# The details of the run step.
@@ -73,8 +75,6 @@ module OpenAI
7375
end
7476
end
7577
end
76-
77-
RunStepDelta = Runs::RunStepDelta
7878
end
7979
end
8080
end

rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module OpenAI
44
module Models
55
module Beta
66
module Threads
7+
RunStepDeltaEvent = Runs::RunStepDeltaEvent
8+
79
module Runs
810
class RunStepDeltaEvent < OpenAI::Internal::Type::BaseModel
911
# The identifier of the run step, which can be referenced in API endpoints.
@@ -43,8 +45,6 @@ module OpenAI
4345
def to_hash; end
4446
end
4547
end
46-
47-
RunStepDeltaEvent = Runs::RunStepDeltaEvent
4848
end
4949
end
5050
end

rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module OpenAI
44
module Models
55
module Beta
66
module Threads
7+
RunStepDeltaMessageDelta = Runs::RunStepDeltaMessageDelta
8+
79
module Runs
810
class RunStepDeltaMessageDelta < OpenAI::Internal::Type::BaseModel
911
# Always `message_creation`.
@@ -69,8 +71,6 @@ module OpenAI
6971
end
7072
end
7173
end
72-
73-
RunStepDeltaMessageDelta = Runs::RunStepDeltaMessageDelta
7474
end
7575
end
7676
end

rbi/openai/models/beta/threads/runs/run_step_include.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module OpenAI
44
module Models
55
module Beta
66
module Threads
7+
RunStepInclude = Runs::RunStepInclude
8+
79
module Runs
810
module RunStepInclude
911
extend OpenAI::Internal::Type::Enum
@@ -21,8 +23,6 @@ module OpenAI
2123
def self.values; end
2224
end
2325
end
24-
25-
RunStepInclude = Runs::RunStepInclude
2626
end
2727
end
2828
end

rbi/openai/models/chat/chat_completion.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletion = Chat::ChatCompletion
6+
57
module Chat
68
class ChatCompletion < OpenAI::Internal::Type::BaseModel
79
# A unique identifier for the chat completion.
@@ -294,7 +296,5 @@ module OpenAI
294296
end
295297
end
296298
end
297-
298-
ChatCompletion = Chat::ChatCompletion
299299
end
300300
end

rbi/openai/models/chat/chat_completion_assistant_message_param.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionAssistantMessageParam = Chat::ChatCompletionAssistantMessageParam
6+
57
module Chat
68
class ChatCompletionAssistantMessageParam < OpenAI::Internal::Type::BaseModel
79
# The role of the messages author, in this case `assistant`.
@@ -242,7 +244,5 @@ module OpenAI
242244
end
243245
end
244246
end
245-
246-
ChatCompletionAssistantMessageParam = Chat::ChatCompletionAssistantMessageParam
247247
end
248248
end

rbi/openai/models/chat/chat_completion_audio.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionAudio = Chat::ChatCompletionAudio
6+
57
module Chat
68
class ChatCompletionAudio < OpenAI::Internal::Type::BaseModel
79
# Unique identifier for this audio response.
@@ -44,7 +46,5 @@ module OpenAI
4446
def to_hash; end
4547
end
4648
end
47-
48-
ChatCompletionAudio = Chat::ChatCompletionAudio
4949
end
5050
end

rbi/openai/models/chat/chat_completion_audio_param.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionAudioParam = Chat::ChatCompletionAudioParam
6+
57
module Chat
68
class ChatCompletionAudioParam < OpenAI::Internal::Type::BaseModel
79
# Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,
@@ -87,7 +89,5 @@ module OpenAI
8789
end
8890
end
8991
end
90-
91-
ChatCompletionAudioParam = Chat::ChatCompletionAudioParam
9292
end
9393
end

rbi/openai/models/chat/chat_completion_chunk.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionChunk = Chat::ChatCompletionChunk
6+
57
module Chat
68
class ChatCompletionChunk < OpenAI::Internal::Type::BaseModel
79
# A unique identifier for the chat completion. Each chunk has the same ID.
@@ -562,7 +564,5 @@ module OpenAI
562564
end
563565
end
564566
end
565-
566-
ChatCompletionChunk = Chat::ChatCompletionChunk
567567
end
568568
end

rbi/openai/models/chat/chat_completion_content_part.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionContentPart = Chat::ChatCompletionContentPart
6+
57
module Chat
68
# Learn about
79
# [text inputs](https://platform.openai.com/docs/guides/text-generation).
@@ -88,7 +90,5 @@ module OpenAI
8890
def self.variants; end
8991
end
9092
end
91-
92-
ChatCompletionContentPart = Chat::ChatCompletionContentPart
9393
end
9494
end

rbi/openai/models/chat/chat_completion_content_part_image.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionContentPartImage = Chat::ChatCompletionContentPartImage
6+
57
module Chat
68
class ChatCompletionContentPartImage < OpenAI::Internal::Type::BaseModel
79
sig { returns(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL) }
@@ -94,7 +96,5 @@ module OpenAI
9496
end
9597
end
9698
end
97-
98-
ChatCompletionContentPartImage = Chat::ChatCompletionContentPartImage
9999
end
100100
end

rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionContentPartInputAudio = Chat::ChatCompletionContentPartInputAudio
6+
57
module Chat
68
class ChatCompletionContentPartInputAudio < OpenAI::Internal::Type::BaseModel
79
sig { returns(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio) }
@@ -97,7 +99,5 @@ module OpenAI
9799
end
98100
end
99101
end
100-
101-
ChatCompletionContentPartInputAudio = Chat::ChatCompletionContentPartInputAudio
102102
end
103103
end

rbi/openai/models/chat/chat_completion_content_part_refusal.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionContentPartRefusal = Chat::ChatCompletionContentPartRefusal
6+
57
module Chat
68
class ChatCompletionContentPartRefusal < OpenAI::Internal::Type::BaseModel
79
# The refusal message generated by the model.
@@ -23,7 +25,5 @@ module OpenAI
2325
def to_hash; end
2426
end
2527
end
26-
27-
ChatCompletionContentPartRefusal = Chat::ChatCompletionContentPartRefusal
2828
end
2929
end

rbi/openai/models/chat/chat_completion_content_part_text.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionContentPartText = Chat::ChatCompletionContentPartText
6+
57
module Chat
68
class ChatCompletionContentPartText < OpenAI::Internal::Type::BaseModel
79
# The text content.
@@ -25,7 +27,5 @@ module OpenAI
2527
def to_hash; end
2628
end
2729
end
28-
29-
ChatCompletionContentPartText = Chat::ChatCompletionContentPartText
3030
end
3131
end

rbi/openai/models/chat/chat_completion_deleted.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionDeleted = Chat::ChatCompletionDeleted
6+
57
module Chat
68
class ChatCompletionDeleted < OpenAI::Internal::Type::BaseModel
79
# The ID of the chat completion that was deleted.
@@ -29,7 +31,5 @@ module OpenAI
2931
def to_hash; end
3032
end
3133
end
32-
33-
ChatCompletionDeleted = Chat::ChatCompletionDeleted
3434
end
3535
end

rbi/openai/models/chat/chat_completion_developer_message_param.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionDeveloperMessageParam = Chat::ChatCompletionDeveloperMessageParam
6+
57
module Chat
68
class ChatCompletionDeveloperMessageParam < OpenAI::Internal::Type::BaseModel
79
# The contents of the developer message.
@@ -70,7 +72,5 @@ module OpenAI
7072
end
7173
end
7274
end
73-
74-
ChatCompletionDeveloperMessageParam = Chat::ChatCompletionDeveloperMessageParam
7575
end
7676
end

rbi/openai/models/chat/chat_completion_function_call_option.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionFunctionCallOption = Chat::ChatCompletionFunctionCallOption
6+
57
module Chat
68
class ChatCompletionFunctionCallOption < OpenAI::Internal::Type::BaseModel
79
# The name of the function to call.
@@ -19,7 +21,5 @@ module OpenAI
1921
def to_hash; end
2022
end
2123
end
22-
23-
ChatCompletionFunctionCallOption = Chat::ChatCompletionFunctionCallOption
2424
end
2525
end

rbi/openai/models/chat/chat_completion_function_message_param.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionFunctionMessageParam = Chat::ChatCompletionFunctionMessageParam
6+
57
module Chat
68
class ChatCompletionFunctionMessageParam < OpenAI::Internal::Type::BaseModel
79
# The contents of the function message.
@@ -29,7 +31,5 @@ module OpenAI
2931
def to_hash; end
3032
end
3133
end
32-
33-
ChatCompletionFunctionMessageParam = Chat::ChatCompletionFunctionMessageParam
3434
end
3535
end

rbi/openai/models/chat/chat_completion_message.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionMessage = Chat::ChatCompletionMessage
6+
57
module Chat
68
class ChatCompletionMessage < OpenAI::Internal::Type::BaseModel
79
# The contents of the message.
@@ -221,7 +223,5 @@ module OpenAI
221223
end
222224
end
223225
end
224-
225-
ChatCompletionMessage = Chat::ChatCompletionMessage
226226
end
227227
end

rbi/openai/models/chat/chat_completion_message_param.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionMessageParam = Chat::ChatCompletionMessageParam
6+
57
module Chat
68
# Developer-provided instructions that the model should follow, regardless of
79
# messages sent by the user. With o1 models and newer, `developer` messages
@@ -18,7 +20,5 @@ module OpenAI
1820
def self.variants; end
1921
end
2022
end
21-
22-
ChatCompletionMessageParam = Chat::ChatCompletionMessageParam
2323
end
2424
end

rbi/openai/models/chat/chat_completion_message_tool_call.rbi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module OpenAI
44
module Models
5+
ChatCompletionMessageToolCall = Chat::ChatCompletionMessageToolCall
6+
57
module Chat
68
class ChatCompletionMessageToolCall < OpenAI::Internal::Type::BaseModel
79
# The ID of the tool call.
@@ -76,7 +78,5 @@ module OpenAI
7678
end
7779
end
7880
end
79-
80-
ChatCompletionMessageToolCall = Chat::ChatCompletionMessageToolCall
8181
end
8282
end

0 commit comments

Comments
 (0)