openai 0.110.0 → 0.112.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.
Files changed (255) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/beta/agent.rb +2 -2
  5. data/lib/openai/models/beta/agent_create_params.rb +2 -2
  6. data/lib/openai/models/beta/agent_session.rb +2 -2
  7. data/lib/openai/models/beta/agent_tool.rb +18 -1
  8. data/lib/openai/models/beta/agent_tool_param.rb +18 -1
  9. data/lib/openai/models/beta/agent_update_params.rb +2 -2
  10. data/lib/openai/models/beta/agents/session_create_params.rb +2 -2
  11. data/lib/openai/models/beta/beta_response_input_file.rb +23 -1
  12. data/lib/openai/models/beta/beta_response_input_file_content.rb +23 -1
  13. data/lib/openai/models/beta/beta_response_input_image.rb +23 -1
  14. data/lib/openai/models/beta/beta_response_input_image_content.rb +23 -1
  15. data/lib/openai/models/beta/beta_response_input_text.rb +23 -1
  16. data/lib/openai/models/beta/beta_response_input_text_content.rb +23 -1
  17. data/lib/openai/models/beta/beta_response_item.rb +28 -1
  18. data/lib/openai/models/beta/beta_response_output_item.rb +28 -1
  19. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +26 -15
  20. data/lib/openai/models/beta/beta_tool.rb +26 -15
  21. data/lib/openai/models/beta/persisted_agent_tool.rb +18 -1
  22. data/lib/openai/models/beta/persisted_agent_tool_param.rb +18 -1
  23. data/lib/openai/models/chat/chat_completion_content_part.rb +23 -1
  24. data/lib/openai/models/chat/chat_completion_content_part_image.rb +23 -1
  25. data/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +23 -1
  26. data/lib/openai/models/chat/chat_completion_content_part_text.rb +23 -1
  27. data/lib/openai/models/conversations/computer_screenshot_content.rb +23 -1
  28. data/lib/openai/models/decision_create_params.rb +802 -28
  29. data/lib/openai/models/decision_input_json.rb +45 -0
  30. data/lib/openai/models/decision_input_message.rb +304 -48
  31. data/lib/openai/models/decision_input_part.rb +4 -1
  32. data/lib/openai/models/decision_question_input_image.rb +54 -0
  33. data/lib/openai/models/decision_question_input_part.rb +23 -0
  34. data/lib/openai/models/decision_question_input_text.rb +21 -0
  35. data/lib/openai/models/image_edit_params.rb +20 -4
  36. data/lib/openai/models/image_generate_params.rb +23 -7
  37. data/lib/openai/models/image_model.rb +2 -0
  38. data/lib/openai/models/live/client_delegation.rb +20 -1
  39. data/lib/openai/models/live/client_event.rb +4 -4
  40. data/lib/openai/models/live/commentary_append_event.rb +1 -1
  41. data/lib/openai/models/live/decision_assistant_message.rb +154 -0
  42. data/lib/openai/models/live/decision_choice_option.rb +35 -0
  43. data/lib/openai/models/live/decision_developer_message.rb +70 -0
  44. data/lib/openai/models/live/decision_input_text.rb +26 -0
  45. data/lib/openai/models/live/decision_item_create_event.rb +490 -131
  46. data/lib/openai/models/live/decision_item_created_event.rb +486 -131
  47. data/lib/openai/models/live/decision_json_object.rb +10 -0
  48. data/lib/openai/models/live/decision_question.rb +172 -0
  49. data/lib/openai/models/live/decision_stored_assistant_message.rb +152 -0
  50. data/lib/openai/models/live/decision_stored_developer_message.rb +68 -0
  51. data/lib/openai/models/live/decision_stored_system_message.rb +68 -0
  52. data/lib/openai/models/live/decision_stored_user_message.rb +195 -0
  53. data/lib/openai/models/live/decision_system_message.rb +70 -0
  54. data/lib/openai/models/live/decision_trigger.rb +6 -185
  55. data/lib/openai/models/live/decision_user_message.rb +193 -0
  56. data/lib/openai/models/live/decisions_delegation_config.rb +5 -177
  57. data/lib/openai/models/live/decisions_delegation_update_config.rb +5 -184
  58. data/lib/openai/models/live/fork_client_event.rb +4 -4
  59. data/lib/openai/models/live/fork_server_event.rb +2 -2
  60. data/lib/openai/models/live/fork_session_config.rb +20 -1
  61. data/lib/openai/models/live/input_audio_muted_event.rb +3 -2
  62. data/lib/openai/models/live/input_audio_unmute_event.rb +2 -1
  63. data/lib/openai/models/live/input_audio_unmuted_event.rb +3 -2
  64. data/lib/openai/models/live/instructions_append_event.rb +5 -2
  65. data/lib/openai/models/live/media_session_config.rb +39 -2
  66. data/lib/openai/models/live/media_session_fork_config.rb +20 -1
  67. data/lib/openai/models/live/server_event.rb +2 -2
  68. data/lib/openai/models/live/session_accept_params.rb +39 -2
  69. data/lib/openai/models/live/session_config.rb +39 -2
  70. data/lib/openai/models/live/session_resource.rb +39 -2
  71. data/lib/openai/models/live/session_update_config.rb +41 -2
  72. data/lib/openai/models/live/sideband_client_event.rb +4 -4
  73. data/lib/openai/models/live/sideband_server_event.rb +2 -2
  74. data/lib/openai/models/live/thinking_append_event.rb +1 -1
  75. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +10 -12
  76. data/lib/openai/models/realtime/realtime_error_event.rb +1 -1
  77. data/lib/openai/models/realtime/realtime_server_event.rb +1 -1
  78. data/lib/openai/models/realtime/realtime_translation_server_event.rb +1 -1
  79. data/lib/openai/models/responses/response_input_file.rb +23 -1
  80. data/lib/openai/models/responses/response_input_file_content.rb +23 -1
  81. data/lib/openai/models/responses/response_input_image.rb +23 -1
  82. data/lib/openai/models/responses/response_input_image_content.rb +23 -1
  83. data/lib/openai/models/responses/response_input_text.rb +23 -1
  84. data/lib/openai/models/responses/response_input_text_content.rb +23 -1
  85. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +26 -15
  86. data/lib/openai/models/responses/tool.rb +26 -15
  87. data/lib/openai/models.rb +8 -0
  88. data/lib/openai/resources/beta/agents.rb +2 -2
  89. data/lib/openai/resources/beta/responses.rb +2 -2
  90. data/lib/openai/resources/decisions.rb +5 -6
  91. data/lib/openai/resources/images.rb +18 -6
  92. data/lib/openai/resources/live/forks.rb +2 -2
  93. data/lib/openai/resources/live/sideband.rb +2 -2
  94. data/lib/openai/resources/live.rb +2 -2
  95. data/lib/openai/resources/realtime/translations.rb +2 -2
  96. data/lib/openai/resources/realtime.rb +2 -2
  97. data/lib/openai/resources/responses.rb +2 -2
  98. data/lib/openai/version.rb +1 -1
  99. data/lib/openai.rb +16 -0
  100. data/rbi/openai/models/beta/agent.rbi +2 -1
  101. data/rbi/openai/models/beta/agent_create_params.rbi +6 -3
  102. data/rbi/openai/models/beta/agent_session.rbi +2 -1
  103. data/rbi/openai/models/beta/agent_tool.rbi +40 -1
  104. data/rbi/openai/models/beta/agent_tool_param.rbi +40 -1
  105. data/rbi/openai/models/beta/agent_update_params.rbi +6 -3
  106. data/rbi/openai/models/beta/agents/session_create_params.rbi +6 -3
  107. data/rbi/openai/models/beta/beta_response_input_file.rbi +31 -1
  108. data/rbi/openai/models/beta/beta_response_input_file_content.rbi +39 -1
  109. data/rbi/openai/models/beta/beta_response_input_image.rbi +31 -1
  110. data/rbi/openai/models/beta/beta_response_input_image_content.rbi +39 -1
  111. data/rbi/openai/models/beta/beta_response_input_text.rbi +31 -1
  112. data/rbi/openai/models/beta/beta_response_input_text_content.rbi +39 -1
  113. data/rbi/openai/models/beta/beta_response_item.rbi +58 -1
  114. data/rbi/openai/models/beta/beta_response_output_item.rbi +58 -1
  115. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +24 -15
  116. data/rbi/openai/models/beta/beta_tool.rbi +24 -15
  117. data/rbi/openai/models/beta/persisted_agent_tool.rbi +40 -1
  118. data/rbi/openai/models/beta/persisted_agent_tool_param.rbi +40 -1
  119. data/rbi/openai/models/chat/chat_completion_content_part.rbi +43 -1
  120. data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +41 -1
  121. data/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +46 -1
  122. data/rbi/openai/models/chat/chat_completion_content_part_text.rbi +39 -1
  123. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +48 -1
  124. data/rbi/openai/models/decision_create_params.rbi +1273 -26
  125. data/rbi/openai/models/decision_input_json.rbi +75 -0
  126. data/rbi/openai/models/decision_input_message.rbi +455 -52
  127. data/rbi/openai/models/decision_input_part.rbi +2 -1
  128. data/rbi/openai/models/decision_question_input_image.rbi +82 -0
  129. data/rbi/openai/models/decision_question_input_part.rbi +25 -0
  130. data/rbi/openai/models/decision_question_input_text.rbi +49 -0
  131. data/rbi/openai/models/image_edit_params.rbi +12 -3
  132. data/rbi/openai/models/image_generate_params.rbi +15 -6
  133. data/rbi/openai/models/live/client_delegation.rbi +23 -1
  134. data/rbi/openai/models/live/commentary_append_event.rbi +1 -1
  135. data/rbi/openai/models/live/decision_assistant_message.rbi +247 -0
  136. data/rbi/openai/models/live/decision_choice_option.rbi +67 -0
  137. data/rbi/openai/models/live/decision_developer_message.rbi +109 -0
  138. data/rbi/openai/models/live/decision_input_text.rbi +55 -0
  139. data/rbi/openai/models/live/decision_item_create_event.rbi +765 -184
  140. data/rbi/openai/models/live/decision_item_created_event.rbi +737 -184
  141. data/rbi/openai/models/live/decision_json_object.rbi +16 -0
  142. data/rbi/openai/models/live/decision_question.rbi +300 -0
  143. data/rbi/openai/models/live/decision_stored_assistant_message.rbi +245 -0
  144. data/rbi/openai/models/live/decision_stored_developer_message.rbi +107 -0
  145. data/rbi/openai/models/live/decision_stored_system_message.rbi +107 -0
  146. data/rbi/openai/models/live/decision_stored_user_message.rbi +333 -0
  147. data/rbi/openai/models/live/decision_system_message.rbi +109 -0
  148. data/rbi/openai/models/live/decision_trigger.rbi +11 -320
  149. data/rbi/openai/models/live/decision_user_message.rbi +320 -0
  150. data/rbi/openai/models/live/decisions_delegation_config.rbi +10 -321
  151. data/rbi/openai/models/live/decisions_delegation_update_config.rbi +13 -324
  152. data/rbi/openai/models/live/fork_session_config.rbi +27 -1
  153. data/rbi/openai/models/live/input_audio_muted_event.rbi +3 -2
  154. data/rbi/openai/models/live/input_audio_unmute_event.rbi +2 -1
  155. data/rbi/openai/models/live/input_audio_unmuted_event.rbi +3 -2
  156. data/rbi/openai/models/live/instructions_append_event.rbi +5 -2
  157. data/rbi/openai/models/live/media_session_config.rbi +44 -2
  158. data/rbi/openai/models/live/media_session_fork_config.rbi +27 -1
  159. data/rbi/openai/models/live/session_accept_params.rbi +44 -2
  160. data/rbi/openai/models/live/session_config.rbi +44 -2
  161. data/rbi/openai/models/live/session_resource.rbi +44 -2
  162. data/rbi/openai/models/live/session_update_config.rbi +54 -2
  163. data/rbi/openai/models/live/thinking_append_event.rbi +1 -1
  164. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +10 -12
  165. data/rbi/openai/models/realtime/realtime_error_event.rbi +1 -1
  166. data/rbi/openai/models/responses/response_input_file.rbi +31 -1
  167. data/rbi/openai/models/responses/response_input_file_content.rbi +39 -1
  168. data/rbi/openai/models/responses/response_input_image.rbi +33 -1
  169. data/rbi/openai/models/responses/response_input_image_content.rbi +41 -1
  170. data/rbi/openai/models/responses/response_input_text.rbi +31 -1
  171. data/rbi/openai/models/responses/response_input_text_content.rbi +39 -1
  172. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +24 -15
  173. data/rbi/openai/models/responses/tool.rbi +24 -15
  174. data/rbi/openai/models.rbi +8 -0
  175. data/rbi/openai/resources/beta/agents.rbi +4 -2
  176. data/rbi/openai/resources/beta/responses.rbi +8 -1
  177. data/rbi/openai/resources/decisions.rbi +4 -5
  178. data/rbi/openai/resources/images.rbi +18 -6
  179. data/rbi/openai/resources/live/forks.rbi +8 -1
  180. data/rbi/openai/resources/live/sideband.rbi +8 -1
  181. data/rbi/openai/resources/live.rbi +8 -1
  182. data/rbi/openai/resources/realtime/translations.rbi +8 -1
  183. data/rbi/openai/resources/realtime.rbi +8 -1
  184. data/rbi/openai/resources/responses.rbi +8 -1
  185. data/sig/openai/models/beta/agent_tool.rbs +14 -0
  186. data/sig/openai/models/beta/agent_tool_param.rbs +14 -0
  187. data/sig/openai/models/beta/beta_response_input_file.rbs +34 -3
  188. data/sig/openai/models/beta/beta_response_input_file_content.rbs +34 -3
  189. data/sig/openai/models/beta/beta_response_input_image.rbs +34 -3
  190. data/sig/openai/models/beta/beta_response_input_image_content.rbs +34 -3
  191. data/sig/openai/models/beta/beta_response_input_text.rbs +34 -3
  192. data/sig/openai/models/beta/beta_response_input_text_content.rbs +34 -3
  193. data/sig/openai/models/beta/beta_response_item.rbs +34 -3
  194. data/sig/openai/models/beta/beta_response_output_item.rbs +34 -3
  195. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +24 -15
  196. data/sig/openai/models/beta/beta_tool.rbs +24 -15
  197. data/sig/openai/models/beta/persisted_agent_tool.rbs +14 -0
  198. data/sig/openai/models/beta/persisted_agent_tool_param.rbs +14 -0
  199. data/sig/openai/models/chat/chat_completion_content_part.rbs +34 -3
  200. data/sig/openai/models/chat/chat_completion_content_part_image.rbs +34 -3
  201. data/sig/openai/models/chat/chat_completion_content_part_input_audio.rbs +34 -3
  202. data/sig/openai/models/chat/chat_completion_content_part_text.rbs +34 -3
  203. data/sig/openai/models/conversations/computer_screenshot_content.rbs +34 -3
  204. data/sig/openai/models/decision_create_params.rbs +610 -24
  205. data/sig/openai/models/decision_input_json.rbs +34 -0
  206. data/sig/openai/models/decision_input_message.rbs +264 -35
  207. data/sig/openai/models/decision_input_part.rbs +3 -1
  208. data/sig/openai/models/decision_question_input_image.rbs +51 -0
  209. data/sig/openai/models/decision_question_input_part.rbs +14 -0
  210. data/sig/openai/models/decision_question_input_text.rbs +15 -0
  211. data/sig/openai/models/image_edit_params.rbs +8 -2
  212. data/sig/openai/models/image_generate_params.rbs +10 -4
  213. data/sig/openai/models/live/client_delegation.rbs +30 -3
  214. data/sig/openai/models/live/decision_assistant_message.rbs +134 -0
  215. data/sig/openai/models/live/decision_choice_option.rbs +37 -0
  216. data/sig/openai/models/live/decision_developer_message.rbs +67 -0
  217. data/sig/openai/models/live/decision_input_text.rbs +20 -0
  218. data/sig/openai/models/live/decision_item_create_event.rbs +413 -131
  219. data/sig/openai/models/live/decision_item_created_event.rbs +401 -131
  220. data/sig/openai/models/live/decision_json_object.rbs +9 -0
  221. data/sig/openai/models/live/decision_question.rbs +164 -0
  222. data/sig/openai/models/live/decision_stored_assistant_message.rbs +131 -0
  223. data/sig/openai/models/live/decision_stored_developer_message.rbs +64 -0
  224. data/sig/openai/models/live/decision_stored_system_message.rbs +64 -0
  225. data/sig/openai/models/live/decision_stored_user_message.rbs +177 -0
  226. data/sig/openai/models/live/decision_system_message.rbs +67 -0
  227. data/sig/openai/models/live/decision_trigger.rbs +8 -171
  228. data/sig/openai/models/live/decision_user_message.rbs +180 -0
  229. data/sig/openai/models/live/decisions_delegation_config.rbs +6 -167
  230. data/sig/openai/models/live/decisions_delegation_update_config.rbs +8 -169
  231. data/sig/openai/models/live/fork_session_config.rbs +26 -0
  232. data/sig/openai/models/live/media_session_config.rbs +53 -4
  233. data/sig/openai/models/live/media_session_fork_config.rbs +26 -0
  234. data/sig/openai/models/live/session_accept_params.rbs +53 -4
  235. data/sig/openai/models/live/session_config.rbs +53 -4
  236. data/sig/openai/models/live/session_resource.rbs +53 -4
  237. data/sig/openai/models/live/session_update_config.rbs +52 -0
  238. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbs +10 -12
  239. data/sig/openai/models/responses/response_input_file.rbs +34 -3
  240. data/sig/openai/models/responses/response_input_file_content.rbs +34 -3
  241. data/sig/openai/models/responses/response_input_image.rbs +34 -3
  242. data/sig/openai/models/responses/response_input_image_content.rbs +34 -3
  243. data/sig/openai/models/responses/response_input_text.rbs +34 -3
  244. data/sig/openai/models/responses/response_input_text_content.rbs +34 -3
  245. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +24 -15
  246. data/sig/openai/models/responses/tool.rbs +24 -15
  247. data/sig/openai/models.rbs +9 -1
  248. data/sig/openai/resources/beta/responses.rbs +2 -1
  249. data/sig/openai/resources/live/forks.rbs +2 -1
  250. data/sig/openai/resources/live/sideband.rbs +2 -1
  251. data/sig/openai/resources/live.rbs +2 -1
  252. data/sig/openai/resources/realtime/translations.rbs +2 -1
  253. data/sig/openai/resources/realtime.rbs +2 -1
  254. data/sig/openai/resources/responses.rbs +2 -1
  255. metadata +49 -1
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Live
6
+ class DecisionSystemMessage < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ # The text input to the model.
9
+ #
10
+ # @return [String, Array<OpenAI::Models::Live::DecisionInputText>]
11
+ required :content, union: -> { OpenAI::Live::DecisionSystemMessage::Content }
12
+
13
+ # @!attribute role
14
+ #
15
+ # @return [Symbol, :system]
16
+ required :role, const: :system
17
+
18
+ # @!attribute id
19
+ # The unique ID of this message item.
20
+ #
21
+ # @return [String, nil]
22
+ optional :id, String, nil?: true
23
+
24
+ # @!attribute type
25
+ #
26
+ # @return [Symbol, OpenAI::Models::Live::DecisionSystemMessage::Type, nil]
27
+ optional :type, enum: -> { OpenAI::Live::DecisionSystemMessage::Type }
28
+
29
+ # @!method initialize(content:, id: nil, type: nil, role: :system)
30
+ # @param content [String, Array<OpenAI::Models::Live::DecisionInputText>]
31
+ # The text input to the model.
32
+ #
33
+ # @param id [String, nil]
34
+ # The unique ID of this message item.
35
+ #
36
+ # @param type [Symbol, OpenAI::Models::Live::DecisionSystemMessage::Type]
37
+ #
38
+ # @param role [Symbol, :system]
39
+
40
+ # The text input to the model.
41
+ #
42
+ # @see OpenAI::Models::Live::DecisionSystemMessage#content
43
+ module Content
44
+ extend OpenAI::Internal::Type::Union
45
+
46
+ # The text input to the model.
47
+ variant String
48
+
49
+ variant -> { OpenAI::Models::Live::DecisionSystemMessage::Content::DecisionInputTextArray }
50
+
51
+ # @!method self.variants
52
+ # @return [Array(String, Array<OpenAI::Models::Live::DecisionInputText>)]
53
+
54
+ # @type [OpenAI::Internal::Type::Converter]
55
+ DecisionInputTextArray = OpenAI::Internal::Type::ArrayOf[-> { OpenAI::Live::DecisionInputText }]
56
+ end
57
+
58
+ # @see OpenAI::Models::Live::DecisionSystemMessage#type
59
+ module Type
60
+ extend OpenAI::Internal::Type::Enum
61
+
62
+ MESSAGE = :message
63
+
64
+ # @!method self.values
65
+ # @return [Array<Symbol>]
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -32,200 +32,21 @@ module OpenAI
32
32
 
