openai 0.29.0 → 0.30.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 (178) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +4 -0
  5. data/lib/openai/internal/conversation_cursor_page.rb +2 -2
  6. data/lib/openai/models/all_models.rb +2 -0
  7. data/lib/openai/models/beta/chatkit/chat_session.rb +94 -0
  8. data/lib/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rb +22 -0
  9. data/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration.rb +38 -0
  10. data/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rb +125 -0
  11. data/lib/openai/models/beta/chatkit/chat_session_expires_after_param.rb +30 -0
  12. data/lib/openai/models/beta/chatkit/chat_session_file_upload.rb +38 -0
  13. data/lib/openai/models/beta/chatkit/chat_session_history.rb +34 -0
  14. data/lib/openai/models/beta/chatkit/chat_session_rate_limits.rb +22 -0
  15. data/lib/openai/models/beta/chatkit/chat_session_rate_limits_param.rb +22 -0
  16. data/lib/openai/models/beta/chatkit/chat_session_status.rb +20 -0
  17. data/lib/openai/models/beta/chatkit/chat_session_workflow_param.rb +80 -0
  18. data/lib/openai/models/beta/chatkit/chatkit_attachment.rb +69 -0
  19. data/lib/openai/models/beta/chatkit/chatkit_response_output_text.rb +143 -0
  20. data/lib/openai/models/beta/chatkit/chatkit_thread.rb +145 -0
  21. data/lib/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rb +65 -0
  22. data/lib/openai/models/beta/chatkit/chatkit_thread_item_list.rb +374 -0
  23. data/lib/openai/models/beta/chatkit/chatkit_thread_user_message_item.rb +183 -0
  24. data/lib/openai/models/beta/chatkit/chatkit_widget_item.rb +64 -0
  25. data/lib/openai/models/beta/chatkit/session_cancel_params.rb +18 -0
  26. data/lib/openai/models/beta/chatkit/session_create_params.rb +63 -0
  27. data/lib/openai/models/beta/chatkit/thread_delete_params.rb +18 -0
  28. data/lib/openai/models/beta/chatkit/thread_delete_response.rb +39 -0
  29. data/lib/openai/models/beta/chatkit/thread_list_items_params.rb +66 -0
  30. data/lib/openai/models/beta/chatkit/thread_list_params.rb +75 -0
  31. data/lib/openai/models/beta/chatkit/thread_retrieve_params.rb +18 -0
  32. data/lib/openai/models/beta/chatkit_upload_file_params.rb +28 -0
  33. data/lib/openai/models/beta/chatkit_upload_file_response.rb +25 -0
  34. data/lib/openai/models/beta/chatkit_workflow.rb +78 -0
  35. data/lib/openai/models/beta/file_part.rb +56 -0
  36. data/lib/openai/models/beta/image_part.rb +64 -0
  37. data/lib/openai/models/image_edit_params.rb +4 -2
  38. data/lib/openai/models/image_model.rb +1 -0
  39. data/lib/openai/models/realtime/realtime_session.rb +4 -0
  40. data/lib/openai/models/realtime/realtime_session_create_request.rb +12 -0
  41. data/lib/openai/models/realtime/realtime_session_create_response.rb +12 -0
  42. data/lib/openai/models/responses/tool.rb +5 -2
  43. data/lib/openai/models/responses_model.rb +2 -0
  44. data/lib/openai/models/video.rb +122 -0
  45. data/lib/openai/models/video_create_error.rb +21 -0
  46. data/lib/openai/models/video_create_params.rb +54 -0
  47. data/lib/openai/models/video_delete_params.rb +14 -0
  48. data/lib/openai/models/video_delete_response.rb +35 -0
  49. data/lib/openai/models/video_download_content_params.rb +34 -0
  50. data/lib/openai/models/video_list_params.rb +54 -0
  51. data/lib/openai/models/video_model.rb +15 -0
  52. data/lib/openai/models/video_remix_params.rb +22 -0
  53. data/lib/openai/models/video_retrieve_params.rb +14 -0
  54. data/lib/openai/models/video_seconds.rb +16 -0
  55. data/lib/openai/models/video_size.rb +17 -0
  56. data/lib/openai/models.rb +22 -0
  57. data/lib/openai/resources/beta/chatkit/sessions.rb +71 -0
  58. data/lib/openai/resources/beta/chatkit/threads.rb +126 -0
  59. data/lib/openai/resources/beta/chatkit.rb +50 -0
  60. data/lib/openai/resources/beta.rb +4 -0
  61. data/lib/openai/resources/videos.rb +165 -0
  62. data/lib/openai/version.rb +1 -1
  63. data/lib/openai.rb +46 -0
  64. data/rbi/openai/client.rbi +3 -0
  65. data/rbi/openai/models/all_models.rbi +10 -0
  66. data/rbi/openai/models/beta/chatkit/chat_session.rbi +141 -0
  67. data/rbi/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbi +35 -0
  68. data/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbi +87 -0
  69. data/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbi +256 -0
  70. data/rbi/openai/models/beta/chatkit/chat_session_expires_after_param.rbi +43 -0
  71. data/rbi/openai/models/beta/chatkit/chat_session_file_upload.rbi +61 -0
  72. data/rbi/openai/models/beta/chatkit/chat_session_history.rbi +52 -0
  73. data/rbi/openai/models/beta/chatkit/chat_session_rate_limits.rbi +37 -0
  74. data/rbi/openai/models/beta/chatkit/chat_session_rate_limits_param.rbi +40 -0
  75. data/rbi/openai/models/beta/chatkit/chat_session_status.rbi +43 -0
  76. data/rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi +166 -0
  77. data/rbi/openai/models/beta/chatkit/chatkit_attachment.rbi +116 -0
  78. data/rbi/openai/models/beta/chatkit/chatkit_response_output_text.rbi +287 -0
  79. data/rbi/openai/models/beta/chatkit/chatkit_thread.rbi +220 -0
  80. data/rbi/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbi +94 -0
  81. data/rbi/openai/models/beta/chatkit/chatkit_thread_item_list.rbi +590 -0
  82. data/rbi/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbi +324 -0
  83. data/rbi/openai/models/beta/chatkit/chatkit_widget_item.rbi +87 -0
  84. data/rbi/openai/models/beta/chatkit/session_cancel_params.rbi +34 -0
  85. data/rbi/openai/models/beta/chatkit/session_create_params.rbi +136 -0
  86. data/rbi/openai/models/beta/chatkit/thread_delete_params.rbi +34 -0
  87. data/rbi/openai/models/beta/chatkit/thread_delete_response.rbi +55 -0
  88. data/rbi/openai/models/beta/chatkit/thread_list_items_params.rbi +138 -0
  89. data/rbi/openai/models/beta/chatkit/thread_list_params.rbi +145 -0
  90. data/rbi/openai/models/beta/chatkit/thread_retrieve_params.rbi +34 -0
  91. data/rbi/openai/models/beta/chatkit_upload_file_params.rbi +50 -0
  92. data/rbi/openai/models/beta/chatkit_upload_file_response.rbi +25 -0
  93. data/rbi/openai/models/beta/chatkit_workflow.rbi +134 -0
  94. data/rbi/openai/models/beta/file_part.rbi +74 -0
  95. data/rbi/openai/models/beta/image_part.rbi +82 -0
  96. data/rbi/openai/models/image_edit_params.rbi +6 -3
  97. data/rbi/openai/models/image_model.rbi +2 -0
  98. data/rbi/openai/models/realtime/realtime_session.rbi +20 -0
  99. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +20 -0
  100. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +20 -0
  101. data/rbi/openai/models/responses/tool.rbi +11 -3
  102. data/rbi/openai/models/responses_model.rbi +10 -0
  103. data/rbi/openai/models/video.rbi +143 -0
  104. data/rbi/openai/models/video_create_error.rbi +26 -0
  105. data/rbi/openai/models/video_create_params.rbi +87 -0
  106. data/rbi/openai/models/video_delete_params.rbi +27 -0
  107. data/rbi/openai/models/video_delete_response.rbi +46 -0
  108. data/rbi/openai/models/video_download_content_params.rbi +89 -0
  109. data/rbi/openai/models/video_list_params.rbi +91 -0
  110. data/rbi/openai/models/video_model.rbi +19 -0
  111. data/rbi/openai/models/video_remix_params.rbi +40 -0
  112. data/rbi/openai/models/video_retrieve_params.rbi +27 -0
  113. data/rbi/openai/models/video_seconds.rbi +20 -0
  114. data/rbi/openai/models/video_size.rbi +23 -0
  115. data/rbi/openai/models.rbi +22 -0
  116. data/rbi/openai/resources/beta/chatkit/sessions.rbi +61 -0
  117. data/rbi/openai/resources/beta/chatkit/threads.rbi +110 -0
  118. data/rbi/openai/resources/beta/chatkit.rbi +35 -0
  119. data/rbi/openai/resources/beta.rbi +3 -0
  120. data/rbi/openai/resources/images.rbi +4 -2
  121. data/rbi/openai/resources/videos.rbi +121 -0
  122. data/sig/openai/client.rbs +2 -0
  123. data/sig/openai/models/all_models.rbs +4 -0
  124. data/sig/openai/models/beta/chatkit/chat_session.rbs +69 -0
  125. data/sig/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbs +17 -0
  126. data/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbs +34 -0
  127. data/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbs +103 -0
  128. data/sig/openai/models/beta/chatkit/chat_session_expires_after_param.rbs +20 -0
  129. data/sig/openai/models/beta/chatkit/chat_session_file_upload.rbs +30 -0
  130. data/sig/openai/models/beta/chatkit/chat_session_history.rbs +19 -0
  131. data/sig/openai/models/beta/chatkit/chat_session_rate_limits.rbs +18 -0
  132. data/sig/openai/models/beta/chatkit/chat_session_rate_limits_param.rbs +20 -0
  133. data/sig/openai/models/beta/chatkit/chat_session_status.rbs +19 -0
  134. data/sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs +69 -0
  135. data/sig/openai/models/beta/chatkit/chatkit_attachment.rbs +57 -0
  136. data/sig/openai/models/beta/chatkit/chatkit_response_output_text.rbs +114 -0
  137. data/sig/openai/models/beta/chatkit/chatkit_thread.rbs +96 -0
  138. data/sig/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbs +51 -0
  139. data/sig/openai/models/beta/chatkit/chatkit_thread_item_list.rbs +276 -0
  140. data/sig/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbs +127 -0
  141. data/sig/openai/models/beta/chatkit/chatkit_widget_item.rbs +51 -0
  142. data/sig/openai/models/beta/chatkit/session_cancel_params.rbs +19 -0
  143. data/sig/openai/models/beta/chatkit/session_create_params.rbs +62 -0
  144. data/sig/openai/models/beta/chatkit/thread_delete_params.rbs +19 -0
  145. data/sig/openai/models/beta/chatkit/thread_delete_response.rbs +30 -0
  146. data/sig/openai/models/beta/chatkit/thread_list_items_params.rbs +66 -0
  147. data/sig/openai/models/beta/chatkit/thread_list_params.rbs +73 -0
  148. data/sig/openai/models/beta/chatkit/thread_retrieve_params.rbs +19 -0
  149. data/sig/openai/models/beta/chatkit_upload_file_params.rbs +26 -0
  150. data/sig/openai/models/beta/chatkit_upload_file_response.rbs +14 -0
  151. data/sig/openai/models/beta/chatkit_workflow.rbs +55 -0
  152. data/sig/openai/models/beta/file_part.rbs +42 -0
  153. data/sig/openai/models/beta/image_part.rbs +47 -0
  154. data/sig/openai/models/image_model.rbs +3 -1
  155. data/sig/openai/models/realtime/realtime_session.rbs +8 -0
  156. data/sig/openai/models/realtime/realtime_session_create_request.rbs +8 -0
  157. data/sig/openai/models/realtime/realtime_session_create_response.rbs +8 -0
  158. data/sig/openai/models/responses/tool.rbs +2 -1
  159. data/sig/openai/models/responses_model.rbs +4 -0
  160. data/sig/openai/models/video.rbs +88 -0
  161. data/sig/openai/models/video_create_error.rbs +15 -0
  162. data/sig/openai/models/video_create_params.rbs +58 -0
  163. data/sig/openai/models/video_delete_params.rbs +14 -0
  164. data/sig/openai/models/video_delete_response.rbs +22 -0
  165. data/sig/openai/models/video_download_content_params.rbs +40 -0
  166. data/sig/openai/models/video_list_params.rbs +55 -0
  167. data/sig/openai/models/video_model.rbs +14 -0
  168. data/sig/openai/models/video_remix_params.rbs +23 -0
  169. data/sig/openai/models/video_retrieve_params.rbs +15 -0
  170. data/sig/openai/models/video_seconds.rbs +15 -0
  171. data/sig/openai/models/video_size.rbs +16 -0
  172. data/sig/openai/models.rbs +22 -0
  173. data/sig/openai/resources/beta/chatkit/sessions.rbs +25 -0
  174. data/sig/openai/resources/beta/chatkit/threads.rbs +39 -0
  175. data/sig/openai/resources/beta/chatkit.rbs +18 -0
  176. data/sig/openai/resources/beta.rbs +2 -0
  177. data/sig/openai/resources/videos.rbs +45 -0
  178. metadata +140 -2
