openai 0.15.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 +47 -0
- data/README.md +14 -20
- data/lib/openai/helpers/structured_output/json_schema_converter.rb +20 -21
- data/lib/openai/helpers/structured_output/union_of.rb +11 -1
- 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_store_message.rb +32 -1
- 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 +65 -16
- 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 +70 -16
- data/lib/openai/models/responses/response_create_params.rb +78 -14
- 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 +26 -12
- data/lib/openai/resources/responses.rb +77 -36
- 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_store_message.rbi +68 -3
- 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 +150 -31
- 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 +59 -11
- data/rbi/openai/models/responses/response_create_params.rbi +138 -13
- 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 +78 -25
- data/rbi/openai/resources/responses.rbi +249 -47
- 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_store_message.rbs +29 -3
- 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 +37 -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 +16 -0
- data/sig/openai/models/responses/response_create_params.rbs +33 -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 +8 -2
- data/sig/openai/resources/responses.rbs +36 -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
@@ -11,7 +11,7 @@ module OpenAI
|
|
11
11
|
function_call: OpenAI::Chat::ChatCompletionAssistantMessageParam::FunctionCall?,
|
12
12
|
name: String,
|
13
13
|
refusal: String?,
|
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 ChatCompletionAssistantMessageParam < OpenAI::Internal::Type::BaseModel
|
@@ -29,11 +29,11 @@ module OpenAI
|
|
29
29
|
|
30
30
|
attr_accessor refusal: String?
|
31
31
|
|
32
|
-
attr_reader tool_calls: ::Array[OpenAI::Chat::
|
32
|
+
attr_reader tool_calls: ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]?
|
33
33
|
|
34
34
|
def tool_calls=: (
|
35
|
-
::Array[OpenAI::Chat::
|
36
|
-
) -> ::Array[OpenAI::Chat::
|
35
|
+
::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
36
|
+
) -> ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
37
37
|
|
38
38
|
def initialize: (
|
39
39
|
?audio: OpenAI::Chat::ChatCompletionAssistantMessageParam::Audio?,
|
@@ -41,7 +41,7 @@ module OpenAI
|
|
41
41
|
?function_call: OpenAI::Chat::ChatCompletionAssistantMessageParam::FunctionCall?,
|
42
42
|
?name: String,
|
43
43
|
?refusal: String?,
|
44
|
-
?tool_calls: ::Array[OpenAI::Chat::
|
44
|
+
?tool_calls: ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call],
|
45
45
|
?role: :assistant
|
46
46
|
) -> void
|
47
47
|
|
@@ -52,7 +52,7 @@ module OpenAI
|
|
52
52
|
function_call: OpenAI::Chat::ChatCompletionAssistantMessageParam::FunctionCall?,
|
53
53
|
name: String,
|
54
54
|
refusal: String?,
|
55
|
-
tool_calls: ::Array[OpenAI::Chat::
|
55
|
+
tool_calls: ::Array[OpenAI::Models::Chat::chat_completion_message_tool_call]
|
56
56
|
}
|
57
57
|
|
58
58
|
type audio = { id: String }
|
@@ -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,42 @@ module OpenAI
|
|
3
3
|
class ChatCompletionStoreMessage = Chat::ChatCompletionStoreMessage
|
4
4
|
|
5
5
|
module Chat
|
6
|
-
type chat_completion_store_message =
|
6
|
+
type chat_completion_store_message =
|
7
|
+
{
|
8
|
+
id: String,
|
9
|
+
content_parts: ::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]?
|
10
|
+
}
|
7
11
|
|
8
12
|
class ChatCompletionStoreMessage < OpenAI::Models::Chat::ChatCompletionMessage
|
9
13
|
def id: -> String
|
10
14
|
|
11
15
|
def id=: (String _) -> String
|
12
16
|
|
13
|
-
def
|
17
|
+
def content_parts: -> ::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]?
|
14
18
|
|
15
|
-
def
|
19
|
+
def content_parts=: (
|
20
|
+
::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]? _
|
21
|
+
) -> ::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]?
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
id: String,
|
25
|
+
?content_parts: ::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]?
|
26
|
+
) -> void
|
27
|
+
|
28
|
+
def to_hash: -> {
|
29
|
+
id: String,
|
30
|
+
content_parts: ::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]?
|
31
|
+
}
|
32
|
+
|
33
|
+
type content_part =
|
34
|
+
OpenAI::Chat::ChatCompletionContentPartText
|
35
|
+
| OpenAI::Chat::ChatCompletionContentPartImage
|
36
|
+
|
37
|
+
module ContentPart
|
38
|
+
extend OpenAI::Internal::Type::Union
|
39
|
+
|
40
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]
|
41
|
+
end
|
16
42
|
end
|
17
43
|
end
|
18
44
|
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
|
@@ -19,8 +19,10 @@ module OpenAI
|
|
19
19
|
parallel_tool_calls: bool,
|
20
20
|
prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
21
21
|
presence_penalty: Float?,
|
22
|
+
prompt_cache_key: String,
|
22
23
|
reasoning_effort: OpenAI::Models::reasoning_effort?,
|
23
24
|
response_format: OpenAI::Models::Chat::CompletionCreateParams::response_format,
|
25
|
+
safety_identifier: String,
|
24
26
|
seed: Integer?,
|
25
27
|
service_tier: OpenAI::Models::Chat::CompletionCreateParams::service_tier?,
|
26
28
|
stop: OpenAI::Models::Chat::CompletionCreateParams::stop?,
|
@@ -28,10 +30,11 @@ module OpenAI
|
|
28
30
|
stream_options: OpenAI::Chat::ChatCompletionStreamOptions?,
|
29
31
|
temperature: Float?,
|
30
32
|
tool_choice: OpenAI::Models::Chat::chat_completion_tool_choice_option,
|
31
|
-
tools: ::Array[OpenAI::Chat::
|
33
|
+
tools: ::Array[OpenAI::Models::Chat::chat_completion_tool],
|
32
34
|
top_logprobs: Integer?,
|
33
35
|
top_p: Float?,
|
34
36
|
user: String,
|
37
|
+
verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?,
|
35
38
|
web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions
|
36
39
|
}
|
37
40
|
& OpenAI::Internal::Type::request_parameters
|
@@ -82,6 +85,10 @@ module OpenAI
|
|
82
85
|
|
83
86
|
attr_accessor presence_penalty: Float?
|
84
87
|
|
88
|
+
attr_reader prompt_cache_key: String?
|
89
|
+
|
90
|
+
def prompt_cache_key=: (String) -> String
|
91
|
+
|
85
92
|
attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort?
|
86
93
|
|
87
94
|
attr_reader response_format: OpenAI::Models::Chat::CompletionCreateParams::response_format?
|
@@ -90,6 +97,10 @@ module OpenAI
|
|
90
97
|
OpenAI::Models::Chat::CompletionCreateParams::response_format
|
91
98
|
) -> OpenAI::Models::Chat::CompletionCreateParams::response_format
|
92
99
|
|
100
|
+
attr_reader safety_identifier: String?
|
101
|
+
|
102
|
+
def safety_identifier=: (String) -> String
|
103
|
+
|
93
104
|
attr_accessor seed: Integer?
|
94
105
|
|
95
106
|
attr_accessor service_tier: OpenAI::Models::Chat::CompletionCreateParams::service_tier?
|
@@ -108,11 +119,11 @@ module OpenAI
|
|
108
119
|
OpenAI::Models::Chat::chat_completion_tool_choice_option
|
109
120
|
) -> OpenAI::Models::Chat::chat_completion_tool_choice_option
|
110
121
|
|
111
|
-
attr_reader tools: ::Array[OpenAI::Chat::
|
122
|
+
attr_reader tools: ::Array[OpenAI::Models::Chat::chat_completion_tool]?
|
112
123
|
|
113
124
|
def tools=: (
|
114
|
-
::Array[OpenAI::Chat::
|
115
|
-
) -> ::Array[OpenAI::Chat::
|
125
|
+
::Array[OpenAI::Models::Chat::chat_completion_tool]
|
126
|
+
) -> ::Array[OpenAI::Models::Chat::chat_completion_tool]
|
116
127
|
|
117
128
|
attr_accessor top_logprobs: Integer?
|
118
129
|
|
@@ -122,6 +133,8 @@ module OpenAI
|
|
122
133
|
|
123
134
|
def user=: (String) -> String
|
124
135
|
|
136
|
+
attr_accessor verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?
|
137
|
+
|
125
138
|
attr_reader web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions?
|
126
139
|
|
127
140
|
def web_search_options=: (
|
@@ -145,8 +158,10 @@ module OpenAI
|
|
145
158
|
?parallel_tool_calls: bool,
|
146
159
|
?prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
147
160
|
?presence_penalty: Float?,
|
161
|
+
?prompt_cache_key: String,
|
148
162
|
?reasoning_effort: OpenAI::Models::reasoning_effort?,
|
149
163
|
?response_format: OpenAI::Models::Chat::CompletionCreateParams::response_format,
|
164
|
+
?safety_identifier: String,
|
150
165
|
?seed: Integer?,
|
151
166
|
?service_tier: OpenAI::Models::Chat::CompletionCreateParams::service_tier?,
|
152
167
|
?stop: OpenAI::Models::Chat::CompletionCreateParams::stop?,
|
@@ -154,10 +169,11 @@ module OpenAI
|
|
154
169
|
?stream_options: OpenAI::Chat::ChatCompletionStreamOptions?,
|
155
170
|
?temperature: Float?,
|
156
171
|
?tool_choice: OpenAI::Models::Chat::chat_completion_tool_choice_option,
|
157
|
-
?tools: ::Array[OpenAI::Chat::
|
172
|
+
?tools: ::Array[OpenAI::Models::Chat::chat_completion_tool],
|
158
173
|
?top_logprobs: Integer?,
|
159
174
|
?top_p: Float?,
|
160
175
|
?user: String,
|
176
|
+
?verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?,
|
161
177
|
?web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions,
|
162
178
|
?request_options: OpenAI::request_opts
|
163
179
|
) -> void
|
@@ -179,8 +195,10 @@ module OpenAI
|
|
179
195
|
parallel_tool_calls: bool,
|
180
196
|
prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
181
197
|
presence_penalty: Float?,
|
198
|
+
prompt_cache_key: String,
|
182
199
|
reasoning_effort: OpenAI::Models::reasoning_effort?,
|
183
200
|
response_format: OpenAI::Models::Chat::CompletionCreateParams::response_format,
|
201
|
+
safety_identifier: String,
|
184
202
|
seed: Integer?,
|
185
203
|
service_tier: OpenAI::Models::Chat::CompletionCreateParams::service_tier?,
|
186
204
|
stop: OpenAI::Models::Chat::CompletionCreateParams::stop?,
|
@@ -188,10 +206,11 @@ module OpenAI
|
|
188
206
|
stream_options: OpenAI::Chat::ChatCompletionStreamOptions?,
|
189
207
|
temperature: Float?,
|
190
208
|
tool_choice: OpenAI::Models::Chat::chat_completion_tool_choice_option,
|
191
|
-
tools: ::Array[OpenAI::Chat::
|
209
|
+
tools: ::Array[OpenAI::Models::Chat::chat_completion_tool],
|
192
210
|
top_logprobs: Integer?,
|
193
211
|
top_p: Float?,
|
194
212
|
user: String,
|
213
|
+
verbosity: OpenAI::Models::Chat::CompletionCreateParams::verbosity?,
|
195
214
|
web_search_options: OpenAI::Chat::CompletionCreateParams::WebSearchOptions,
|
196
215
|
request_options: OpenAI::RequestOptions
|
197
216
|
}
|
@@ -304,6 +323,18 @@ module OpenAI
|
|
304
323
|
StringArray: OpenAI::Internal::Type::Converter
|
305
324
|
end
|
306
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
|
+
|
307
338
|
type web_search_options =
|
308
339
|
{
|
309
340
|
search_context_size: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::search_context_size,
|