33
33
  # @see OpenAI::Models::Live::DecisionTrigger#decisions
34
34
  class Decisions < OpenAI::Internal::Type::BaseModel
35
+ require_relative "decision_question"
36
+ Question = ::OpenAI::Models::Live::DecisionQuestion
37
+
35
38
  # @!attribute questions
36
39
  # Native Decision API questions evaluated together, in order.
37
40
  #
38
- # @return [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Predicate, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score>]
39
- required(
40
- :questions,
41
- -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::DecisionTrigger::Decisions::Question] }
42
- )
41
+ # @return [Array<OpenAI::Models::Live::DecisionQuestion::Choice, OpenAI::Models::Live::DecisionQuestion::Predicate, OpenAI::Models::Live::DecisionQuestion::Score>]
42
+ required :questions, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::DecisionQuestion] }
43
43
 
44
44
  # @!method initialize(questions:)
45
45
  # Questions evaluated using the current transcript and the session's shared
46
46
  # Decision items.
47
47
  #
48
- # @param questions [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Predicate, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score>]
48
+ # @param questions [Array<OpenAI::Models::Live::DecisionQuestion::Choice, OpenAI::Models::Live::DecisionQuestion::Predicate, OpenAI::Models::Live::DecisionQuestion::Score>]
49
49
  # Native Decision API questions evaluated together, in order.