@@ -0,0 +1,374 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Beta
6
+ module ChatKit
7
+ class ChatKitThreadItemList < OpenAI::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ # A list of items
10
+ #
11
+ # @return [Array<OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadAssistantMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitWidgetItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup>]
12
+ required :data,
13
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data] }
14
+
15
+ # @!attribute first_id
16
+ # The ID of the first item in the list.
17
+ #
18
+ # @return [String, nil]
19
+ required :first_id, String, nil?: true
20
+
21
+ # @!attribute has_more
22
+ # Whether there are more items available.
23
+ #
24
+ # @return [Boolean]
25
+ required :has_more, OpenAI::Internal::Type::Boolean
26
+
27
+ # @!attribute last_id
28
+ # The ID of the last item in the list.
29
+ #
30
+ # @return [String, nil]
31
+ required :last_id, String, nil?: true
32
+
33
+ # @!attribute object
34
+ # The type of object returned, must be `list`.
35
+ #
36
+ # @return [Symbol, :list]
37
+ required :object, const: :list
38
+
39
+ # @!method initialize(data:, first_id:, has_more:, last_id:, object: :list)
40
+ # A paginated list of thread items rendered for the ChatKit API.
41
+ #
42
+ # @param data [Array<OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadAssistantMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitWidgetItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup>] A list of items
43
+ #
44
+ # @param first_id [String, nil] The ID of the first item in the list.
45
+ #
46
+ # @param has_more [Boolean] Whether there are more items available.
47
+ #
48
+ # @param last_id [String, nil] The ID of the last item in the list.
49
+ #
50
+ # @param object [Symbol, :list] The type of object returned, must be `list`.
51
+
52
+ # User-authored messages within a thread.
53
+ module Data
54
+ extend OpenAI::Internal::Type::Union
55
+
56
+ discriminator :type
57
+
58
+ # User-authored messages within a thread.
59
+ variant :"chatkit.user_message", -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem }
60
+
61
+ # Assistant-authored message within a thread.
62
+ variant :"chatkit.assistant_message", -> { OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem }
63
+
64
+ # Thread item that renders a widget payload.
65
+ variant :"chatkit.widget", -> { OpenAI::Beta::ChatKit::ChatKitWidgetItem }
66
+
67
+ # Record of a client side tool invocation initiated by the assistant.
68
+ variant :"chatkit.client_tool_call",
69
+ -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall }
70
+
71
+ # Task emitted by the workflow to show progress and status updates.
72
+ variant :"chatkit.task", -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask }
73
+
74
+ # Collection of workflow tasks grouped together in the thread.
75
+ variant :"chatkit.task_group", -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup }
76
+
77
+ class ChatKitClientToolCall < OpenAI::Internal::Type::BaseModel
78
+ # @!attribute id
79
+ # Identifier of the thread item.
80
+ #
81
+ # @return [String]
82
+ required :id, String
83
+
84
+ # @!attribute arguments
85
+ # JSON-encoded arguments that were sent to the tool.
86
+ #
87
+ # @return [String]
88
+ required :arguments, String
89
+
90
+ # @!attribute call_id
91
+ # Identifier for the client tool call.
92
+ #
93
+ # @return [String]
94
+ required :call_id, String
95
+
96
+ # @!attribute created_at
97
+ # Unix timestamp (in seconds) for when the item was created.
98
+ #
99
+ # @return [Integer]
100
+ required :created_at, Integer
101
+
102
+ # @!attribute name
103
+ # Tool name that was invoked.
104
+ #
105
+ # @return [String]
106
+ required :name, String
107
+
108
+ # @!attribute object
109
+ # Type discriminator that is always `chatkit.thread_item`.
110
+ #
111
+ # @return [Symbol, :"chatkit.thread_item"]
112
+ required :object, const: :"chatkit.thread_item"
113
+
114
+ # @!attribute output
115
+ # JSON-encoded output captured from the tool. Defaults to null while execution is
116
+ # in progress.
117
+ #
118
+ # @return [String, nil]
119
+ required :output, String, nil?: true
120
+
121
+ # @!attribute status
122
+ # Execution status for the tool call.
123
+ #
124
+ # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status]
125
+ required :status,
126
+ enum: -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status }
127
+
128
+ # @!attribute thread_id
129
+ # Identifier of the parent thread.
130
+ #
131
+ # @return [String]
132
+ required :thread_id, String
133
+
134
+ # @!attribute type
135
+ # Type discriminator that is always `chatkit.client_tool_call`.
136
+ #
137
+ # @return [Symbol, :"chatkit.client_tool_call"]
138
+ required :type, const: :"chatkit.client_tool_call"
139
+
140
+ # @!method initialize(id:, arguments:, call_id:, created_at:, name:, output:, status:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.client_tool_call")
141
+ # Some parameter documentations has been truncated, see
142
+ # {OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall}
143
+ # for more details.
144
+ #
145
+ # Record of a client side tool invocation initiated by the assistant.
146
+ #
147
+ # @param id [String] Identifier of the thread item.
148
+ #
149
+ # @param arguments [String] JSON-encoded arguments that were sent to the tool.
150
+ #
151
+ # @param call_id [String] Identifier for the client tool call.
152
+ #
153
+ # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created.
154
+ #
155
+ # @param name [String] Tool name that was invoked.
156
+ #
157
+ # @param output [String, nil] JSON-encoded output captured from the tool. Defaults to null while execution is
158
+ #
159
+ # @param status [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status] Execution status for the tool call.
160
+ #
161
+ # @param thread_id [String] Identifier of the parent thread.
162
+ #
163
+ # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`.
164
+ #
165
+ # @param type [Symbol, :"chatkit.client_tool_call"] Type discriminator that is always `chatkit.client_tool_call`.
166
+
167
+ # Execution status for the tool call.
168
+ #
169
+ # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall#status
170
+ module Status
171
+ extend OpenAI::Internal::Type::Enum
172
+
173
+ IN_PROGRESS = :in_progress
174
+ COMPLETED = :completed
175
+
176
+ # @!method self.values
177
+ # @return [Array<Symbol>]
178
+ end
179
+ end
180
+
181
+ class ChatKitTask < OpenAI::Internal::Type::BaseModel
182
+ # @!attribute id
183
+ # Identifier of the thread item.
184
+ #
185
+ # @return [String]
186
+ required :id, String
187
+
188
+ # @!attribute created_at
189
+ # Unix timestamp (in seconds) for when the item was created.
190
+ #
191
+ # @return [Integer]
192
+ required :created_at, Integer
193
+
194
+ # @!attribute heading
195
+ # Optional heading for the task. Defaults to null when not provided.
196
+ #
197
+ # @return [String, nil]
198
+ required :heading, String, nil?: true
199
+
200
+ # @!attribute object
201
+ # Type discriminator that is always `chatkit.thread_item`.
202
+ #
203
+ # @return [Symbol, :"chatkit.thread_item"]
204
+ required :object, const: :"chatkit.thread_item"
205
+
206
+ # @!attribute summary
207
+ # Optional summary that describes the task. Defaults to null when omitted.
208
+ #
209
+ # @return [String, nil]
210
+ required :summary, String, nil?: true
211
+
212
+ # @!attribute task_type
213
+ # Subtype for the task.
214
+ #
215
+ # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType]
216
+ required :task_type,
217
+ enum: -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType }
218
+
219
+ # @!attribute thread_id
220
+ # Identifier of the parent thread.
221
+ #
222
+ # @return [String]
223
+ required :thread_id, String
224
+
225
+ # @!attribute type
226
+ # Type discriminator that is always `chatkit.task`.
227
+ #
228
+ # @return [Symbol, :"chatkit.task"]
229
+ required :type, const: :"chatkit.task"
230
+
231
+ # @!method initialize(id:, created_at:, heading:, summary:, task_type:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.task")
232
+ # Task emitted by the workflow to show progress and status updates.
233
+ #
234
+ # @param id [String] Identifier of the thread item.
235
+ #
236
+ # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created.
237
+ #
238
+ # @param heading [String, nil] Optional heading for the task. Defaults to null when not provided.
239
+ #
240
+ # @param summary [String, nil] Optional summary that describes the task. Defaults to null when omitted.
241
+ #
242
+ # @param task_type [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType] Subtype for the task.
243
+ #
244
+ # @param thread_id [String] Identifier of the parent thread.
245
+ #
246
+ # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`.
247
+ #
248
+ # @param type [Symbol, :"chatkit.task"] Type discriminator that is always `chatkit.task`.
249
+
250
+ # Subtype for the task.
251
+ #
252
+ # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask#task_type
253
+ module TaskType
254
+ extend OpenAI::Internal::Type::Enum
255
+
256
+ CUSTOM = :custom
257
+ THOUGHT = :thought
258
+
259
+ # @!method self.values
260
+ # @return [Array<Symbol>]
261
+ end
262
+ end
263
+
264
+ class ChatKitTaskGroup < OpenAI::Internal::Type::BaseModel
265
+ # @!attribute id
266
+ # Identifier of the thread item.
267
+ #
268
+ # @return [String]
269
+ required :id, String
270
+
271
+ # @!attribute created_at
272
+ # Unix timestamp (in seconds) for when the item was created.
273
+ #
274
+ # @return [Integer]
275
+ required :created_at, Integer
276
+
277
+ # @!attribute object
278
+ # Type discriminator that is always `chatkit.thread_item`.
279
+ #
280
+ # @return [Symbol, :"chatkit.thread_item"]
281
+ required :object, const: :"chatkit.thread_item"
282
+
283
+ # @!attribute tasks
284
+ # Tasks included in the group.
285
+ #
286
+ # @return [Array<OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task>]
287
+ required :tasks,
288
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task] }
289
+
290
+ # @!attribute thread_id
291
+ # Identifier of the parent thread.
292
+ #
293
+ # @return [String]
294
+ required :thread_id, String
295
+
296
+ # @!attribute type
297
+ # Type discriminator that is always `chatkit.task_group`.
298
+ #
299
+ # @return [Symbol, :"chatkit.task_group"]
300
+ required :type, const: :"chatkit.task_group"
301
+
302
+ # @!method initialize(id:, created_at:, tasks:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.task_group")
303
+ # Collection of workflow tasks grouped together in the thread.
304
+ #
305
+ # @param id [String] Identifier of the thread item.
306
+ #
307
+ # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created.
308
+ #
309
+ # @param tasks [Array<OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task>] Tasks included in the group.
310
+ #
311
+ # @param thread_id [String] Identifier of the parent thread.
312
+ #
313
+ # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`.
314
+ #
315
+ # @param type [Symbol, :"chatkit.task_group"] Type discriminator that is always `chatkit.task_group`.
316
+
317
+ class Task < OpenAI::Internal::Type::BaseModel
318
+ # @!attribute heading
319
+ # Optional heading for the grouped task. Defaults to null when not provided.
320
+ #
321
+ # @return [String, nil]
322
+ required :heading, String, nil?: true
323
+
324
+ # @!attribute summary
325
+ # Optional summary that describes the grouped task. Defaults to null when omitted.
326
+ #
327
+ # @return [String, nil]
328
+ required :summary, String, nil?: true
329
+
330
+ # @!attribute type
331
+ # Subtype for the grouped task.
332
+ #
333
+ # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type]
334
+ required :type,
335
+ enum: -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type }
336
+
337
+ # @!method initialize(heading:, summary:, type:)
338
+ # Some parameter documentations has been truncated, see
339
+ # {OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task}
340
+ # for more details.
341
+ #
342
+ # Task entry that appears within a TaskGroup.
343
+ #
344
+ # @param heading [String, nil] Optional heading for the grouped task. Defaults to null when not provided.
345
+ #
346
+ # @param summary [String, nil] Optional summary that describes the grouped task. Defaults to null when omitted.
347
+ #
348
+ # @param type [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type] Subtype for the grouped task.
349
+
350
+ # Subtype for the grouped task.
351
+ #
352
+ # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task#type
353
+ module Type
354
+ extend OpenAI::Internal::Type::Enum
355
+
356
+ CUSTOM = :custom
357
+ THOUGHT = :thought
358
+
359
+ # @!method self.values
360
+ # @return [Array<Symbol>]
361
+ end
362
+ end
363
+ end
364
+
365
+ # @!method self.variants
366
+ # @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadAssistantMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitWidgetItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup)]
367
+ end
368
+ end
369
+ end
370
+
371
+ ChatKitThreadItemList = ChatKit::ChatKitThreadItemList
372
+ end
373
+ end
374
+ end
@@ -0,0 +1,183 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Beta
6
+ module ChatKit
7
+ class ChatKitThreadUserMessageItem < OpenAI::Internal::Type::BaseModel
8
+ # @!attribute id
9
+ # Identifier of the thread item.
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute attachments
15
+ # Attachments associated with the user message. Defaults to an empty list.
16
+ #
17
+ # @return [Array<OpenAI::Models::Beta::ChatKit::ChatKitAttachment>]
18
+ required :attachments, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitAttachment] }
19
+
20
+ # @!attribute content
21
+ # Ordered content elements supplied by the user.
22
+ #
23
+ # @return [Array<OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText, OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText>]
24
+ required :content,
25
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content] }
26
+
27
+ # @!attribute created_at
28
+ # Unix timestamp (in seconds) for when the item was created.
29
+ #
30
+ # @return [Integer]
31
+ required :created_at, Integer
32
+
33
+ # @!attribute inference_options
34
+ # Inference overrides applied to the message. Defaults to null when unset.
35
+ #
36
+ # @return [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions, nil]
37
+ required :inference_options,
38
+ -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions },
39
+ nil?: true
40
+
41
+ # @!attribute object
42
+ # Type discriminator that is always `chatkit.thread_item`.
43
+ #
44
+ # @return [Symbol, :"chatkit.thread_item"]
45
+ required :object, const: :"chatkit.thread_item"
46
+
47
+ # @!attribute thread_id
48
+ # Identifier of the parent thread.
49
+ #
50
+ # @return [String]
51
+ required :thread_id, String
52
+
53
+ # @!attribute type
54
+ #
55
+ # @return [Symbol, :"chatkit.user_message"]
56
+ required :type, const: :"chatkit.user_message"
57
+
58
+ # @!method initialize(id:, attachments:, content:, created_at:, inference_options:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.user_message")
59
+ # User-authored messages within a thread.
60
+ #
61
+ # @param id [String] Identifier of the thread item.
62
+ #
63
+ # @param attachments [Array<OpenAI::Models::Beta::ChatKit::ChatKitAttachment>] Attachments associated with the user message. Defaults to an empty list.
64
+ #
65
+ # @param content [Array<OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText, OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText>] Ordered content elements supplied by the user.
66
+ #
67
+ # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created.
68
+ #
69
+ # @param inference_options [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions, nil] Inference overrides applied to the message. Defaults to null when unset.
70
+ #
71
+ # @param thread_id [String] Identifier of the parent thread.
72
+ #
73
+ # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`.
74
+ #
75
+ # @param type [Symbol, :"chatkit.user_message"]
76
+
77
+ # Content blocks that comprise a user message.
78
+ module Content
79
+ extend OpenAI::Internal::Type::Union
80
+
81
+ discriminator :type
82
+
83
+ # Text block that a user contributed to the thread.
84
+ variant :input_text, -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText }
85
+
86
+ # Quoted snippet that the user referenced in their message.
87
+ variant :quoted_text, -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText }
88
+
89
+ class InputText < OpenAI::Internal::Type::BaseModel
90
+ # @!attribute text
91
+ # Plain-text content supplied by the user.
92
+ #
93
+ # @return [String]
94
+ required :text, String
95
+
96
+ # @!attribute type
97
+ # Type discriminator that is always `input_text`.
98
+ #
99
+ # @return [Symbol, :input_text]
100
+ required :type, const: :input_text
101
+
102
+ # @!method initialize(text:, type: :input_text)
103
+ # Text block that a user contributed to the thread.
104
+ #
105
+ # @param text [String] Plain-text content supplied by the user.
106
+ #
107
+ # @param type [Symbol, :input_text] Type discriminator that is always `input_text`.
108
+ end
109
+
110
+ class QuotedText < OpenAI::Internal::Type::BaseModel
111
+ # @!attribute text
112
+ # Quoted text content.
113
+ #
114
+ # @return [String]
115
+ required :text, String
116
+
117
+ # @!attribute type
118
+ # Type discriminator that is always `quoted_text`.
119
+ #
120
+ # @return [Symbol, :quoted_text]
121
+ required :type, const: :quoted_text
122
+
123
+ # @!method initialize(text:, type: :quoted_text)
124
+ # Quoted snippet that the user referenced in their message.
125
+ #
126
+ # @param text [String] Quoted text content.
127
+ #
128
+ # @param type [Symbol, :quoted_text] Type discriminator that is always `quoted_text`.
129
+ end
130
+
131
+ # @!method self.variants
132
+ # @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText, OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText)]
133
+ end
134
+
135
+ # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem#inference_options
136
+ class InferenceOptions < OpenAI::Internal::Type::BaseModel
137
+ # @!attribute model
138
+ # Model name that generated the response. Defaults to null when using the session
139
+ # default.
140
+ #
141
+ # @return [String, nil]
142
+ required :model, String, nil?: true
143
+
144
+ # @!attribute tool_choice
145
+ # Preferred tool to invoke. Defaults to null when ChatKit should auto-select.
146
+ #
147
+ # @return [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice, nil]
148
+ required :tool_choice,
149
+ -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice },
150
+ nil?: true
151
+
152
+ # @!method initialize(model:, tool_choice:)
153
+ # Some parameter documentations has been truncated, see
154
+ # {OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions}
155
+ # for more details.
156
+ #
157
+ # Inference overrides applied to the message. Defaults to null when unset.
158
+ #
159
+ # @param model [String, nil] Model name that generated the response. Defaults to null when using the session
160
+ #
161
+ # @param tool_choice [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice, nil] Preferred tool to invoke. Defaults to null when ChatKit should auto-select.
162
+
163
+ # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions#tool_choice
164
+ class ToolChoice < OpenAI::Internal::Type::BaseModel
165
+ # @!attribute id
166
+ # Identifier of the requested tool.
167
+ #
168
+ # @return [String]
169
+ required :id, String
170
+
171
+ # @!method initialize(id:)
172
+ # Preferred tool to invoke. Defaults to null when ChatKit should auto-select.
173
+ #
174
+ # @param id [String] Identifier of the requested tool.
175
+ end
176
+ end
177
+ end
178
+ end
179
+
180
+ ChatKitThreadUserMessageItem = ChatKit::ChatKitThreadUserMessageItem
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Beta
6
+ module ChatKit
7
+ class ChatKitWidgetItem < OpenAI::Internal::Type::BaseModel
8
+ # @!attribute id
9
+ # Identifier of the thread item.
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute created_at
15
+ # Unix timestamp (in seconds) for when the item was created.
16
+ #
17
+ # @return [Integer]
18
+ required :created_at, Integer
19
+
20
+ # @!attribute object
21
+ # Type discriminator that is always `chatkit.thread_item`.
22
+ #
23
+ # @return [Symbol, :"chatkit.thread_item"]
24
+ required :object, const: :"chatkit.thread_item"
25
+
26
+ # @!attribute thread_id
27
+ # Identifier of the parent thread.
28
+ #
29
+ # @return [String]
30
+ required :thread_id, String
31
+
32
+ # @!attribute type
33
+ # Type discriminator that is always `chatkit.widget`.
34
+ #
35
+ # @return [Symbol, :"chatkit.widget"]
36
+ required :type, const: :"chatkit.widget"
37
+
38
+ # @!attribute widget
39
+ # Serialized widget payload rendered in the UI.
40
+ #
41
+ # @return [String]
42
+ required :widget, String
43
+
44
+ # @!method initialize(id:, created_at:, thread_id:, widget:, object: :"chatkit.thread_item", type: :"chatkit.widget")
45
+ # Thread item that renders a widget payload.
46
+ #
47
+ # @param id [String] Identifier of the thread item.
48
+ #
49
+ # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created.
50
+ #
51
+ # @param thread_id [String] Identifier of the parent thread.
52
+ #
53
+ # @param widget [String] Serialized widget payload rendered in the UI.
54
+ #
55
+ # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`.
56
+ #
57
+ # @param type [Symbol, :"chatkit.widget"] Type discriminator that is always `chatkit.widget`.
58
+ end
59
+ end
60
+
61
+ ChatKitWidgetItem = ChatKit::ChatKitWidgetItem
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Beta
6
+ module ChatKit
7
+ # @see OpenAI::Resources::Beta::ChatKit::Sessions#cancel
8
+ class SessionCancelParams < OpenAI::Internal::Type::BaseModel
9
+ extend OpenAI::Internal::Type::RequestParameters::Converter
10
+ include OpenAI::Internal::Type::RequestParameters
11
+
12
+ # @!method initialize(request_options: {})
13
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end