openai 0.16.0 → 0.17.0
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 +24 -0
- data/README.md +14 -20
- data/lib/openai/internal/transport/base_client.rb +1 -1
- data/lib/openai/internal/type/enum.rb +6 -6
- data/lib/openai/internal/type/union.rb +13 -17
- data/lib/openai/models/beta/assistant_create_params.rb +4 -5
- data/lib/openai/models/beta/assistant_update_params.rb +22 -5
- data/lib/openai/models/beta/threads/run_create_params.rb +4 -5
- data/lib/openai/models/chat/chat_completion_allowed_tool_choice.rb +33 -0
- data/lib/openai/models/chat/chat_completion_allowed_tools.rb +64 -0
- data/lib/openai/models/chat/chat_completion_assistant_message_param.rb +3 -5
- data/lib/openai/models/chat/chat_completion_custom_tool.rb +163 -0
- data/lib/openai/models/chat/chat_completion_function_tool.rb +29 -0
- data/lib/openai/models/chat/chat_completion_message.rb +3 -5
- data/lib/openai/models/chat/chat_completion_message_custom_tool_call.rb +60 -0
- data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +73 -0
- data/lib/openai/models/chat/chat_completion_message_tool_call.rb +10 -56
- data/lib/openai/models/chat/chat_completion_named_tool_choice.rb +2 -2
- data/lib/openai/models/chat/chat_completion_named_tool_choice_custom.rb +42 -0
- data/lib/openai/models/chat/chat_completion_stream_options.rb +14 -1
- data/lib/openai/models/chat/chat_completion_tool.rb +12 -14
- data/lib/openai/models/chat/chat_completion_tool_choice_option.rb +7 -1
- data/lib/openai/models/chat/completion_create_params.rb +35 -12
- data/lib/openai/models/chat_model.rb +7 -0
- data/lib/openai/models/custom_tool_input_format.rb +76 -0
- data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +3 -3
- data/lib/openai/models/evals/run_cancel_response.rb +2 -2
- data/lib/openai/models/evals/run_create_params.rb +2 -2
- data/lib/openai/models/evals/run_create_response.rb +2 -2
- data/lib/openai/models/evals/run_list_response.rb +2 -2
- data/lib/openai/models/evals/run_retrieve_response.rb +2 -2
- data/lib/openai/models/reasoning.rb +4 -5
- data/lib/openai/models/reasoning_effort.rb +4 -4
- data/lib/openai/models/response_format_text_grammar.rb +27 -0
- data/lib/openai/models/response_format_text_python.rb +20 -0
- data/lib/openai/models/responses/custom_tool.rb +48 -0
- data/lib/openai/models/responses/response.rb +20 -12
- data/lib/openai/models/responses/response_create_params.rb +48 -10
- data/lib/openai/models/responses/response_custom_tool_call.rb +55 -0
- data/lib/openai/models/responses/response_custom_tool_call_input_delta_event.rb +52 -0
- data/lib/openai/models/responses/response_custom_tool_call_input_done_event.rb +52 -0
- data/lib/openai/models/responses/response_custom_tool_call_output.rb +47 -0
- data/lib/openai/models/responses/response_input_item.rb +7 -1
- data/lib/openai/models/responses/response_output_item.rb +4 -1
- data/lib/openai/models/responses/response_output_item_added_event.rb +2 -2
- data/lib/openai/models/responses/response_output_item_done_event.rb +2 -2
- data/lib/openai/models/responses/response_reasoning_item.rb +36 -5
- data/lib/openai/models/responses/response_reasoning_text_delta_event.rb +63 -0
- data/lib/openai/models/responses/response_reasoning_text_done_event.rb +63 -0
- data/lib/openai/models/responses/response_retrieve_params.rb +14 -1
- data/lib/openai/models/responses/response_stream_event.rb +13 -11
- data/lib/openai/models/responses/response_text_config.rb +27 -1
- data/lib/openai/models/responses/tool.rb +5 -1
- data/lib/openai/models/responses/tool_choice_allowed.rb +73 -0
- data/lib/openai/models/responses/tool_choice_custom.rb +28 -0
- data/lib/openai/models/vector_store_search_params.rb +6 -1
- data/lib/openai/models.rb +6 -0
- data/lib/openai/resources/beta/assistants.rb +2 -2
- data/lib/openai/resources/beta/threads/runs.rb +2 -2
- data/lib/openai/resources/chat/completions.rb +16 -10
- data/lib/openai/resources/responses.rb +38 -22
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +19 -2
- data/rbi/openai/internal/transport/base_client.rbi +1 -1
- data/rbi/openai/models/beta/assistant_create_params.rbi +6 -8
- data/rbi/openai/models/beta/assistant_update_params.rbi +36 -8
- data/rbi/openai/models/beta/threads/run_create_params.rbi +6 -8
- data/rbi/openai/models/chat/chat_completion_allowed_tool_choice.rbi +60 -0
- data/rbi/openai/models/chat/chat_completion_allowed_tools.rbi +118 -0
- data/rbi/openai/models/chat/chat_completion_assistant_message_param.rbi +27 -4
- data/rbi/openai/models/chat/chat_completion_custom_tool.rbi +335 -0
- data/rbi/openai/models/chat/chat_completion_function_tool.rbi +51 -0
- data/rbi/openai/models/chat/chat_completion_message.rbi +17 -4
- data/rbi/openai/models/chat/chat_completion_message_custom_tool_call.rbi +105 -0
- data/rbi/openai/models/chat/chat_completion_message_function_tool_call.rbi +118 -0
- data/rbi/openai/models/chat/chat_completion_message_tool_call.rbi +9 -92
- data/rbi/openai/models/chat/chat_completion_named_tool_choice.rbi +2 -2
- data/rbi/openai/models/chat/chat_completion_named_tool_choice_custom.rbi +89 -0
- data/rbi/openai/models/chat/chat_completion_stream_options.rbi +30 -2
- data/rbi/openai/models/chat/chat_completion_tool.rbi +11 -30
- data/rbi/openai/models/chat/chat_completion_tool_choice_option.rbi +3 -1
- data/rbi/openai/models/chat/completion_create_params.rbi +106 -25
- data/rbi/openai/models/chat_model.rbi +11 -0
- data/rbi/openai/models/custom_tool_input_format.rbi +136 -0
- data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +8 -4
- data/rbi/openai/models/evals/run_cancel_response.rbi +2 -0
- data/rbi/openai/models/evals/run_create_params.rbi +4 -0
- data/rbi/openai/models/evals/run_create_response.rbi +2 -0
- data/rbi/openai/models/evals/run_list_response.rbi +2 -0
- data/rbi/openai/models/evals/run_retrieve_response.rbi +2 -0
- data/rbi/openai/models/reasoning.rbi +6 -8
- data/rbi/openai/models/reasoning_effort.rbi +4 -4
- data/rbi/openai/models/response_format_text_grammar.rbi +35 -0
- data/rbi/openai/models/response_format_text_python.rbi +30 -0
- data/rbi/openai/models/responses/custom_tool.rbi +96 -0
- data/rbi/openai/models/responses/response.rbi +15 -5
- data/rbi/openai/models/responses/response_create_params.rbi +94 -7
- data/rbi/openai/models/responses/response_custom_tool_call.rbi +78 -0
- data/rbi/openai/models/responses/response_custom_tool_call_input_delta_event.rbi +75 -0
- data/rbi/openai/models/responses/response_custom_tool_call_input_done_event.rbi +75 -0
- data/rbi/openai/models/responses/response_custom_tool_call_output.rbi +65 -0
- data/rbi/openai/models/responses/response_input_item.rbi +2 -0
- data/rbi/openai/models/responses/response_output_item.rbi +2 -1
- data/rbi/openai/models/responses/response_output_item_added_event.rbi +2 -1
- data/rbi/openai/models/responses/response_output_item_done_event.rbi +2 -1
- data/rbi/openai/models/responses/response_reasoning_item.rbi +63 -4
- data/rbi/openai/models/responses/response_reasoning_text_delta_event.rbi +83 -0
- data/rbi/openai/models/responses/{response_reasoning_summary_done_event.rbi → response_reasoning_text_done_event.rbi} +20 -20
- data/rbi/openai/models/responses/response_retrieve_params.rbi +21 -0
- data/rbi/openai/models/responses/response_stream_event.rbi +4 -2
- data/rbi/openai/models/responses/response_text_config.rbi +64 -1
- data/rbi/openai/models/responses/tool.rbi +1 -0
- data/rbi/openai/models/responses/tool_choice_allowed.rbi +124 -0
- data/rbi/openai/models/responses/tool_choice_custom.rbi +39 -0
- data/rbi/openai/models/vector_store_search_params.rbi +12 -1
- data/rbi/openai/models.rbi +6 -0
- data/rbi/openai/resources/beta/assistants.rbi +6 -8
- data/rbi/openai/resources/beta/threads/runs.rbi +8 -10
- data/rbi/openai/resources/chat/completions.rbi +44 -19
- data/rbi/openai/resources/responses.rbi +215 -41
- data/sig/openai/internal/transport/base_client.rbs +1 -1
- data/sig/openai/models/beta/assistant_update_params.rbs +12 -0
- data/sig/openai/models/chat/chat_completion_allowed_tool_choice.rbs +29 -0
- data/sig/openai/models/chat/chat_completion_allowed_tools.rbs +38 -0
- data/sig/openai/models/chat/chat_completion_assistant_message_param.rbs +6 -6
- data/sig/openai/models/chat/chat_completion_custom_tool.rbs +137 -0
- data/sig/openai/models/chat/chat_completion_function_tool.rbs +26 -0
- data/sig/openai/models/chat/chat_completion_message.rbs +6 -6
- data/sig/openai/models/chat/chat_completion_message_custom_tool_call.rbs +46 -0
- data/sig/openai/models/chat/chat_completion_message_function_tool_call.rbs +46 -0
- data/sig/openai/models/chat/chat_completion_message_tool_call.rbs +6 -35
- data/sig/openai/models/chat/chat_completion_named_tool_choice_custom.rbs +39 -0
- data/sig/openai/models/chat/chat_completion_stream_options.rbs +11 -3
- data/sig/openai/models/chat/chat_completion_tool.rbs +6 -15
- data/sig/openai/models/chat/chat_completion_tool_choice_option.rbs +2 -0
- data/sig/openai/models/chat/completion_create_params.rbs +23 -6
- data/sig/openai/models/chat_model.rbs +15 -1
- data/sig/openai/models/custom_tool_input_format.rbs +61 -0
- data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +6 -6
- data/sig/openai/models/reasoning_effort.rbs +2 -1
- data/sig/openai/models/response_format_text_grammar.rbs +15 -0
- data/sig/openai/models/response_format_text_python.rbs +13 -0
- data/sig/openai/models/responses/custom_tool.rbs +43 -0
- data/sig/openai/models/responses/response.rbs +2 -0
- data/sig/openai/models/responses/response_create_params.rbs +19 -0
- data/sig/openai/models/responses/response_custom_tool_call.rbs +44 -0
- data/sig/openai/models/responses/response_custom_tool_call_input_delta_event.rbs +42 -0
- data/sig/openai/models/responses/response_custom_tool_call_input_done_event.rbs +42 -0
- data/sig/openai/models/responses/response_custom_tool_call_output.rbs +39 -0
- data/sig/openai/models/responses/response_input_item.rbs +2 -0
- data/sig/openai/models/responses/response_output_item.rbs +1 -0
- data/sig/openai/models/responses/response_reasoning_item.rbs +21 -0
- data/sig/openai/models/responses/{response_reasoning_summary_delta_event.rbs → response_reasoning_text_delta_event.rbs} +15 -15
- data/sig/openai/models/responses/{response_reasoning_summary_done_event.rbs → response_reasoning_text_done_event.rbs} +11 -11
- data/sig/openai/models/responses/response_retrieve_params.rbs +7 -0
- data/sig/openai/models/responses/response_stream_event.rbs +4 -2
- data/sig/openai/models/responses/response_text_config.rbs +22 -3
- data/sig/openai/models/responses/tool.rbs +1 -0
- data/sig/openai/models/responses/tool_choice_allowed.rbs +43 -0
- data/sig/openai/models/responses/tool_choice_custom.rbs +17 -0
- data/sig/openai/models/vector_store_search_params.rbs +2 -1
- data/sig/openai/models.rbs +6 -0
- data/sig/openai/resources/chat/completions.rbs +4 -2
- data/sig/openai/resources/responses.rbs +32 -0
- metadata +59 -8
- data/lib/openai/models/responses/response_reasoning_summary_delta_event.rb +0 -65
- data/lib/openai/models/responses/response_reasoning_summary_done_event.rb +0 -60
- data/rbi/openai/models/responses/response_reasoning_summary_delta_event.rbi +0 -85
@@ -0,0 +1,137 @@
|
|
1
|
+
module OpenAI
|
2
|
+
module Models
|
3
|
+
class ChatCompletionCustomTool = Chat::ChatCompletionCustomTool
|
4
|
+
|
5
|
+
module Chat
|
6
|
+
type chat_completion_custom_tool =
|
7
|
+
{
|
8
|
+
custom: OpenAI::Chat::ChatCompletionCustomTool::Custom,
|
9
|
+
type: :custom
|
10
|
+
}
|
11
|
+
|
12
|
+
class ChatCompletionCustomTool < OpenAI::Internal::Type::BaseModel
|
13
|
+
attr_accessor custom: OpenAI::Chat::ChatCompletionCustomTool::Custom
|
14
|
+
|
15
|
+
attr_accessor type: :custom
|
16
|
+
|
17
|
+
def initialize: (
|
18
|
+
custom: OpenAI::Chat::ChatCompletionCustomTool::Custom,
|
19
|
+
?type: :custom
|
20
|
+
) -> void
|
21
|
+
|
22
|
+
def to_hash: -> {
|
23
|
+
custom: OpenAI::Chat::ChatCompletionCustomTool::Custom,
|
24
|
+
type: :custom
|
25
|
+
}
|
26
|
+
|
27
|
+
type custom =
|
28
|
+
{
|
29
|
+
name: String,
|
30
|
+
description: String,
|
31
|
+
format_: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_
|
32
|
+
}
|
33
|
+
|
34
|
+
class Custom < OpenAI::Internal::Type::BaseModel
|
35
|
+
attr_accessor name: String
|
36
|
+
|
37
|
+
attr_reader description: String?
|
38
|
+
|
39
|
+
def description=: (String) -> String
|
40
|
+
|
41
|
+
attr_reader format_: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_?
|
42
|
+
|
43
|
+
def format_=: (
|
44
|
+
OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_
|
45
|
+
) -> OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_
|
46
|
+
|
47
|
+
def initialize: (
|
48
|
+
name: String,
|
49
|
+
?description: String,
|
50
|
+
?format_: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_
|
51
|
+
) -> void
|
52
|
+
|
53
|
+
def to_hash: -> {
|
54
|
+
name: String,
|
55
|
+
description: String,
|
56
|
+
format_: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_
|
57
|
+
}
|
58
|
+
|
59
|
+
type format_ =
|
60
|
+
OpenAI::Chat::ChatCompletionCustomTool::Custom::Format::Text
|
61
|
+
| OpenAI::Chat::ChatCompletionCustomTool::Custom::Format::Grammar
|
62
|
+
|
63
|
+
module Format
|
64
|
+
extend OpenAI::Internal::Type::Union
|
65
|
+
|
66
|
+
type text = { type: :text }
|
67
|
+
|
68
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
69
|
+
attr_accessor type: :text
|
70
|
+
|
71
|
+
def initialize: (?type: :text) -> void
|
72
|
+
|
73
|
+
def to_hash: -> { type: :text }
|
74
|
+
end
|
75
|
+
|
76
|
+
type grammar =
|
77
|
+
{
|
78
|
+
grammar: OpenAI::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar,
|
79
|
+
type: :grammar
|
80
|
+
}
|
81
|
+
|
82
|
+
class Grammar < OpenAI::Internal::Type::BaseModel
|
83
|
+
attr_accessor grammar: OpenAI::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar
|
84
|
+
|
85
|
+
attr_accessor type: :grammar
|
86
|
+
|
87
|
+
def initialize: (
|
88
|
+
grammar: OpenAI::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar,
|
89
|
+
?type: :grammar
|
90
|
+
) -> void
|
91
|
+
|
92
|
+
def to_hash: -> {
|
93
|
+
grammar: OpenAI::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar,
|
94
|
+
type: :grammar
|
95
|
+
}
|
96
|
+
|
97
|
+
type grammar =
|
98
|
+
{
|
99
|
+
definition: String,
|
100
|
+
syntax: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar::syntax
|
101
|
+
}
|
102
|
+
|
103
|
+
class Grammar < OpenAI::Internal::Type::BaseModel
|
104
|
+
attr_accessor definition: String
|
105
|
+
|
106
|
+
attr_accessor syntax: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar::syntax
|
107
|
+
|
108
|
+
def initialize: (
|
109
|
+
definition: String,
|
110
|
+
syntax: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar::syntax
|
111
|
+
) -> void
|
112
|
+
|
113
|
+
def to_hash: -> {
|
114
|
+
definition: String,
|
115
|
+
syntax: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar::syntax
|
116
|
+
}
|
117
|
+
|
118
|
+
type syntax = :lark | :regex
|
119
|
+
|
120
|
+
module Syntax
|
121
|
+
extend OpenAI::Internal::Type::Enum
|
122
|
+
|
123
|
+
LARK: :lark
|
124
|
+
REGEX: :regex
|
125
|
+
|
126
|
+
def self?.values: -> ::Array[OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::Format::Grammar::Grammar::syntax]
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_]
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module OpenAI
|
2
|
+
module Models
|
3
|
+
class ChatCompletionFunctionTool = Chat::ChatCompletionFunctionTool
|
4
|
+
|
5
|
+
module Chat
|
6
|
+
type chat_completion_function_tool =
|
7
|
+
{ function: OpenAI::FunctionDefinition, type: :function }
|
8
|
+
|
9
|
+
class ChatCompletionFunctionTool < OpenAI::Internal::Type::BaseModel
|
10
|
+
attr_accessor function: OpenAI::FunctionDefinition
|
11
|
+
|
12
|
+
attr_accessor type: :function
|
13
|
+
|
14
|
+
def initialize: (
|
15
|
+
function: OpenAI::FunctionDefinition,
|
16
|
+
?type: :function
|
17
|
+
) -> void
|
18
|
+
|
19
|
+
def to_hash: -> {
|
20
|
+
function: OpenAI::FunctionDefinition,
|
21
|
+
type: :function
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -11,7 +11,7 @@ module OpenAI
|
|
11
11
|
annotations: ::Array[OpenAI::Chat::ChatCompletionMessage::Annotation],
|
12
12
|
audio: OpenAI::Chat::ChatCompletionAudio?,
|
13
13
|
function_call: OpenAI::Chat::ChatCompletionMessage::FunctionCall,
|
14
|
-
tool_calls: ::Array[OpenAI::Chat::
|
14
|
+
tool_calls: ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
15
15
|
}
|
16
16
|
|
17
17
|
class ChatCompletionMessage < OpenAI::Internal::Type::BaseModel
|
@@ -35,11 +35,11 @@ module OpenAI
|
|
35
35
|
OpenAI::Chat::ChatCompletionMessage::FunctionCall
|
36
36
|
) -> OpenAI::Chat::ChatCompletionMessage::FunctionCall
|
37
37
|
|
38
|
-
attr_reader tool_calls: ::Array[OpenAI::Chat::
|
38
|
+
attr_reader tool_calls: ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]?
|
39
39
|
|
40
40
|
def tool_calls=: (
|
41
|
-
::Array[OpenAI::Chat::
|
42
|
-
) -> ::Array[OpenAI::Chat::
|
41
|
+
::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
42
|
+
) -> ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
43
43
|
|
44
44
|
def initialize: (
|
45
45
|
content: String?,
|
@@ -47,7 +47,7 @@ module OpenAI
|
|
47
47
|
?annotations: ::Array[OpenAI::Chat::ChatCompletionMessage::Annotation],
|
48
48
|
?audio: OpenAI::Chat::ChatCompletionAudio?,
|
49
49
|
?function_call: OpenAI::Chat::ChatCompletionMessage::FunctionCall,
|
50
|
-
?tool_calls: ::Array[OpenAI::Chat::
|
50
|
+
?tool_calls: ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call],
|
51
51
|
?role: :assistant
|
52
52
|
) -> void
|
53
53
|
|
@@ -58,7 +58,7 @@ module OpenAI
|
|
58
58
|
annotations: ::Array[OpenAI::Chat::ChatCompletionMessage::Annotation],
|
59
59
|
audio: OpenAI::Chat::ChatCompletionAudio?,
|
60
60
|
function_call: OpenAI::Chat::ChatCompletionMessage::FunctionCall,
|
61
|
-
tool_calls: ::Array[OpenAI::Chat::
|
61
|
+
tool_calls: ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
62
62
|
}
|
63
63
|
|
64
64
|
type annotation =
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module OpenAI
|
2
|
+
module Models
|
3
|
+
class ChatCompletionMessageCustomToolCall = Chat::ChatCompletionMessageCustomToolCall
|
4
|
+
|
5
|
+
module Chat
|
6
|
+
type chat_completion_message_custom_tool_call =
|
7
|
+
{
|
8
|
+
id: String,
|
9
|
+
custom: OpenAI::Chat::ChatCompletionMessageCustomToolCall::Custom,
|
10
|
+
type: :custom
|
11
|
+
}
|
12
|
+
|
13
|
+
class ChatCompletionMessageCustomToolCall < OpenAI::Internal::Type::BaseModel
|
14
|
+
attr_accessor id: String
|
15
|
+
|
16
|
+
attr_accessor custom: OpenAI::Chat::ChatCompletionMessageCustomToolCall::Custom
|
17
|
+
|
18
|
+
attr_accessor type: :custom
|
19
|
+
|
20
|
+
def initialize: (
|
21
|
+
id: String,
|
22
|
+
custom: OpenAI::Chat::ChatCompletionMessageCustomToolCall::Custom,
|
23
|
+
?type: :custom
|
24
|
+
) -> void
|
25
|
+
|
26
|
+
def to_hash: -> {
|
27
|
+
id: String,
|
28
|
+
custom: OpenAI::Chat::ChatCompletionMessageCustomToolCall::Custom,
|
29
|
+
type: :custom
|
30
|
+
}
|
31
|
+
|
32
|
+
type custom = { input: String, name: String }
|
33
|
+
|
34
|
+
class Custom < OpenAI::Internal::Type::BaseModel
|
35
|
+
attr_accessor input: String
|
36
|
+
|
37
|
+
attr_accessor name: String
|
38
|
+
|
39
|
+
def initialize: (input: String, name: String) -> void
|
40
|
+
|
41
|
+
def to_hash: -> { input: String, name: String }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module OpenAI
|
2
|
+
module Models
|
3
|
+
class ChatCompletionMessageFunctionToolCall = Chat::ChatCompletionMessageFunctionToolCall
|
4
|
+
|
5
|
+
module Chat
|
6
|
+
type chat_completion_message_function_tool_call =
|
7
|
+
{
|
8
|
+
id: String,
|
9
|
+
function: OpenAI::Chat::ChatCompletionMessageFunctionToolCall::Function,
|
10
|
+
type: :function
|
11
|
+
}
|
12
|
+
|
13
|
+
class ChatCompletionMessageFunctionToolCall < OpenAI::Internal::Type::BaseModel
|
14
|
+
attr_accessor id: String
|
15
|
+
|
16
|
+
attr_accessor function: OpenAI::Chat::ChatCompletionMessageFunctionToolCall::Function
|
17
|
+
|
18
|
+
attr_accessor type: :function
|
19
|
+
|
20
|
+
def initialize: (
|
21
|
+
id: String,
|
22
|
+
function: OpenAI::Chat::ChatCompletionMessageFunctionToolCall::Function,
|
23
|
+
?type: :function
|
24
|
+
) -> void
|
25
|
+
|
26
|
+
def to_hash: -> {
|
27
|
+
id: String,
|
28
|
+
function: OpenAI::Chat::ChatCompletionMessageFunctionToolCall::Function,
|
29
|
+
type: :function
|
30
|
+
}
|
31
|
+
|
32
|
+
type function = { arguments: String, name: String }
|
33
|
+
|
34
|
+
class Function < OpenAI::Internal::Type::BaseModel
|
35
|
+
attr_accessor arguments: String
|
36
|
+
|
37
|
+
attr_accessor name: String
|
38
|
+
|
39
|
+
def initialize: (arguments: String, name: String) -> void
|
40
|
+
|
41
|
+
def to_hash: -> { arguments: String, name: String }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -1,45 +1,16 @@
|
|
1
1
|
module OpenAI
|
2
2
|
module Models
|
3
|
-
|
3
|
+
module ChatCompletionMessageToolCall = Chat::ChatCompletionMessageToolCall
|
4
4
|
|
5
5
|
module Chat
|
6
6
|
type chat_completion_message_tool_call =
|
7
|
-
|
8
|
-
|
9
|
-
function: OpenAI::Chat::ChatCompletionMessageToolCall::Function,
|
10
|
-
type: :function
|
11
|
-
}
|
7
|
+
OpenAI::Chat::ChatCompletionMessageFunctionToolCall
|
8
|
+
| OpenAI::Chat::ChatCompletionMessageCustomToolCall
|
12
9
|
|
13
|
-
|
14
|
-
|
10
|
+
module ChatCompletionMessageToolCall
|
11
|
+
extend OpenAI::Internal::Type::Union
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
attr_accessor type: :function
|
19
|
-
|
20
|
-
def initialize: (
|
21
|
-
id: String,
|
22
|
-
function: OpenAI::Chat::ChatCompletionMessageToolCall::Function,
|
23
|
-
?type: :function
|
24
|
-
) -> void
|
25
|
-
|
26
|
-
def to_hash: -> {
|
27
|
-
id: String,
|
28
|
-
function: OpenAI::Chat::ChatCompletionMessageToolCall::Function,
|
29
|
-
type: :function
|
30
|
-
}
|
31
|
-
|
32
|
-
type function = { arguments: String, name: String }
|
33
|
-
|
34
|
-
class Function < OpenAI::Internal::Type::BaseModel
|
35
|
-
attr_accessor arguments: String
|
36
|
-
|
37
|
-
attr_accessor name: String
|
38
|
-
|
39
|
-
def initialize: (arguments: String, name: String) -> void
|
40
|
-
|
41
|
-
def to_hash: -> { arguments: String, name: String }
|
42
|
-
end
|
13
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
43
14
|
end
|
44
15
|
end
|
45
16
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module OpenAI
|
2
|
+
module Models
|
3
|
+
class ChatCompletionNamedToolChoiceCustom = Chat::ChatCompletionNamedToolChoiceCustom
|
4
|
+
|
5
|
+
module Chat
|
6
|
+
type chat_completion_named_tool_choice_custom =
|
7
|
+
{
|
8
|
+
custom: OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom,
|
9
|
+
type: :custom
|
10
|
+
}
|
11
|
+
|
12
|
+
class ChatCompletionNamedToolChoiceCustom < OpenAI::Internal::Type::BaseModel
|
13
|
+
attr_accessor custom: OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom
|
14
|
+
|
15
|
+
attr_accessor type: :custom
|
16
|
+
|
17
|
+
def initialize: (
|
18
|
+
custom: OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom,
|
19
|
+
?type: :custom
|
20
|
+
) -> void
|
21
|
+
|
22
|
+
def to_hash: -> {
|
23
|
+
custom: OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom,
|
24
|
+
type: :custom
|
25
|
+
}
|
26
|
+
|
27
|
+
type custom = { name: String }
|
28
|
+
|
29
|
+
class Custom < OpenAI::Internal::Type::BaseModel
|
30
|
+
attr_accessor name: String
|
31
|
+
|
32
|
+
def initialize: (name: String) -> void
|
33
|
+
|
34
|
+
def to_hash: -> { name: String }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -3,16 +3,24 @@ module OpenAI
|
|
3
3
|
class ChatCompletionStreamOptions = Chat::ChatCompletionStreamOptions
|
4
4
|
|
5
5
|
module Chat
|
6
|
-
type chat_completion_stream_options =
|
6
|
+
type chat_completion_stream_options =
|
7
|
+
{ include_obfuscation: bool, include_usage: bool }
|
7
8
|
|
8
9
|
class ChatCompletionStreamOptions < OpenAI::Internal::Type::BaseModel
|
10
|
+
attr_reader include_obfuscation: bool?
|
11
|
+
|
12
|
+
def include_obfuscation=: (bool) -> bool
|
13
|
+
|
9
14
|
attr_reader include_usage: bool?
|
10
15
|
|
11
16
|
def include_usage=: (bool) -> bool
|
12
17
|
|
13
|
-
def initialize: (
|
18
|
+
def initialize: (
|
19
|
+
?include_obfuscation: bool,
|
20
|
+
?include_usage: bool
|
21
|
+
) -> void
|
14
22
|
|
15
|
-
def to_hash: -> { include_usage: bool }
|
23
|
+
def to_hash: -> { include_obfuscation: bool, include_usage: bool }
|
16
24
|
end
|
17
25
|
end
|
18
26
|
end
|
@@ -1,25 +1,16 @@
|
|
1
1
|
module OpenAI
|
2
2
|
module Models
|
3
|
-
|
3
|
+
module ChatCompletionTool = Chat::ChatCompletionTool
|
4
4
|
|
5
5
|
module Chat
|
6
6
|
type chat_completion_tool =
|
7
|
-
|
7
|
+
OpenAI::Chat::ChatCompletionFunctionTool
|
8
|
+
| OpenAI::Chat::ChatCompletionCustomTool
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
module ChatCompletionTool
|
11
|
+
extend OpenAI::Internal::Type::Union
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
def initialize: (
|
15
|
-
function: OpenAI::FunctionDefinition,
|
16
|
-
?type: :function
|
17
|
-
) -> void
|
18
|
-
|
19
|
-
def to_hash: -> {
|
20
|
-
function: OpenAI::FunctionDefinition,
|
21
|
-
type: :function
|
22
|
-
}
|
13
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::chat_completion_tool]
|
23
14
|
end
|
24
15
|
end
|
25
16
|
end
|
@@ -5,7 +5,9 @@ module OpenAI
|
|
5
5
|
module Chat
|
6
6
|
type chat_completion_tool_choice_option =
|
7
7
|
OpenAI::Models::Chat::ChatCompletionToolChoiceOption::auto
|
8
|
+
| OpenAI::Chat::ChatCompletionAllowedToolChoice
|
8
9
|
| OpenAI::Chat::ChatCompletionNamedToolChoice
|
10
|
+
| OpenAI::Chat::ChatCompletionNamedToolChoiceCustom
|
9
11
|
|
10
12
|
module ChatCompletionToolChoiceOption
|
11
13
|
extend OpenAI::Internal::Type::Union
|
@@ -30,10 +30,11 @@ module OpenAI
|
|
30
30
|
stream_options: OpenAI::Chat::ChatCompletionStreamOptions?,
|
31
31
|
temperature: Float?,
|
32
32
|
tool_choice: OpenAI::Models::Chat::chat_completion_tool_choice_option,
|
33
|
-
tools: ::Array[OpenAI::Chat::
|
33
|
+
tools: ::Array[OpenAI::Models::Chat::chat_completion_tool],
|
34
34
|
top_logprobs: Integer?,
|
35
35
|
top_p: Float?,
|
36
36
|
user: String,
|
37
|
+
verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?,
|
37
38
|
web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions
|
38
39
|
}
|
39
40
|
& OpenAI::Internal::Type::request_parameters
|
@@ -118,11 +119,11 @@ module OpenAI
|
|
118
119
|
OpenAI::Models::Chat::chat_completion_tool_choice_option
|
119
120
|
) -> OpenAI::Models::Chat::chat_completion_tool_choice_option
|
120
121
|
|
121
|
-
attr_reader tools: ::Array[OpenAI::Chat::
|
122
|
+
attr_reader tools: ::Array[OpenAI::Models::Chat::chat_completion_tool]?
|
122
123
|
|
123
124
|
def tools=: (
|
124
|
-
::Array[OpenAI::Chat::
|
125
|
-
) -> ::Array[OpenAI::Chat::
|
125
|
+
::Array[OpenAI::Models::Chat::chat_completion_tool]
|
126
|
+
) -> ::Array[OpenAI::Models::Chat::chat_completion_tool]
|
126
127
|
|
127
128
|
attr_accessor top_logprobs: Integer?
|
128
129
|
|
@@ -132,6 +133,8 @@ module OpenAI
|
|
132
133
|
|
133
134
|
def user=: (String) -> String
|
134
135
|
|
136
|
+
attr_accessor verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?
|
137
|
+
|
135
138
|
attr_reader web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions?
|
136
139
|
|
137
140
|
def web_search_options=: (
|
@@ -166,10 +169,11 @@ module OpenAI
|
|
166
169
|
?stream_options: OpenAI::Chat::ChatCompletionStreamOptions?,
|
167
170
|
?temperature: Float?,
|
168
171
|
?tool_choice: OpenAI::Models::Chat::chat_completion_tool_choice_option,
|
169
|
-
?tools: ::Array[OpenAI::Chat::
|
172
|
+
?tools: ::Array[OpenAI::Models::Chat::chat_completion_tool],
|
170
173
|
?top_logprobs: Integer?,
|
171
174
|
?top_p: Float?,
|
172
175
|
?user: String,
|
176
|
+
?verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?,
|
173
177
|
?web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions,
|
174
178
|
?request_options: OpenAI::request_opts
|
175
179
|
) -> void
|
@@ -202,10 +206,11 @@ module OpenAI
|
|
202
206
|
stream_options: OpenAI::Chat::ChatCompletionStreamOptions?,
|
203
207
|
temperature: Float?,
|
204
208
|
tool_choice: OpenAI::Models::Chat::chat_completion_tool_choice_option,
|
205
|
-
tools: ::Array[OpenAI::Chat::
|
209
|
+
tools: ::Array[OpenAI::Models::Chat::chat_completion_tool],
|
206
210
|
top_logprobs: Integer?,
|
207
211
|
top_p: Float?,
|
208
212
|
user: String,
|
213
|
+
verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?,
|
209
214
|
web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions,
|
210
215
|
request_options: OpenAI::RequestOptions
|
211
216
|
}
|
@@ -318,6 +323,18 @@ module OpenAI
|
|
318
323
|
StringArray: OpenAI::Internal::Type::Converter
|
319
324
|
end
|
320
325
|
|
326
|
+
type verbosity = :low | :medium | :high
|
327
|
+
|
328
|
+
module Verbosity
|
329
|
+
extend OpenAI::Internal::Type::Enum
|
330
|
+
|
331
|
+
LOW: :low
|
332
|
+
MEDIUM: :medium
|
333
|
+
HIGH: :high
|
334
|
+
|
335
|
+
def self?.values: -> ::Array[OpenAI::Models::Chat::CompletionCreateParams::verbosity]
|
336
|
+
end
|
337
|
+
|
321
338
|
type web_search_options =
|
322
339
|
{
|
323
340
|
search_context_size: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size,
|
@@ -1,7 +1,14 @@
|
|
1
1
|
module OpenAI
|
2
2
|
module Models
|
3
3
|
type chat_model =
|
4
|
-
:"gpt-
|
4
|
+
:"gpt-5"
|
5
|
+
| :"gpt-5-mini"
|
6
|
+
| :"gpt-5-nano"
|
7
|
+
| :"gpt-5-2025-08-07"
|
8
|
+
| :"gpt-5-mini-2025-08-07"
|
9
|
+
| :"gpt-5-nano-2025-08-07"
|
10
|
+
| :"gpt-5-chat-latest"
|
11
|
+
| :"gpt-4.1"
|
5
12
|
| :"gpt-4.1-mini"
|
6
13
|
| :"gpt-4.1-nano"
|
7
14
|
| :"gpt-4.1-2025-04-14"
|
@@ -60,6 +67,13 @@ module OpenAI
|
|
60
67
|
module ChatModel
|
61
68
|
extend OpenAI::Internal::Type::Enum
|
62
69
|
|
70
|
+
GPT_5: :"gpt-5"
|
71
|
+
GPT_5_MINI: :"gpt-5-mini"
|
72
|
+
GPT_5_NANO: :"gpt-5-nano"
|
73
|
+
GPT_5_2025_08_07: :"gpt-5-2025-08-07"
|
74
|
+
GPT_5_MINI_2025_08_07: :"gpt-5-mini-2025-08-07"
|
75
|
+
GPT_5_NANO_2025_08_07: :"gpt-5-nano-2025-08-07"
|
76
|
+
GPT_5_CHAT_LATEST: :"gpt-5-chat-latest"
|
63
77
|
GPT_4_1: :"gpt-4.1"
|
64
78
|
GPT_4_1_MINI: :"gpt-4.1-mini"
|
65
79
|
GPT_4_1_NANO: :"gpt-4.1-nano"
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module OpenAI
|
2
|
+
module Models
|
3
|
+
type custom_tool_input_format =
|
4
|
+
OpenAI::CustomToolInputFormat::Text
|
5
|
+
| OpenAI::CustomToolInputFormat::Grammar
|
6
|
+
|
7
|
+
module CustomToolInputFormat
|
8
|
+
extend OpenAI::Internal::Type::Union
|
9
|
+
|
10
|
+
type text = { type: :text }
|
11
|
+
|
12
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
13
|
+
attr_accessor type: :text
|
14
|
+
|
15
|
+
def initialize: (?type: :text) -> void
|
16
|
+
|
17
|
+
def to_hash: -> { type: :text }
|
18
|
+
end
|
19
|
+
|
20
|
+
type grammar =
|
21
|
+
{
|
22
|
+
definition: String,
|
23
|
+
syntax: OpenAI::Models::CustomToolInputFormat::Grammar::syntax,
|
24
|
+
type: :grammar
|
25
|
+
}
|
26
|
+
|
27
|
+
class Grammar < OpenAI::Internal::Type::BaseModel
|
28
|
+
attr_accessor definition: String
|
29
|
+
|
30
|
+
attr_accessor syntax: OpenAI::Models::CustomToolInputFormat::Grammar::syntax
|
31
|
+
|
32
|
+
attr_accessor type: :grammar
|
33
|
+
|
34
|
+
def initialize: (
|
35
|
+
definition: String,
|
36
|
+
syntax: OpenAI::Models::CustomToolInputFormat::Grammar::syntax,
|
37
|
+
?type: :grammar
|
38
|
+
) -> void
|
39
|
+
|
40
|
+
def to_hash: -> {
|
41
|
+
definition: String,
|
42
|
+
syntax: OpenAI::Models::CustomToolInputFormat::Grammar::syntax,
|
43
|
+
type: :grammar
|
44
|
+
}
|
45
|
+
|
46
|
+
type syntax = :lark | :regex
|
47
|
+
|
48
|
+
module Syntax
|
49
|
+
extend OpenAI::Internal::Type::Enum
|
50
|
+
|
51
|
+
LARK: :lark
|
52
|
+
REGEX: :regex
|
53
|
+
|
54
|
+
def self?.values: -> ::Array[OpenAI::Models::CustomToolInputFormat::Grammar::syntax]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def self?.variants: -> ::Array[OpenAI::Models::custom_tool_input_format]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -335,7 +335,7 @@ module OpenAI
|
|
335
335
|
response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
|
336
336
|
seed: Integer,
|
337
337
|
temperature: Float,
|
338
|
-
tools: ::Array[OpenAI::Chat::
|
338
|
+
tools: ::Array[OpenAI::Chat::ChatCompletionFunctionTool],
|
339
339
|
top_p: Float
|
340
340
|
}
|
341
341
|
|
@@ -358,11 +358,11 @@ module OpenAI
|
|
358
358
|
|
359
359
|
def temperature=: (Float) -> Float
|
360
360
|
|
361
|
-
attr_reader tools: ::Array[OpenAI::Chat::
|
361
|
+
attr_reader tools: ::Array[OpenAI::Chat::ChatCompletionFunctionTool]?
|
362
362
|
|
363
363
|
def tools=: (
|
364
|
-
::Array[OpenAI::Chat::
|
365
|
-
) -> ::Array[OpenAI::Chat::
|
364
|
+
::Array[OpenAI::Chat::ChatCompletionFunctionTool]
|
365
|
+
) -> ::Array[OpenAI::Chat::ChatCompletionFunctionTool]
|
366
366
|
|
367
367
|
attr_reader top_p: Float?
|
368
368
|
|
@@ -373,7 +373,7 @@ module OpenAI
|
|
373
373
|
?response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
|
374
374
|
?seed: Integer,
|
375
375
|
?temperature: Float,
|
376
|
-
?tools: ::Array[OpenAI::Chat::
|
376
|
+
?tools: ::Array[OpenAI::Chat::ChatCompletionFunctionTool],
|
377
377
|
?top_p: Float
|
378
378
|
) -> void
|
379
379
|
|
@@ -382,7 +382,7 @@ module OpenAI
|
|
382
382
|
response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
|
383
383
|
seed: Integer,
|
384
384
|
temperature: Float,
|
385
|
-
tools: ::Array[OpenAI::Chat::
|
385
|
+
tools: ::Array[OpenAI::Chat::ChatCompletionFunctionTool],
|
386
386
|
top_p: Float
|
387
387
|
}
|
388
388
|
|