50
-
51
- # A question about the request's input, with an optional correlation name.
52
- module Question
53
- extend OpenAI::Internal::Type::Union
54
-
55
- discriminator :type
56
-
57
- # Estimate how likely it is that a statement about the input is true.
58
- variant :predicate, -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Predicate }
59
-
60
- # Choose from the supplied options based on the input.
61
- variant :choice, -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Choice }
62
-
63
- # Rate the input against the supplied ordered levels.
64
- variant :score, -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Score }
65
-
66
- class Predicate < OpenAI::Internal::Type::BaseModel
67
- # @!attribute instructions
68
- #
69
- # @return [String]
70
- required :instructions, String
71
-
72
- # @!attribute type
73
- # The type of the object. Always `predicate`.
74
- #
75
- # @return [Symbol, :predicate]
76
- required :type, const: :predicate
77
-
78
- # @!attribute name
79
- #
80
- # @return [String, nil]
81
- optional :name, String
82
-
83
- # @!method initialize(instructions:, name: nil, type: :predicate)
84
- # Estimate how likely it is that a statement about the input is true.
85
- #
86
- # @param instructions [String]
87
- #
88
- # @param name [String]
89
- #
90
- # @param type [Symbol, :predicate]
91
- # The type of the object. Always `predicate`.
92
- end
93
-
94
- class Choice < OpenAI::Internal::Type::BaseModel
95
- # @!attribute choices
96
- # Provide between 2 and 255 choices. Each choice must be unique.
97
- #
98
- # @return [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice::Choice>]
99
- required(
100
- :choices,
101
- -> {
102
- OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger::Decisions::Question::Choice::Choice]
103
- }
104
- )
105
-
106
- # @!attribute instructions
107
- #
108
- # @return [String]
109
- required :instructions, String
110
-
111
- # @!attribute type
112
- # The type of the object. Always `choice`.
113
- #
114
- # @return [Symbol, :choice]
115
- required :type, const: :choice
116
-
117
- # @!attribute name
118
- #
119
- # @return [String, nil]
120
- optional :name, String
121
-
122
- # @!method initialize(choices:, instructions:, name: nil, type: :choice)
123
- # Choose from the supplied options based on the input.
124
- #
125
- # @param choices [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice::Choice>]
126
- # Provide between 2 and 255 choices. Each choice must be unique.
127
- #
128
- # @param instructions [String]
129
- #
130
- # @param name [String]
131
- #
132
- # @param type [Symbol, :choice]
133
- # The type of the object. Always `choice`.
134
- class Choice < OpenAI::Internal::Type::BaseModel
135
- # @!attribute value
136
- # Choice values are typed: a string and a boolean with the same text are distinct.
137
- #
138
- # @return [String, Boolean]
139
- required(
140
- :value,
141
- union: -> { OpenAI::Live::DecisionTrigger::Decisions::Question::Choice::Choice::Value }
142
- )
143
-
144
- # @!attribute description
145
- #
146
- # @return [String, nil]
147
- optional :description, String
148
-
149
- # @!method initialize(value:, description: nil)
150
- # @param value [String, Boolean]
151
- # Choice values are typed: a string and a boolean with the same text are distinct.
152
- #
153
- # @param description [String]
154
-
155
- # Choice values are typed: a string and a boolean with the same text are distinct.
156
- #
157
- # @see OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice::Choice#value
158
- module Value
159
- extend OpenAI::Internal::Type::Union
160
-
161
- variant String
162
-
163
- variant OpenAI::Internal::Type::Boolean
164
-
165
- # @!method self.variants
166
- # @return [Array(String, Boolean)]
167
- end
168
- end
169
- end
170
-
171
- class Score < OpenAI::Internal::Type::BaseModel
172
- # @!attribute instructions
173
- #
174
- # @return [String]
175
- required :instructions, String
176
-
177
- # @!attribute levels
178
- #
179
- # @return [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score::Level>]
180
- required(
181
- :levels,
182
- -> {
183
- OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger::Decisions::Question::Score::Level]
184
- }
185
- )
186
-
187
- # @!attribute type
188
- # The type of the object. Always `score`.
189
- #
190
- # @return [Symbol, :score]
191
- required :type, const: :score
192
-
193
- # @!attribute name
194
- #
195
- # @return [String, nil]
196
- optional :name, String
197
-
198
- # @!method initialize(instructions:, levels:, name: nil, type: :score)
199
- # Rate the input against the supplied ordered levels.
200
- #
201
- # @param instructions [String]
202
- #
203
- # @param levels [Array<OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score::Level>]
204
- #
205
- # @param name [String]
206
- #
207
- # @param type [Symbol, :score]
208
- # The type of the object. Always `score`.
209
- class Level < OpenAI::Internal::Type::BaseModel
210
- # @!attribute label
211
- #
212
- # @return [String]
213
- required :label, String
214
-
215
- # @!attribute description
216
- #
217
- # @return [String, nil]
218
- optional :description, String
219
-
220
- # @!method initialize(label:, description: nil)
221
- # @param label [String]
222
- # @param description [String]
223
- end
224
- end
225
-
226
- # @!method self.variants
227
- # @return [Array(OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Predicate, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Choice, OpenAI::Models::Live::DecisionTrigger::Decisions::Question::Score)]
228
- end
229
50
  end
