openai 0.99.0 → 0.101.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 +26 -0
- data/README.md +1 -1
- data/bedrock.md +17 -1
- data/lib/openai/client.rb +13 -0
- data/lib/openai/helpers/agents/session_stream.rb +11 -36
- data/lib/openai/helpers/agents/tools.rb +34 -4
- data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
- data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
- data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
- data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_images_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +125 -3
- data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
- data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
- data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_error.rb +12 -1
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
- data/lib/openai/models/beta/beta_tool.rb +12 -9
- data/lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb +176 -0
- data/lib/openai/models/beta/environment_param.rb +6 -6
- data/lib/openai/models/beta/session_turn_error.rb +9 -0
- data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
- data/lib/openai/models/decision.rb +313 -0
- data/lib/openai/models/decision_create_params.rb +233 -0
- data/lib/openai/models/decision_input_image.rb +53 -0
- data/lib/openai/models/decision_input_message.rb +60 -0
- data/lib/openai/models/decision_input_part.rb +20 -0
- data/lib/openai/models/decision_input_text.rb +21 -0
- data/lib/openai/models/error_object.rb +12 -1
- data/lib/openai/models/eval_create_params.rb +1 -1
- data/lib/openai/models/eval_create_response.rb +1 -1
- data/lib/openai/models/eval_list_response.rb +1 -1
- data/lib/openai/models/eval_retrieve_response.rb +1 -1
- data/lib/openai/models/eval_update_response.rb +1 -1
- data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
- data/lib/openai/models/graders/score_model_grader.rb +2 -2
- data/lib/openai/models/image_edit_params.rb +12 -9
- data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
- data/lib/openai/models/realtime/session_update_event.rb +16 -0
- data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/responses/response_error.rb +12 -1
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/responses/responses_server_event.rb +12 -1
- data/lib/openai/models/responses/tool.rb +12 -9
- data/lib/openai/models/responses/tool_search_output_namespace_tool.rb +174 -0
- data/lib/openai/models/video_create_error.rb +12 -1
- data/lib/openai/models.rb +12 -0
- data/lib/openai/providers/bedrock.rb +20 -1
- data/lib/openai/resources/admin/organization/usage.rb +15 -6
- data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
- data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
- data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -2
- data/lib/openai/resources/decisions.rb +59 -0
- data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
- data/lib/openai/resources/images.rb +8 -6
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +11 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/helpers/agents.rbi +2 -0
- data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
- data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
- data/rbi/openai/helpers/beta/agents.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +194 -1
- data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
- data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
- data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +1893 -18
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
- data/rbi/openai/models/beta/beta_tool.rbi +12 -9
- data/rbi/openai/models/beta/beta_tool_search_output_namespace_tool.rbi +272 -0
- data/rbi/openai/models/beta/environment_param.rbi +6 -6
- data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
- data/rbi/openai/models/decision.rbi +586 -0
- data/rbi/openai/models/decision_create_params.rbi +435 -0
- data/rbi/openai/models/decision_input_image.rbi +81 -0
- data/rbi/openai/models/decision_input_message.rbi +96 -0
- data/rbi/openai/models/decision_input_part.rbi +24 -0
- data/rbi/openai/models/decision_input_text.rbi +49 -0
- data/rbi/openai/models/error_object.rbi +12 -0
- data/rbi/openai/models/eval_create_params.rbi +1 -1
- data/rbi/openai/models/eval_create_response.rbi +1 -1
- data/rbi/openai/models/eval_list_response.rbi +1 -1
- data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
- data/rbi/openai/models/eval_update_response.rbi +1 -1
- data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
- data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
- data/rbi/openai/models/image_edit_params.rbi +12 -9
- data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
- data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/responses/response_error.rbi +12 -0
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +1901 -18
- data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
- data/rbi/openai/models/responses/tool.rbi +12 -9
- data/rbi/openai/models/responses/tool_search_output_namespace_tool.rbi +272 -0
- data/rbi/openai/models/video_create_error.rbi +12 -0
- data/rbi/openai/models.rbi +12 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
- data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
- data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
- data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
- data/rbi/openai/resources/decisions.rbi +57 -0
- data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
- data/rbi/openai/resources/images.rbi +8 -6
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/helpers/agents.rbs +3 -0
- data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
- data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
- data/sig/openai/helpers/beta/agents.rbs +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_images_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +87 -2
- data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
- data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
- data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/beta/beta_response_error.rbs +10 -0
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
- data/sig/openai/models/beta/beta_tool.rbs +8 -6
- data/sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs +162 -0
- data/sig/openai/models/beta/environment_param.rbs +4 -4
- data/sig/openai/models/beta/session_turn_error.rbs +12 -0
- data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
- data/sig/openai/models/decision.rbs +296 -0
- data/sig/openai/models/decision_create_params.rbs +227 -0
- data/sig/openai/models/decision_input_image.rbs +51 -0
- data/sig/openai/models/decision_input_message.rbs +57 -0
- data/sig/openai/models/decision_input_part.rbs +12 -0
- data/sig/openai/models/decision_input_text.rbs +15 -0
- data/sig/openai/models/error_object.rbs +10 -0
- data/sig/openai/models/eval_create_params.rbs +1 -1
- data/sig/openai/models/eval_create_response.rbs +1 -1
- data/sig/openai/models/eval_list_response.rbs +1 -1
- data/sig/openai/models/eval_retrieve_response.rbs +1 -1
- data/sig/openai/models/eval_update_response.rbs +1 -1
- data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
- data/sig/openai/models/graders/score_model_grader.rbs +3 -3
- data/sig/openai/models/image_edit_params.rbs +8 -6
- data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/responses/response_error.rbs +10 -0
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/responses/responses_server_event.rbs +10 -0
- data/sig/openai/models/responses/tool.rbs +8 -6
- data/sig/openai/models/responses/tool_search_output_namespace_tool.rbs +160 -0
- data/sig/openai/models/video_create_error.rbs +10 -0
- data/sig/openai/models.rbs +12 -0
- data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
- data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
- data/sig/openai/resources/decisions.rbs +15 -0
- metadata +38 -1
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
# @see OpenAI::Resources::Decisions#create
|
|
6
|
+
class Decision < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute answers
|
|
8
|
+
#
|
|
9
|
+
# @return [Array<OpenAI::Models::Decision::Answer::Predicate, OpenAI::Models::Decision::Answer::Choice, OpenAI::Models::Decision::Answer::Score, OpenAI::Models::Decision::Answer::Refusal>]
|
|
10
|
+
required :answers, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Decision::Answer] }
|
|
11
|
+
|
|
12
|
+
# @!attribute model
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :model, String
|
|
16
|
+
|
|
17
|
+
# @!attribute usage
|
|
18
|
+
#
|
|
19
|
+
# @return [OpenAI::Models::Decision::Usage]
|
|
20
|
+
required :usage, -> { OpenAI::Decision::Usage }
|
|
21
|
+
|
|
22
|
+
# @!method initialize(answers:, model:, usage:)
|
|
23
|
+
# @param answers [Array<OpenAI::Models::Decision::Answer::Predicate, OpenAI::Models::Decision::Answer::Choice, OpenAI::Models::Decision::Answer::Score, OpenAI::Models::Decision::Answer::Refusal>]
|
|
24
|
+
# @param model [String]
|
|
25
|
+
# @param usage [OpenAI::Models::Decision::Usage]
|
|
26
|
+
|
|
27
|
+
# A completed question always includes its name, including null when unnamed.
|
|
28
|
+
module Answer
|
|
29
|
+
extend OpenAI::Internal::Type::Union
|
|
30
|
+
|
|
31
|
+
discriminator :type
|
|
32
|
+
|
|
33
|
+
variant :predicate, -> { OpenAI::Decision::Answer::Predicate }
|
|
34
|
+
|
|
35
|
+
variant :choice, -> { OpenAI::Decision::Answer::Choice }
|
|
36
|
+
|
|
37
|
+
variant :score, -> { OpenAI::Decision::Answer::Score }
|
|
38
|
+
|
|
39
|
+
# The host may decline one question without disclosing its refusal score.
|
|
40
|
+
variant :refusal, -> { OpenAI::Decision::Answer::Refusal }
|
|
41
|
+
|
|
42
|
+
class Predicate < OpenAI::Internal::Type::BaseModel
|
|
43
|
+
# @!attribute name
|
|
44
|
+
#
|
|
45
|
+
# @return [String, nil]
|
|
46
|
+
required :name, String, nil?: true
|
|
47
|
+
|
|
48
|
+
# @!attribute probability
|
|
49
|
+
#
|
|
50
|
+
# @return [Float]
|
|
51
|
+
required :probability, Float
|
|
52
|
+
|
|
53
|
+
# @!attribute type
|
|
54
|
+
# The type of the object. Always `predicate`.
|
|
55
|
+
#
|
|
56
|
+
# @return [Symbol, :predicate]
|
|
57
|
+
required :type, const: :predicate
|
|
58
|
+
|
|
59
|
+
# @!method initialize(name:, probability:, type: :predicate)
|
|
60
|
+
# @param name [String, nil]
|
|
61
|
+
#
|
|
62
|
+
# @param probability [Float]
|
|
63
|
+
#
|
|
64
|
+
# @param type [Symbol, :predicate]
|
|
65
|
+
# The type of the object. Always `predicate`.
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
class Choice < OpenAI::Internal::Type::BaseModel
|
|
69
|
+
# @!attribute choice
|
|
70
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
71
|
+
#
|
|
72
|
+
# @return [String, Boolean]
|
|
73
|
+
required :choice, union: -> { OpenAI::Decision::Answer::Choice::Choice }
|
|
74
|
+
|
|
75
|
+
# @!attribute confidence
|
|
76
|
+
#
|
|
77
|
+
# @return [Float]
|
|
78
|
+
required :confidence, Float
|
|
79
|
+
|
|
80
|
+
# @!attribute name
|
|
81
|
+
#
|
|
82
|
+
# @return [String, nil]
|
|
83
|
+
required :name, String, nil?: true
|
|
84
|
+
|
|
85
|
+
# @!attribute probabilities
|
|
86
|
+
#
|
|
87
|
+
# @return [Array<OpenAI::Models::Decision::Answer::Choice::Probability>]
|
|
88
|
+
required(
|
|
89
|
+
:probabilities,
|
|
90
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Decision::Answer::Choice::Probability] }
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# @!attribute type
|
|
94
|
+
# The type of the object. Always `choice`.
|
|
95
|
+
#
|
|
96
|
+
# @return [Symbol, :choice]
|
|
97
|
+
required :type, const: :choice
|
|
98
|
+
|
|
99
|
+
# @!method initialize(choice:, confidence:, name:, probabilities:, type: :choice)
|
|
100
|
+
# @param choice [String, Boolean]
|
|
101
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
102
|
+
#
|
|
103
|
+
# @param confidence [Float]
|
|
104
|
+
#
|
|
105
|
+
# @param name [String, nil]
|
|
106
|
+
#
|
|
107
|
+
# @param probabilities [Array<OpenAI::Models::Decision::Answer::Choice::Probability>]
|
|
108
|
+
#
|
|
109
|
+
# @param type [Symbol, :choice]
|
|
110
|
+
# The type of the object. Always `choice`.
|
|
111
|
+
|
|
112
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
113
|
+
#
|
|
114
|
+
# @see OpenAI::Models::Decision::Answer::Choice#choice
|
|
115
|
+
module Choice
|
|
116
|
+
extend OpenAI::Internal::Type::Union
|
|
117
|
+
|
|
118
|
+
variant String
|
|
119
|
+
|
|
120
|
+
variant OpenAI::Internal::Type::Boolean
|
|
121
|
+
|
|
122
|
+
# @!method self.variants
|
|
123
|
+
# @return [Array(String, Boolean)]
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
class Probability < OpenAI::Internal::Type::BaseModel
|
|
127
|
+
# @!attribute probability
|
|
128
|
+
#
|
|
129
|
+
# @return [Float]
|
|
130
|
+
required :probability, Float
|
|
131
|
+
|
|
132
|
+
# @!attribute value
|
|
133
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
134
|
+
#
|
|
135
|
+
# @return [String, Boolean]
|
|
136
|
+
required :value, union: -> { OpenAI::Decision::Answer::Choice::Probability::Value }
|
|
137
|
+
|
|
138
|
+
# @!method initialize(probability:, value:)
|
|
139
|
+
# @param probability [Float]
|
|
140
|
+
#
|
|
141
|
+
# @param value [String, Boolean]
|
|
142
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
143
|
+
|
|
144
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
145
|
+
#
|
|
146
|
+
# @see OpenAI::Models::Decision::Answer::Choice::Probability#value
|
|
147
|
+
module Value
|
|
148
|
+
extend OpenAI::Internal::Type::Union
|
|
149
|
+
|
|
150
|
+
variant String
|
|
151
|
+
|
|
152
|
+
variant OpenAI::Internal::Type::Boolean
|
|
153
|
+
|
|
154
|
+
# @!method self.variants
|
|
155
|
+
# @return [Array(String, Boolean)]
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
class Score < OpenAI::Internal::Type::BaseModel
|
|
161
|
+
# @!attribute confidence
|
|
162
|
+
#
|
|
163
|
+
# @return [Float]
|
|
164
|
+
required :confidence, Float
|
|
165
|
+
|
|
166
|
+
# @!attribute name
|
|
167
|
+
#
|
|
168
|
+
# @return [String, nil]
|
|
169
|
+
required :name, String, nil?: true
|
|
170
|
+
|
|
171
|
+
# @!attribute probabilities
|
|
172
|
+
#
|
|
173
|
+
# @return [Array<OpenAI::Models::Decision::Answer::Score::Probability>]
|
|
174
|
+
required(
|
|
175
|
+
:probabilities,
|
|
176
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Decision::Answer::Score::Probability] }
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
# @!attribute score
|
|
180
|
+
#
|
|
181
|
+
# @return [Float]
|
|
182
|
+
required :score, Float
|
|
183
|
+
|
|
184
|
+
# @!attribute type
|
|
185
|
+
# The type of the object. Always `score`.
|
|
186
|
+
#
|
|
187
|
+
# @return [Symbol, :score]
|
|
188
|
+
required :type, const: :score
|
|
189
|
+
|
|
190
|
+
# @!method initialize(confidence:, name:, probabilities:, score:, type: :score)
|
|
191
|
+
# @param confidence [Float]
|
|
192
|
+
#
|
|
193
|
+
# @param name [String, nil]
|
|
194
|
+
#
|
|
195
|
+
# @param probabilities [Array<OpenAI::Models::Decision::Answer::Score::Probability>]
|
|
196
|
+
#
|
|
197
|
+
# @param score [Float]
|
|
198
|
+
#
|
|
199
|
+
# @param type [Symbol, :score]
|
|
200
|
+
# The type of the object. Always `score`.
|
|
201
|
+
class Probability < OpenAI::Internal::Type::BaseModel
|
|
202
|
+
# @!attribute label
|
|
203
|
+
#
|
|
204
|
+
# @return [String]
|
|
205
|
+
required :label, String
|
|
206
|
+
|
|
207
|
+
# @!attribute probability
|
|
208
|
+
#
|
|
209
|
+
# @return [Float]
|
|
210
|
+
required :probability, Float
|
|
211
|
+
|
|
212
|
+
# @!attribute value
|
|
213
|
+
#
|
|
214
|
+
# @return [Integer]
|
|
215
|
+
required :value, Integer
|
|
216
|
+
|
|
217
|
+
# @!method initialize(label:, probability:, value:)
|
|
218
|
+
# @param label [String]
|
|
219
|
+
# @param probability [Float]
|
|
220
|
+
# @param value [Integer]
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
class Refusal < OpenAI::Internal::Type::BaseModel
|
|
225
|
+
# @!attribute name
|
|
226
|
+
#
|
|
227
|
+
# @return [String, nil]
|
|
228
|
+
required :name, String, nil?: true
|
|
229
|
+
|
|
230
|
+
# @!attribute type
|
|
231
|
+
# The type of the object. Always `refusal`.
|
|
232
|
+
#
|
|
233
|
+
# @return [Symbol, :refusal]
|
|
234
|
+
required :type, const: :refusal
|
|
235
|
+
|
|
236
|
+
# @!method initialize(name:, type: :refusal)
|
|
237
|
+
# The host may decline one question without disclosing its refusal score.
|
|
238
|
+
#
|
|
239
|
+
# @param name [String, nil]
|
|
240
|
+
#
|
|
241
|
+
# @param type [Symbol, :refusal]
|
|
242
|
+
# The type of the object. Always `refusal`.
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# @!method self.variants
|
|
246
|
+
# @return [Array(OpenAI::Models::Decision::Answer::Predicate, OpenAI::Models::Decision::Answer::Choice, OpenAI::Models::Decision::Answer::Score, OpenAI::Models::Decision::Answer::Refusal)]
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# @see OpenAI::Models::Decision#usage
|
|
250
|
+
class Usage < OpenAI::Internal::Type::BaseModel
|
|
251
|
+
# @!attribute input_tokens
|
|
252
|
+
#
|
|
253
|
+
# @return [Integer]
|
|
254
|
+
required :input_tokens, Integer
|
|
255
|
+
|
|
256
|
+
# @!attribute input_tokens_details
|
|
257
|
+
#
|
|
258
|
+
# @return [OpenAI::Models::Decision::Usage::InputTokensDetails]
|
|
259
|
+
required :input_tokens_details, -> { OpenAI::Decision::Usage::InputTokensDetails }
|
|
260
|
+
|
|
261
|
+
# @!attribute output_tokens
|
|
262
|
+
#
|
|
263
|
+
# @return [Integer]
|
|
264
|
+
required :output_tokens, Integer
|
|
265
|
+
|
|
266
|
+
# @!attribute output_tokens_details
|
|
267
|
+
#
|
|
268
|
+
# @return [OpenAI::Models::Decision::Usage::OutputTokensDetails]
|
|
269
|
+
required :output_tokens_details, -> { OpenAI::Decision::Usage::OutputTokensDetails }
|
|
270
|
+
|
|
271
|
+
# @!attribute total_tokens
|
|
272
|
+
#
|
|
273
|
+
# @return [Integer]
|
|
274
|
+
required :total_tokens, Integer
|
|
275
|
+
|
|
276
|
+
# @!method initialize(input_tokens:, input_tokens_details:, output_tokens:, output_tokens_details:, total_tokens:)
|
|
277
|
+
# @param input_tokens [Integer]
|
|
278
|
+
# @param input_tokens_details [OpenAI::Models::Decision::Usage::InputTokensDetails]
|
|
279
|
+
# @param output_tokens [Integer]
|
|
280
|
+
# @param output_tokens_details [OpenAI::Models::Decision::Usage::OutputTokensDetails]
|
|
281
|
+
# @param total_tokens [Integer]
|
|
282
|
+
|
|
283
|
+
# @see OpenAI::Models::Decision::Usage#input_tokens_details
|
|
284
|
+
class InputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
285
|
+
# @!attribute cache_write_tokens
|
|
286
|
+
#
|
|
287
|
+
# @return [Integer]
|
|
288
|
+
required :cache_write_tokens, Integer
|
|
289
|
+
|
|
290
|
+
# @!attribute cached_tokens
|
|
291
|
+
#
|
|
292
|
+
# @return [Integer]
|
|
293
|
+
required :cached_tokens, Integer
|
|
294
|
+
|
|
295
|
+
# @!method initialize(cache_write_tokens:, cached_tokens:)
|
|
296
|
+
# @param cache_write_tokens [Integer]
|
|
297
|
+
# @param cached_tokens [Integer]
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# @see OpenAI::Models::Decision::Usage#output_tokens_details
|
|
301
|
+
class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
302
|
+
# @!attribute reasoning_tokens
|
|
303
|
+
#
|
|
304
|
+
# @return [Integer]
|
|
305
|
+
required :reasoning_tokens, Integer
|
|
306
|
+
|
|
307
|
+
# @!method initialize(reasoning_tokens:)
|
|
308
|
+
# @param reasoning_tokens [Integer]
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
end
|
|
313
|
+
end
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
# @see OpenAI::Resources::Decisions#create
|
|
6
|
+
class DecisionCreateParams < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute input
|
|
11
|
+
# Shared evidence, as a string or an array of user messages containing text and
|
|
12
|
+
# inline images. Non-user roles, function calls, function-call outputs, files,
|
|
13
|
+
# audio, and item references are not supported. At most 128 image parts are
|
|
14
|
+
# allowed across all messages in one request.
|
|
15
|
+
#
|
|
16
|
+
# @return [String, Array<OpenAI::Models::DecisionInputMessage>]
|
|
17
|
+
required :input, union: -> { OpenAI::DecisionCreateParams::Input }
|
|
18
|
+
|
|
19
|
+
# @!attribute model
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :model, String
|
|
23
|
+
|
|
24
|
+
# @!attribute questions
|
|
25
|
+
#
|
|
26
|
+
# @return [Array<OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score>]
|
|
27
|
+
required :questions, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::DecisionCreateParams::Question] }
|
|
28
|
+
|
|
29
|
+
# @!attribute safety_identifier
|
|
30
|
+
# Opaque caller-provided end-user identifier, scoped by the verified org. Match
|
|
31
|
+
# Responses' limit; this is never the authenticated user identity.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :safety_identifier, String, nil?: true
|
|
35
|
+
|
|
36
|
+
# @!method initialize(input:, model:, questions:, safety_identifier: nil, request_options: {})
|
|
37
|
+
# @param input [String, Array<OpenAI::Models::DecisionInputMessage>]
|
|
38
|
+
# Shared evidence, as a string or an array of user messages containing text and
|
|
39
|
+
# inline images. Non-user roles, function calls, function-call outputs, files,
|
|
40
|
+
# audio, and item references are not supported. At most 128 image parts are
|
|
41
|
+
# allowed across all messages in one request.
|
|
42
|
+
#
|
|
43
|
+
# @param model [String]
|
|
44
|
+
#
|
|
45
|
+
# @param questions [Array<OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score>]
|
|
46
|
+
#
|
|
47
|
+
# @param safety_identifier [String, nil]
|
|
48
|
+
# Opaque caller-provided end-user identifier, scoped by the verified org. Match
|
|
49
|
+
# Responses' limit; this is never the authenticated user identity.
|
|
50
|
+
#
|
|
51
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
52
|
+
|
|
53
|
+
# Shared evidence, as a string or an array of user messages containing text and
|
|
54
|
+
# inline images. Non-user roles, function calls, function-call outputs, files,
|
|
55
|
+
# audio, and item references are not supported. At most 128 image parts are
|
|
56
|
+
# allowed across all messages in one request.
|
|
57
|
+
module Input
|
|
58
|
+
extend OpenAI::Internal::Type::Union
|
|
59
|
+
|
|
60
|
+
variant String
|
|
61
|
+
|
|
62
|
+
variant -> { OpenAI::Models::DecisionCreateParams::Input::DecisionInputMessageArray }
|
|
63
|
+
|
|
64
|
+
# @!method self.variants
|
|
65
|
+
# @return [Array(String, Array<OpenAI::Models::DecisionInputMessage>)]
|
|
66
|
+
|
|
67
|
+
# @type [OpenAI::Internal::Type::Converter]
|
|
68
|
+
DecisionInputMessageArray = OpenAI::Internal::Type::ArrayOf[-> { OpenAI::DecisionInputMessage }]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# A question about the request's input, with an optional correlation name.
|
|
72
|
+
module Question
|
|
73
|
+
extend OpenAI::Internal::Type::Union
|
|
74
|
+
|
|
75
|
+
discriminator :type
|
|
76
|
+
|
|
77
|
+
variant :predicate, -> { OpenAI::DecisionCreateParams::Question::Predicate }
|
|
78
|
+
|
|
79
|
+
variant :choice, -> { OpenAI::DecisionCreateParams::Question::Choice }
|
|
80
|
+
|
|
81
|
+
variant :score, -> { OpenAI::DecisionCreateParams::Question::Score }
|
|
82
|
+
|
|
83
|
+
class Predicate < OpenAI::Internal::Type::BaseModel
|
|
84
|
+
# @!attribute instructions
|
|
85
|
+
#
|
|
86
|
+
# @return [String]
|
|
87
|
+
required :instructions, String
|
|
88
|
+
|
|
89
|
+
# @!attribute type
|
|
90
|
+
# The type of the object. Always `predicate`.
|
|
91
|
+
#
|
|
92
|
+
# @return [Symbol, :predicate]
|
|
93
|
+
required :type, const: :predicate
|
|
94
|
+
|
|
95
|
+
# @!attribute name
|
|
96
|
+
#
|
|
97
|
+
# @return [String, nil]
|
|
98
|
+
optional :name, String
|
|
99
|
+
|
|
100
|
+
# @!method initialize(instructions:, name: nil, type: :predicate)
|
|
101
|
+
# @param instructions [String]
|
|
102
|
+
#
|
|
103
|
+
# @param name [String]
|
|
104
|
+
#
|
|
105
|
+
# @param type [Symbol, :predicate]
|
|
106
|
+
# The type of the object. Always `predicate`.
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
class Choice < OpenAI::Internal::Type::BaseModel
|
|
110
|
+
# @!attribute choices
|
|
111
|
+
#
|
|
112
|
+
# @return [Array<OpenAI::Models::DecisionCreateParams::Question::Choice::Choice>]
|
|
113
|
+
required(
|
|
114
|
+
:choices,
|
|
115
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::DecisionCreateParams::Question::Choice::Choice] }
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# @!attribute instructions
|
|
119
|
+
#
|
|
120
|
+
# @return [String]
|
|
121
|
+
required :instructions, String
|
|
122
|
+
|
|
123
|
+
# @!attribute type
|
|
124
|
+
# The type of the object. Always `choice`.
|
|
125
|
+
#
|
|
126
|
+
# @return [Symbol, :choice]
|
|
127
|
+
required :type, const: :choice
|
|
128
|
+
|
|
129
|
+
# @!attribute name
|
|
130
|
+
#
|
|
131
|
+
# @return [String, nil]
|
|
132
|
+
optional :name, String
|
|
133
|
+
|
|
134
|
+
# @!method initialize(choices:, instructions:, name: nil, type: :choice)
|
|
135
|
+
# @param choices [Array<OpenAI::Models::DecisionCreateParams::Question::Choice::Choice>]
|
|
136
|
+
#
|
|
137
|
+
# @param instructions [String]
|
|
138
|
+
#
|
|
139
|
+
# @param name [String]
|
|
140
|
+
#
|
|
141
|
+
# @param type [Symbol, :choice]
|
|
142
|
+
# The type of the object. Always `choice`.
|
|
143
|
+
class Choice < OpenAI::Internal::Type::BaseModel
|
|
144
|
+
# @!attribute value
|
|
145
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
146
|
+
#
|
|
147
|
+
# @return [String, Boolean]
|
|
148
|
+
required :value, union: -> { OpenAI::DecisionCreateParams::Question::Choice::Choice::Value }
|
|
149
|
+
|
|
150
|
+
# @!attribute description
|
|
151
|
+
#
|
|
152
|
+
# @return [String, nil]
|
|
153
|
+
optional :description, String
|
|
154
|
+
|
|
155
|
+
# @!method initialize(value:, description: nil)
|
|
156
|
+
# @param value [String, Boolean]
|
|
157
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
158
|
+
#
|
|
159
|
+
# @param description [String]
|
|
160
|
+
|
|
161
|
+
# Choice values are typed: a string and a boolean with the same text are distinct.
|
|
162
|
+
#
|
|
163
|
+
# @see OpenAI::Models::DecisionCreateParams::Question::Choice::Choice#value
|
|
164
|
+
module Value
|
|
165
|
+
extend OpenAI::Internal::Type::Union
|
|
166
|
+
|
|
167
|
+
variant String
|
|
168
|
+
|
|
169
|
+
variant OpenAI::Internal::Type::Boolean
|
|
170
|
+
|
|
171
|
+
# @!method self.variants
|
|
172
|
+
# @return [Array(String, Boolean)]
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
class Score < OpenAI::Internal::Type::BaseModel
|
|
178
|
+
# @!attribute instructions
|
|
179
|
+
#
|
|
180
|
+
# @return [String]
|
|
181
|
+
required :instructions, String
|
|
182
|
+
|
|
183
|
+
# @!attribute levels
|
|
184
|
+
#
|
|
185
|
+
# @return [Array<OpenAI::Models::DecisionCreateParams::Question::Score::Level>]
|
|
186
|
+
required(
|
|
187
|
+
:levels,
|
|
188
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::DecisionCreateParams::Question::Score::Level] }
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
# @!attribute type
|
|
192
|
+
# The type of the object. Always `score`.
|
|
193
|
+
#
|
|
194
|
+
# @return [Symbol, :score]
|
|
195
|
+
required :type, const: :score
|
|
196
|
+
|
|
197
|
+
# @!attribute name
|
|
198
|
+
#
|
|
199
|
+
# @return [String, nil]
|
|
200
|
+
optional :name, String
|
|
201
|
+
|
|
202
|
+
# @!method initialize(instructions:, levels:, name: nil, type: :score)
|
|
203
|
+
# @param instructions [String]
|
|
204
|
+
#
|
|
205
|
+
# @param levels [Array<OpenAI::Models::DecisionCreateParams::Question::Score::Level>]
|
|
206
|
+
#
|
|
207
|
+
# @param name [String]
|
|
208
|
+
#
|
|
209
|
+
# @param type [Symbol, :score]
|
|
210
|
+
# The type of the object. Always `score`.
|
|
211
|
+
class Level < OpenAI::Internal::Type::BaseModel
|
|
212
|
+
# @!attribute label
|
|
213
|
+
#
|
|
214
|
+
# @return [String]
|
|
215
|
+
required :label, String
|
|
216
|
+
|
|
217
|
+
# @!attribute description
|
|
218
|
+
#
|
|
219
|
+
# @return [String, nil]
|
|
220
|
+
optional :description, String
|
|
221
|
+
|
|
222
|
+
# @!method initialize(label:, description: nil)
|
|
223
|
+
# @param label [String]
|
|
224
|
+
# @param description [String]
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# @!method self.variants
|
|
229
|
+
# @return [Array(OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score)]
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
class DecisionInputImage < OpenAI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute image_url
|
|
7
|
+
# A base64-encoded image in a data URL.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :image_url, String
|
|
11
|
+
|
|
12
|
+
# @!attribute type
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, :input_image]
|
|
15
|
+
required :type, const: :input_image
|
|
16
|
+
|
|
17
|
+
# @!attribute detail
|
|
18
|
+
# The image detail level, using the selected model's image profile. Defaults to
|
|
19
|
+
# auto.
|
|
20
|
+
#
|
|
21
|
+
# @return [Symbol, OpenAI::Models::DecisionInputImage::Detail, nil]
|
|
22
|
+
optional :detail, enum: -> { OpenAI::DecisionInputImage::Detail }, nil?: true
|
|
23
|
+
|
|
24
|
+
# @!method initialize(image_url:, detail: nil, type: :input_image)
|
|
25
|
+
# An inline image. External URLs and file IDs are not supported.
|
|
26
|
+
#
|
|
27
|
+
# @param image_url [String]
|
|
28
|
+
# A base64-encoded image in a data URL.
|
|
29
|
+
#
|
|
30
|
+
# @param detail [Symbol, OpenAI::Models::DecisionInputImage::Detail, nil]
|
|
31
|
+
# The image detail level, using the selected model's image profile. Defaults to
|
|
32
|
+
# auto.
|
|
33
|
+
#
|
|
34
|
+
# @param type [Symbol, :input_image]
|
|
35
|
+
|
|
36
|
+
# The image detail level, using the selected model's image profile. Defaults to
|
|
37
|
+
# auto.
|
|
38
|
+
#
|
|
39
|
+
# @see OpenAI::Models::DecisionInputImage#detail
|
|
40
|
+
module Detail
|
|
41
|
+
extend OpenAI::Internal::Type::Enum
|
|
42
|
+
|
|
43
|
+
LOW = :low
|
|
44
|
+
HIGH = :high
|
|
45
|
+
AUTO = :auto
|
|
46
|
+
ORIGINAL = :original
|
|
47
|
+
|
|
48
|
+
# @!method self.values
|
|
49
|
+
# @return [Array<Symbol>]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
class DecisionInputMessage < OpenAI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute content
|
|
7
|
+
# Text evidence or an ordered list of text and inline image parts.
|
|
8
|
+
#
|
|
9
|
+
# @return [String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>]
|
|
10
|
+
required :content, union: -> { OpenAI::DecisionInputMessage::Content }
|
|
11
|
+
|
|
12
|
+
# @!attribute role
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, :user]
|
|
15
|
+
required :role, const: :user
|
|
16
|
+
|
|
17
|
+
# @!attribute type
|
|
18
|
+
#
|
|
19
|
+
# @return [Symbol, OpenAI::Models::DecisionInputMessage::Type, nil]
|
|
20
|
+
optional :type, enum: -> { OpenAI::DecisionInputMessage::Type }
|
|
21
|
+
|
|
22
|
+
# @!method initialize(content:, type: nil, role: :user)
|
|
23
|
+
# A user message containing text or inline images.
|
|
24
|
+
#
|
|
25
|
+
# @param content [String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>]
|
|
26
|
+
# Text evidence or an ordered list of text and inline image parts.
|
|
27
|
+
#
|
|
28
|
+
# @param type [Symbol, OpenAI::Models::DecisionInputMessage::Type]
|
|
29
|
+
#
|
|
30
|
+
# @param role [Symbol, :user]
|
|
31
|
+
|
|
32
|
+
# Text evidence or an ordered list of text and inline image parts.
|
|
33
|
+
#
|
|
34
|
+
# @see OpenAI::Models::DecisionInputMessage#content
|
|
35
|
+
module Content
|
|
36
|
+
extend OpenAI::Internal::Type::Union
|
|
37
|
+
|
|
38
|
+
variant String
|
|
39
|
+
|
|
40
|
+
variant -> { OpenAI::Models::DecisionInputMessage::Content::DecisionInputPartArray }
|
|
41
|
+
|
|
42
|
+
# @!method self.variants
|
|
43
|
+
# @return [Array(String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>)]
|
|
44
|
+
|
|
45
|
+
# @type [OpenAI::Internal::Type::Converter]
|
|
46
|
+
DecisionInputPartArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::DecisionInputPart }]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @see OpenAI::Models::DecisionInputMessage#type
|
|
50
|
+
module Type
|
|
51
|
+
extend OpenAI::Internal::Type::Enum
|
|
52
|
+
|
|
53
|
+
MESSAGE = :message
|
|
54
|
+
|
|
55
|
+
# @!method self.values
|
|
56
|
+
# @return [Array<Symbol>]
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
# An inline image. External URLs and file IDs are not supported.
|
|
6
|
+
module DecisionInputPart
|
|
7
|
+
extend OpenAI::Internal::Type::Union
|
|
8
|
+
|
|
9
|
+
discriminator :type
|
|
10
|
+
|
|
11
|
+
variant :input_text, -> { OpenAI::DecisionInputText }
|
|
12
|
+
|
|
13
|
+
# An inline image. External URLs and file IDs are not supported.
|
|
14
|
+
variant :input_image, -> { OpenAI::DecisionInputImage }
|
|
15
|
+
|
|
16
|
+
# @!method self.variants
|
|
17
|
+
# @return [Array(OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage)]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
class DecisionInputText < OpenAI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute text
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :text, String
|
|
10
|
+
|
|
11
|
+
# @!attribute type
|
|
12
|
+
#
|
|
13
|
+
# @return [Symbol, :input_text]
|
|
14
|
+
required :type, const: :input_text
|
|
15
|
+
|
|
16
|
+
# @!method initialize(text:, type: :input_text)
|
|
17
|
+
# @param text [String]
|
|
18
|
+
# @param type [Symbol, :input_text]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|