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
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Responses
|
6
|
-
class ResponseReasoningSummaryDeltaEvent < OpenAI::Internal::Type::BaseModel
|
7
|
-
# @!attribute delta
|
8
|
-
# The partial update to the reasoning summary content.
|
9
|
-
#
|
10
|
-
# @return [Object]
|
11
|
-
required :delta, OpenAI::Internal::Type::Unknown
|
12
|
-
|
13
|
-
# @!attribute item_id
|
14
|
-
# The unique identifier of the item for which the reasoning summary is being
|
15
|
-
# updated.
|
16
|
-
#
|
17
|
-
# @return [String]
|
18
|
-
required :item_id, String
|
19
|
-
|
20
|
-
# @!attribute output_index
|
21
|
-
# The index of the output item in the response's output array.
|
22
|
-
#
|
23
|
-
# @return [Integer]
|
24
|
-
required :output_index, Integer
|
25
|
-
|
26
|
-
# @!attribute sequence_number
|
27
|
-
# The sequence number of this event.
|
28
|
-
#
|
29
|
-
# @return [Integer]
|
30
|
-
required :sequence_number, Integer
|
31
|
-
|
32
|
-
# @!attribute summary_index
|
33
|
-
# The index of the summary part within the output item.
|
34
|
-
#
|
35
|
-
# @return [Integer]
|
36
|
-
required :summary_index, Integer
|
37
|
-
|
38
|
-
# @!attribute type
|
39
|
-
# The type of the event. Always 'response.reasoning_summary.delta'.
|
40
|
-
#
|
41
|
-
# @return [Symbol, :"response.reasoning_summary.delta"]
|
42
|
-
required :type, const: :"response.reasoning_summary.delta"
|
43
|
-
|
44
|
-
# @!method initialize(delta:, item_id:, output_index:, sequence_number:, summary_index:, type: :"response.reasoning_summary.delta")
|
45
|
-
# Some parameter documentations has been truncated, see
|
46
|
-
# {OpenAI::Models::Responses::ResponseReasoningSummaryDeltaEvent} for more
|
47
|
-
# details.
|
48
|
-
#
|
49
|
-
# Emitted when there is a delta (partial update) to the reasoning summary content.
|
50
|
-
#
|
51
|
-
# @param delta [Object] The partial update to the reasoning summary content.
|
52
|
-
#
|
53
|
-
# @param item_id [String] The unique identifier of the item for which the reasoning summary is being updat
|
54
|
-
#
|
55
|
-
# @param output_index [Integer] The index of the output item in the response's output array.
|
56
|
-
#
|
57
|
-
# @param sequence_number [Integer] The sequence number of this event.
|
58
|
-
#
|
59
|
-
# @param summary_index [Integer] The index of the summary part within the output item.
|
60
|
-
#
|
61
|
-
# @param type [Symbol, :"response.reasoning_summary.delta"] The type of the event. Always 'response.reasoning_summary.delta'.
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Responses
|
6
|
-
class ResponseReasoningSummaryDoneEvent < OpenAI::Internal::Type::BaseModel
|
7
|
-
# @!attribute item_id
|
8
|
-
# The unique identifier of the item for which the reasoning summary is finalized.
|
9
|
-
#
|
10
|
-
# @return [String]
|
11
|
-
required :item_id, String
|
12
|
-
|
13
|
-
# @!attribute output_index
|
14
|
-
# The index of the output item in the response's output array.
|
15
|
-
#
|
16
|
-
# @return [Integer]
|
17
|
-
required :output_index, Integer
|
18
|
-
|
19
|
-
# @!attribute sequence_number
|
20
|
-
# The sequence number of this event.
|
21
|
-
#
|
22
|
-
# @return [Integer]
|
23
|
-
required :sequence_number, Integer
|
24
|
-
|
25
|
-
# @!attribute summary_index
|
26
|
-
# The index of the summary part within the output item.
|
27
|
-
#
|
28
|
-
# @return [Integer]
|
29
|
-
required :summary_index, Integer
|
30
|
-
|
31
|
-
# @!attribute text
|
32
|
-
# The finalized reasoning summary text.
|
33
|
-
#
|
34
|
-
# @return [String]
|
35
|
-
required :text, String
|
36
|
-
|
37
|
-
# @!attribute type
|
38
|
-
# The type of the event. Always 'response.reasoning_summary.done'.
|
39
|
-
#
|
40
|
-
# @return [Symbol, :"response.reasoning_summary.done"]
|
41
|
-
required :type, const: :"response.reasoning_summary.done"
|
42
|
-
|
43
|
-
# @!method initialize(item_id:, output_index:, sequence_number:, summary_index:, text:, type: :"response.reasoning_summary.done")
|
44
|
-
# Emitted when the reasoning summary content is finalized for an item.
|
45
|
-
#
|
46
|
-
# @param item_id [String] The unique identifier of the item for which the reasoning summary is finalized.
|
47
|
-
#
|
48
|
-
# @param output_index [Integer] The index of the output item in the response's output array.
|
49
|
-
#
|
50
|
-
# @param sequence_number [Integer] The sequence number of this event.
|
51
|
-
#
|
52
|
-
# @param summary_index [Integer] The index of the summary part within the output item.
|
53
|
-
#
|
54
|
-
# @param text [String] The finalized reasoning summary text.
|
55
|
-
#
|
56
|
-
# @param type [Symbol, :"response.reasoning_summary.done"] The type of the event. Always 'response.reasoning_summary.done'.
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Responses
|
6
|
-
class ResponseReasoningSummaryDeltaEvent < OpenAI::Internal::Type::BaseModel
|
7
|
-
OrHash =
|
8
|
-
T.type_alias do
|
9
|
-
T.any(
|
10
|
-
OpenAI::Responses::ResponseReasoningSummaryDeltaEvent,
|
11
|
-
OpenAI::Internal::AnyHash
|
12
|
-
)
|
13
|
-
end
|
14
|
-
|
15
|
-
# The partial update to the reasoning summary content.
|
16
|
-
sig { returns(T.anything) }
|
17
|
-
attr_accessor :delta
|
18
|
-
|
19
|
-
# The unique identifier of the item for which the reasoning summary is being
|
20
|
-
# updated.
|
21
|
-
sig { returns(String) }
|
22
|
-
attr_accessor :item_id
|
23
|
-
|
24
|
-
# The index of the output item in the response's output array.
|
25
|
-
sig { returns(Integer) }
|
26
|
-
attr_accessor :output_index
|
27
|
-
|
28
|
-
# The sequence number of this event.
|
29
|
-
sig { returns(Integer) }
|
30
|
-
attr_accessor :sequence_number
|
31
|
-
|
32
|
-
# The index of the summary part within the output item.
|
33
|
-
sig { returns(Integer) }
|
34
|
-
attr_accessor :summary_index
|
35
|
-
|
36
|
-
# The type of the event. Always 'response.reasoning_summary.delta'.
|
37
|
-
sig { returns(Symbol) }
|
38
|
-
attr_accessor :type
|
39
|
-
|
40
|
-
# Emitted when there is a delta (partial update) to the reasoning summary content.
|
41
|
-
sig do
|
42
|
-
params(
|
43
|
-
delta: T.anything,
|
44
|
-
item_id: String,
|
45
|
-
output_index: Integer,
|
46
|
-
sequence_number: Integer,
|
47
|
-
summary_index: Integer,
|
48
|
-
type: Symbol
|
49
|
-
).returns(T.attached_class)
|
50
|
-
end
|
51
|
-
def self.new(
|
52
|
-
# The partial update to the reasoning summary content.
|
53
|
-
delta:,
|
54
|
-
# The unique identifier of the item for which the reasoning summary is being
|
55
|
-
# updated.
|
56
|
-
item_id:,
|
57
|
-
# The index of the output item in the response's output array.
|
58
|
-
output_index:,
|
59
|
-
# The sequence number of this event.
|
60
|
-
sequence_number:,
|
61
|
-
# The index of the summary part within the output item.
|
62
|
-
summary_index:,
|
63
|
-
# The type of the event. Always 'response.reasoning_summary.delta'.
|
64
|
-
type: :"response.reasoning_summary.delta"
|
65
|
-
)
|
66
|
-
end
|
67
|
-
|
68
|
-
sig do
|
69
|
-
override.returns(
|
70
|
-
{
|
71
|
-
delta: T.anything,
|
72
|
-
item_id: String,
|
73
|
-
output_index: Integer,
|
74
|
-
sequence_number: Integer,
|
75
|
-
summary_index: Integer,
|
76
|
-
type: Symbol
|
77
|
-
}
|
78
|
-
)
|
79
|
-
end
|
80
|
-
def to_hash
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|