230
51
 
231
52
  # @see OpenAI::Models::Live::DecisionTrigger#event_type
@@ -0,0 +1,193 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Live
6
+ class DecisionUserMessage < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ # The text input to the model.
9
+ #
10
+ # @return [String, Array<OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputText, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputImage, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputJSON>]
11
+ required :content, union: -> { OpenAI::Live::DecisionUserMessage::Content }
12
+
13
+ # @!attribute role
14
+ # The message role. Always `user`.
15
+ #
16
+ # @return [Symbol, :user]
17
+ required :role, const: :user
18
+
19
+ # @!attribute id
20
+ # The unique ID of this message item.
21
+ #
22
+ # @return [String, nil]
23
+ optional :id, String, nil?: true
24
+
25
+ # @!attribute type
26
+ #
27
+ # @return [Symbol, OpenAI::Models::Live::DecisionUserMessage::Type, nil]
28
+ optional :type, enum: -> { OpenAI::Live::DecisionUserMessage::Type }
29
+
30
+ # @!method initialize(content:, id: nil, type: nil, role: :user)
31
+ # @param content [String, Array<OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputText, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputImage, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputJSON>]
32
+ # The text input to the model.
33
+ #
34
+ # @param id [String, nil]
35
+ # The unique ID of this message item.
36
+ #
37
+ # @param type [Symbol, OpenAI::Models::Live::DecisionUserMessage::Type]
38
+ #
39
+ # @param role [Symbol, :user]
40
+ # The message role. Always `user`.
41
+
42
+ # The text input to the model.
43
+ #
44
+ # @see OpenAI::Models::Live::DecisionUserMessage#content
45
+ module Content
46
+ extend OpenAI::Internal::Type::Union
47
+
48
+ # The text input to the model.
49
+ variant String
50
+
51
+ variant -> { OpenAI::Models::Live::DecisionUserMessage::Content::PartsArray }
52
+
53
+ module Part
54
+ extend OpenAI::Internal::Type::Union
55
+
56
+ discriminator :type
57
+
58
+ variant :input_text, -> { OpenAI::Live::DecisionUserMessage::Content::Part::InputText }
59
+
60
+ variant :input_image, -> { OpenAI::Live::DecisionUserMessage::Content::Part::InputImage }
61
+
62
+ variant :input_json, -> { OpenAI::Live::DecisionUserMessage::Content::Part::InputJSON }
63
+
64
+ class InputText < OpenAI::Internal::Type::BaseModel
65
+ # @!attribute text
66
+ # The text input to the model.
67
+ #
68
+ # @return [String]
69
+ required :text, String
70
+
71
+ # @!attribute type
72
+ #
73
+ # @return [Symbol, :input_text]
74
+ required :type, const: :input_text
75
+
76
+ # @!method initialize(text:, type: :input_text)
77
+ # @param text [String]
78
+ # The text input to the model.
79
+ #
80
+ # @param type [Symbol, :input_text]
81
+ end
82
+
83
+ class InputImage < OpenAI::Internal::Type::BaseModel
84
+ # @!attribute image_url
85
+ # A base64-encoded image data URL or a publicly accessible HTTP(S) image URL.
86
+ #
87
+ # @return [String]
88
+ required :image_url, String
89
+
90
+ # @!attribute type
91
+ #
92
+ # @return [Symbol, :input_image]
93
+ required :type, const: :input_image
94
+
95
+ # @!attribute detail
96
+ # The detail level of the image to be sent to the model. One of `high`, `low`,
97
+ # `auto`, or `original`. Defaults to `auto`.
98
+ #
99
+ # @return [Symbol, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputImage::Detail, nil]
100
+ optional(
101
+ :detail,
102
+ enum: -> { OpenAI::Live::DecisionUserMessage::Content::Part::InputImage::Detail },
103
+ nil?: true
104
+ )
105
+
106
+ # @!method initialize(image_url:, detail: nil, type: :input_image)
107
+ # @param image_url [String]
108
+ # A base64-encoded image data URL or a publicly accessible HTTP(S) image URL.
109
+ #
110
+ # @param detail [Symbol, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputImage::Detail, nil]
111
+ # The detail level of the image to be sent to the model. One of `high`, `low`,
112
+ # `auto`, or `original`. Defaults to `auto`.
113
+ #
114
+ # @param type [Symbol, :input_image]
115
+
116
+ # The detail level of the image to be sent to the model. One of `high`, `low`,
117
+ # `auto`, or `original`. Defaults to `auto`.
118
+ #
119
+ # @see OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputImage#detail
120
+ module Detail
121
+ extend OpenAI::Internal::Type::Enum
122
+
123
+ LOW = :low
124
+ HIGH = :high
125
+ AUTO = :auto
126
+ ORIGINAL = :original
127
+
128
+ # @!method self.values
129
+ # @return [Array<Symbol>]
130
+ end
131
+ end
132
+
133
+ class InputJSON < OpenAI::Internal::Type::BaseModel
134
+ # @!attribute data
135
+ #
136
+ # @return [Hash{Symbol=>Object}, Array<Hash{Symbol=>Object}>]
137
+ required :data, union: -> { OpenAI::Live::DecisionUserMessage::Content::Part::InputJSON::Data }
138
+
139
+ # @!attribute type
140
+ #
141
+ # @return [Symbol, :input_json]
142
+ required :type, const: :input_json
143
+
144
+ # @!method initialize(data:, type: :input_json)
145
+ # @param data [Hash{Symbol=>Object}, Array<Hash{Symbol=>Object}>]
146
+ # @param type [Symbol, :input_json]
147
+
148
+ # @see OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputJSON#data
149
+ module Data
150
+ extend OpenAI::Internal::Type::Union
151
+
152
+ variant OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown]
153
+
154
+ variant(
155
+ -> {
156
+ OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputJSON::Data::DecisionJSONObjectArray
157
+ }
158
+ )
159
+
160
+ # @!method self.variants
161
+ # @return [Array(Hash{Symbol=>Object}, Array<Hash{Symbol=>Object}>)]
162
+
163
+ # @type [OpenAI::Internal::Type::Converter]
164
+ DecisionJSONObjectArray = OpenAI::Internal::Type::ArrayOf[
165
+ OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown]
166
+ ]
167
+ end
168
+ end
169
+
170
+ # @!method self.variants
171
+ # @return [Array(OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputText, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputImage, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputJSON)]
172
+ end
173
+
174
+ # @!method self.variants
175
+ # @return [Array(String, Array<OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputText, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputImage, OpenAI::Models::Live::DecisionUserMessage::Content::Part::InputJSON>)]
176
+
177
+ # @type [OpenAI::Internal::Type::Converter]
178
+ PartsArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Live::DecisionUserMessage::Content::Part }]
179
+ end
180
+
181
+ # @see OpenAI::Models::Live::DecisionUserMessage#type
182
+ module Type
183
+ extend OpenAI::Internal::Type::Enum
184
+
185
+ MESSAGE = :message
186
+
187
+ # @!method self.values
188
+ # @return [Array<Symbol>]
189
+ end
190
+ end
191
+ end
192
+ end
193
+ end
@@ -12,189 +12,17 @@ module OpenAI
12
12
  # @!attribute questions
13
13
  # Native Decision API questions evaluated together, in order.
14
14
  #
15
- # @return [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score>]
16
- required(
17
- :questions,
18
- -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::DecisionsDelegationConfig::Question] }
19
- )
15
+ # @return [Array<OpenAI::Models::Live::DecisionQuestion::Choice, OpenAI::Models::Live::DecisionQuestion::Predicate, OpenAI::Models::Live::DecisionQuestion::Score>]
16
+ required :questions, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::DecisionQuestion] }
20
17
 
21
18
  # @!method initialize(model:, questions:)
22
19
  # @param model [String]
23
20
  #
24
- # @param questions [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score>]
21
+ # @param questions [Array<OpenAI::Models::Live::DecisionQuestion::Choice, OpenAI::Models::Live::DecisionQuestion::Predicate, OpenAI::Models::Live::DecisionQuestion::Score>]
25
22
  # Native Decision API questions evaluated together, in order.
26
23
 
27
- # A question about the request's input, with an optional correlation name.
28
- module Question
29
- extend OpenAI::Internal::Type::Union
30
-
31
- discriminator :type
32
-
33
- # Estimate how likely it is that a statement about the input is true.
34
- variant :predicate, -> { OpenAI::Live::DecisionsDelegationConfig::Question::Predicate }
35
-
36
- # Choose from the supplied options based on the input.
37
- variant :choice, -> { OpenAI::Live::DecisionsDelegationConfig::Question::Choice }
38
-
39
- # Rate the input against the supplied ordered levels.
40
- variant :score, -> { OpenAI::Live::DecisionsDelegationConfig::Question::Score }
41
-
42
- class Predicate < OpenAI::Internal::Type::BaseModel
43
- # @!attribute instructions
44
- #
45
- # @return [String]
46
- required :instructions, String
47
-
48
- # @!attribute type
49
- # The type of the object. Always `predicate`.
50
- #
51
- # @return [Symbol, :predicate]
52
- required :type, const: :predicate
53
-
54
- # @!attribute name
55
- #
56
- # @return [String, nil]
57
- optional :name, String
58
-
59
- # @!method initialize(instructions:, name: nil, type: :predicate)
60
- # Estimate how likely it is that a statement about the input is true.
61
- #
62
- # @param instructions [String]
63
- #
64
- # @param name [String]
65
- #
66
- # @param type [Symbol, :predicate]
67
- # The type of the object. Always `predicate`.
68
- end
69
-
70
- class Choice < OpenAI::Internal::Type::BaseModel
71
- # @!attribute choices
72
- # Provide between 2 and 255 choices. Each choice must be unique.
73
- #
74
- # @return [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice::Choice>]
75
- required(
76
- :choices,
77
- -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionsDelegationConfig::Question::Choice::Choice] }
78
- )
79
-
80
- # @!attribute instructions
81
- #
82
- # @return [String]
83
- required :instructions, String
84
-
85
- # @!attribute type
86
- # The type of the object. Always `choice`.
87
- #
88
- # @return [Symbol, :choice]
89
- required :type, const: :choice
90
-
91
- # @!attribute name
92
- #
93
- # @return [String, nil]
94
- optional :name, String
95
-
96
- # @!method initialize(choices:, instructions:, name: nil, type: :choice)
97
- # Choose from the supplied options based on the input.
98
- #
99
- # @param choices [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice::Choice>]
100
- # Provide between 2 and 255 choices. Each choice must be unique.
101
- #
102
- # @param instructions [String]
103
- #
104
- # @param name [String]
105
- #
106
- # @param type [Symbol, :choice]
107
- # The type of the object. Always `choice`.
108
- class Choice < OpenAI::Internal::Type::BaseModel
109
- # @!attribute value
110
- # Choice values are typed: a string and a boolean with the same text are distinct.
111
- #
112
- # @return [String, Boolean]
113
- required :value, union: -> { OpenAI::Live::DecisionsDelegationConfig::Question::Choice::Choice::Value }
114
-
115
- # @!attribute description
116
- #
117
- # @return [String, nil]
118
- optional :description, String
119
-
120
- # @!method initialize(value:, description: nil)
121
- # @param value [String, Boolean]
122
- # Choice values are typed: a string and a boolean with the same text are distinct.
123
- #
124
- # @param description [String]
125
-
126
- # Choice values are typed: a string and a boolean with the same text are distinct.
127
- #
128
- # @see OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice::Choice#value
129
- module Value
130
- extend OpenAI::Internal::Type::Union
131
-
132
- variant String
133
-
134
- variant OpenAI::Internal::Type::Boolean
135
-
136
- # @!method self.variants
137
- # @return [Array(String, Boolean)]
138
- end
139
- end
140
- end
141
-
142
- class Score < OpenAI::Internal::Type::BaseModel
143
- # @!attribute instructions
144
- #
145
- # @return [String]
146
- required :instructions, String
147
-
148
- # @!attribute levels
149
- #
150
- # @return [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score::Level>]
151
- required(
152
- :levels,
153
- -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionsDelegationConfig::Question::Score::Level] }
154
- )
155
-
156
- # @!attribute type
157
- # The type of the object. Always `score`.
158
- #
159
- # @return [Symbol, :score]
160
- required :type, const: :score
161
-
162
- # @!attribute name
163
- #
164
- # @return [String, nil]
165
- optional :name, String
166
-
167
- # @!method initialize(instructions:, levels:, name: nil, type: :score)
168
- # Rate the input against the supplied ordered levels.
169
- #
170
- # @param instructions [String]
171
- #
172
- # @param levels [Array<OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score::Level>]
173
- #
174
- # @param name [String]
175
- #
176
- # @param type [Symbol, :score]
177
- # The type of the object. Always `score`.
178
- class Level < OpenAI::Internal::Type::BaseModel
179
- # @!attribute label
180
- #
181
- # @return [String]
182
- required :label, String
183
-
184
- # @!attribute description
185
- #
186
- # @return [String, nil]
187
- optional :description, String
188
-
189
- # @!method initialize(label:, description: nil)
190
- # @param label [String]
191
- # @param description [String]
192
- end
193
- end
194
-
195
- # @!method self.variants
196
- # @return [Array(OpenAI::Models::Live::DecisionsDelegationConfig::Question::Predicate, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Choice, OpenAI::Models::Live::DecisionsDelegationConfig::Question::Score)]
197
- end
24
+ require_relative "decision_question"
25
+ Question = ::OpenAI::Models::Live::DecisionQuestion
198
26
  end
199
27
  end
200
28
  end