openai 0.28.1 → 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 (196) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -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/call_accept_params.rb +16 -0
  40. data/lib/openai/models/realtime/call_hangup_params.rb +16 -0
  41. data/lib/openai/models/realtime/call_refer_params.rb +28 -0
  42. data/lib/openai/models/realtime/call_reject_params.rb +28 -0
  43. data/lib/openai/models/realtime/realtime_session.rb +4 -0
  44. data/lib/openai/models/realtime/realtime_session_create_request.rb +12 -0
  45. data/lib/openai/models/realtime/realtime_session_create_response.rb +12 -0
  46. data/lib/openai/models/responses/tool.rb +5 -2
  47. data/lib/openai/models/responses_model.rb +2 -0
  48. data/lib/openai/models/video.rb +122 -0
  49. data/lib/openai/models/video_create_error.rb +21 -0
  50. data/lib/openai/models/video_create_params.rb +54 -0
  51. data/lib/openai/models/video_delete_params.rb +14 -0
  52. data/lib/openai/models/video_delete_response.rb +35 -0
  53. data/lib/openai/models/video_download_content_params.rb +34 -0
  54. data/lib/openai/models/video_list_params.rb +54 -0
  55. data/lib/openai/models/video_model.rb +15 -0
  56. data/lib/openai/models/video_remix_params.rb +22 -0
  57. data/lib/openai/models/video_retrieve_params.rb +14 -0
  58. data/lib/openai/models/video_seconds.rb +16 -0
  59. data/lib/openai/models/video_size.rb +17 -0
  60. data/lib/openai/models.rb +22 -0
  61. data/lib/openai/resources/beta/chatkit/sessions.rb +71 -0
  62. data/lib/openai/resources/beta/chatkit/threads.rb +126 -0
  63. data/lib/openai/resources/beta/chatkit.rb +50 -0
  64. data/lib/openai/resources/beta.rb +4 -0
  65. data/lib/openai/resources/realtime/calls.rb +143 -0
  66. data/lib/openai/resources/realtime.rb +4 -0
  67. data/lib/openai/resources/videos.rb +165 -0
  68. data/lib/openai/version.rb +1 -1
  69. data/lib/openai.rb +52 -1
  70. data/rbi/openai/client.rbi +3 -0
  71. data/rbi/openai/models/all_models.rbi +10 -0
  72. data/rbi/openai/models/beta/chatkit/chat_session.rbi +141 -0
  73. data/rbi/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbi +35 -0
  74. data/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbi +87 -0
  75. data/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbi +256 -0
  76. data/rbi/openai/models/beta/chatkit/chat_session_expires_after_param.rbi +43 -0
  77. data/rbi/openai/models/beta/chatkit/chat_session_file_upload.rbi +61 -0
  78. data/rbi/openai/models/beta/chatkit/chat_session_history.rbi +52 -0
  79. data/rbi/openai/models/beta/chatkit/chat_session_rate_limits.rbi +37 -0
  80. data/rbi/openai/models/beta/chatkit/chat_session_rate_limits_param.rbi +40 -0
  81. data/rbi/openai/models/beta/chatkit/chat_session_status.rbi +43 -0
  82. data/rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi +166 -0
  83. data/rbi/openai/models/beta/chatkit/chatkit_attachment.rbi +116 -0
  84. data/rbi/openai/models/beta/chatkit/chatkit_response_output_text.rbi +287 -0
  85. data/rbi/openai/models/beta/chatkit/chatkit_thread.rbi +220 -0
  86. data/rbi/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbi +94 -0
  87. data/rbi/openai/models/beta/chatkit/chatkit_thread_item_list.rbi +590 -0
  88. data/rbi/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbi +324 -0
  89. data/rbi/openai/models/beta/chatkit/chatkit_widget_item.rbi +87 -0
  90. data/rbi/openai/models/beta/chatkit/session_cancel_params.rbi +34 -0
  91. data/rbi/openai/models/beta/chatkit/session_create_params.rbi +136 -0
  92. data/rbi/openai/models/beta/chatkit/thread_delete_params.rbi +34 -0
  93. data/rbi/openai/models/beta/chatkit/thread_delete_response.rbi +55 -0
  94. data/rbi/openai/models/beta/chatkit/thread_list_items_params.rbi +138 -0
  95. data/rbi/openai/models/beta/chatkit/thread_list_params.rbi +145 -0
  96. data/rbi/openai/models/beta/chatkit/thread_retrieve_params.rbi +34 -0
  97. data/rbi/openai/models/beta/chatkit_upload_file_params.rbi +50 -0
  98. data/rbi/openai/models/beta/chatkit_upload_file_response.rbi +25 -0
  99. data/rbi/openai/models/beta/chatkit_workflow.rbi +134 -0
  100. data/rbi/openai/models/beta/file_part.rbi +74 -0
  101. data/rbi/openai/models/beta/image_part.rbi +82 -0
  102. data/rbi/openai/models/image_edit_params.rbi +6 -3
  103. data/rbi/openai/models/image_model.rbi +2 -0
  104. data/rbi/openai/models/realtime/call_accept_params.rbi +29 -0
  105. data/rbi/openai/models/realtime/call_hangup_params.rbi +29 -0
  106. data/rbi/openai/models/realtime/call_refer_params.rbi +44 -0
  107. data/rbi/openai/models/realtime/call_reject_params.rbi +47 -0
  108. data/rbi/openai/models/realtime/realtime_session.rbi +20 -0
  109. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +20 -0
  110. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +20 -0
  111. data/rbi/openai/models/responses/tool.rbi +11 -3
  112. data/rbi/openai/models/responses_model.rbi +10 -0
  113. data/rbi/openai/models/video.rbi +143 -0
  114. data/rbi/openai/models/video_create_error.rbi +26 -0
  115. data/rbi/openai/models/video_create_params.rbi +87 -0
  116. data/rbi/openai/models/video_delete_params.rbi +27 -0
  117. data/rbi/openai/models/video_delete_response.rbi +46 -0
  118. data/rbi/openai/models/video_download_content_params.rbi +89 -0
  119. data/rbi/openai/models/video_list_params.rbi +91 -0
  120. data/rbi/openai/models/video_model.rbi +19 -0
  121. data/rbi/openai/models/video_remix_params.rbi +40 -0
  122. data/rbi/openai/models/video_retrieve_params.rbi +27 -0
  123. data/rbi/openai/models/video_seconds.rbi +20 -0
  124. data/rbi/openai/models/video_size.rbi +23 -0
  125. data/rbi/openai/models.rbi +22 -0
  126. data/rbi/openai/resources/beta/chatkit/sessions.rbi +61 -0
  127. data/rbi/openai/resources/beta/chatkit/threads.rbi +110 -0
  128. data/rbi/openai/resources/beta/chatkit.rbi +35 -0
  129. data/rbi/openai/resources/beta.rbi +3 -0
  130. data/rbi/openai/resources/images.rbi +4 -2
  131. data/rbi/openai/resources/realtime/calls.rbi +182 -0
  132. data/rbi/openai/resources/realtime.rbi +3 -0
  133. data/rbi/openai/resources/videos.rbi +121 -0
  134. data/sig/openai/client.rbs +2 -0
  135. data/sig/openai/models/all_models.rbs +4 -0
  136. data/sig/openai/models/beta/chatkit/chat_session.rbs +69 -0
  137. data/sig/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbs +17 -0
  138. data/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbs +34 -0
  139. data/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbs +103 -0
  140. data/sig/openai/models/beta/chatkit/chat_session_expires_after_param.rbs +20 -0
  141. data/sig/openai/models/beta/chatkit/chat_session_file_upload.rbs +30 -0
  142. data/sig/openai/models/beta/chatkit/chat_session_history.rbs +19 -0
  143. data/sig/openai/models/beta/chatkit/chat_session_rate_limits.rbs +18 -0
  144. data/sig/openai/models/beta/chatkit/chat_session_rate_limits_param.rbs +20 -0
  145. data/sig/openai/models/beta/chatkit/chat_session_status.rbs +19 -0
  146. data/sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs +69 -0
  147. data/sig/openai/models/beta/chatkit/chatkit_attachment.rbs +57 -0
  148. data/sig/openai/models/beta/chatkit/chatkit_response_output_text.rbs +114 -0
  149. data/sig/openai/models/beta/chatkit/chatkit_thread.rbs +96 -0
  150. data/sig/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbs +51 -0
  151. data/sig/openai/models/beta/chatkit/chatkit_thread_item_list.rbs +276 -0
  152. data/sig/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbs +127 -0
  153. data/sig/openai/models/beta/chatkit/chatkit_widget_item.rbs +51 -0
  154. data/sig/openai/models/beta/chatkit/session_cancel_params.rbs +19 -0
  155. data/sig/openai/models/beta/chatkit/session_create_params.rbs +62 -0
  156. data/sig/openai/models/beta/chatkit/thread_delete_params.rbs +19 -0
  157. data/sig/openai/models/beta/chatkit/thread_delete_response.rbs +30 -0
  158. data/sig/openai/models/beta/chatkit/thread_list_items_params.rbs +66 -0
  159. data/sig/openai/models/beta/chatkit/thread_list_params.rbs +73 -0
  160. data/sig/openai/models/beta/chatkit/thread_retrieve_params.rbs +19 -0
  161. data/sig/openai/models/beta/chatkit_upload_file_params.rbs +26 -0
  162. data/sig/openai/models/beta/chatkit_upload_file_response.rbs +14 -0
  163. data/sig/openai/models/beta/chatkit_workflow.rbs +55 -0
  164. data/sig/openai/models/beta/file_part.rbs +42 -0
  165. data/sig/openai/models/beta/image_part.rbs +47 -0
  166. data/sig/openai/models/image_model.rbs +3 -1
  167. data/sig/openai/models/realtime/call_accept_params.rbs +17 -0
  168. data/sig/openai/models/realtime/call_hangup_params.rbs +17 -0
  169. data/sig/openai/models/realtime/call_refer_params.rbs +25 -0
  170. data/sig/openai/models/realtime/call_reject_params.rbs +27 -0
  171. data/sig/openai/models/realtime/realtime_session.rbs +8 -0
  172. data/sig/openai/models/realtime/realtime_session_create_request.rbs +8 -0
  173. data/sig/openai/models/realtime/realtime_session_create_response.rbs +8 -0
  174. data/sig/openai/models/responses/tool.rbs +2 -1
  175. data/sig/openai/models/responses_model.rbs +4 -0
  176. data/sig/openai/models/video.rbs +88 -0
  177. data/sig/openai/models/video_create_error.rbs +15 -0
  178. data/sig/openai/models/video_create_params.rbs +58 -0
  179. data/sig/openai/models/video_delete_params.rbs +14 -0
  180. data/sig/openai/models/video_delete_response.rbs +22 -0
  181. data/sig/openai/models/video_download_content_params.rbs +40 -0
  182. data/sig/openai/models/video_list_params.rbs +55 -0
  183. data/sig/openai/models/video_model.rbs +14 -0
  184. data/sig/openai/models/video_remix_params.rbs +23 -0
  185. data/sig/openai/models/video_retrieve_params.rbs +15 -0
  186. data/sig/openai/models/video_seconds.rbs +15 -0
  187. data/sig/openai/models/video_size.rbs +16 -0
  188. data/sig/openai/models.rbs +22 -0
  189. data/sig/openai/resources/beta/chatkit/sessions.rbs +25 -0
  190. data/sig/openai/resources/beta/chatkit/threads.rbs +39 -0
  191. data/sig/openai/resources/beta/chatkit.rbs +18 -0
  192. data/sig/openai/resources/beta.rbs +2 -0
  193. data/sig/openai/resources/realtime/calls.rbs +43 -0
  194. data/sig/openai/resources/realtime.rbs +2 -0
  195. data/sig/openai/resources/videos.rbs +45 -0
  196. metadata +155 -2
@@ -0,0 +1,182 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Resources
5
+ class Realtime
6
+ class Calls
7
+ # Accept an incoming SIP call and configure the realtime session that will handle
8
+ # it.
9
+ sig do
10
+ params(
11
+ call_id: String,
12
+ audio: OpenAI::Realtime::RealtimeAudioConfig::OrHash,
13
+ include:
14
+ T::Array[
15
+ OpenAI::Realtime::RealtimeSessionCreateRequest::Include::OrSymbol
16
+ ],
17
+ instructions: String,
18
+ max_output_tokens: T.any(Integer, Symbol),
19
+ model:
20
+ T.any(
21
+ String,
22
+ OpenAI::Realtime::RealtimeSessionCreateRequest::Model::OrSymbol
23
+ ),
24
+ output_modalities:
25
+ T::Array[
26
+ OpenAI::Realtime::RealtimeSessionCreateRequest::OutputModality::OrSymbol
27
+ ],
28
+ prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
29
+ tool_choice:
30
+ T.any(
31
+ OpenAI::Responses::ToolChoiceOptions::OrSymbol,
32
+ OpenAI::Responses::ToolChoiceFunction::OrHash,
33
+ OpenAI::Responses::ToolChoiceMcp::OrHash
34
+ ),
35
+ tools:
36
+ T::Array[
37
+ T.any(
38
+ OpenAI::Realtime::RealtimeFunctionTool::OrHash,
39
+ OpenAI::Realtime::RealtimeToolsConfigUnion::Mcp::OrHash
40
+ )
41
+ ],
42
+ tracing:
43
+ T.nilable(
44
+ T.any(
45
+ Symbol,
46
+ OpenAI::Realtime::RealtimeTracingConfig::TracingConfiguration::OrHash
47
+ )
48
+ ),
49
+ truncation:
50
+ T.any(
51
+ OpenAI::Realtime::RealtimeTruncation::RealtimeTruncationStrategy::OrSymbol,
52
+ OpenAI::Realtime::RealtimeTruncationRetentionRatio::OrHash
53
+ ),
54
+ type: Symbol,
55
+ request_options: OpenAI::RequestOptions::OrHash
56
+ ).void
57
+ end
58
+ def accept(
59
+ # The identifier for the call provided in the
60
+ # [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook_events/realtime/call/incoming)
61
+ # webhook.
62
+ call_id,
63
+ # Configuration for input and output audio.
64
+ audio: nil,
65
+ # Additional fields to include in server outputs.
66
+ #
67
+ # `item.input_audio_transcription.logprobs`: Include logprobs for input audio
68
+ # transcription.
69
+ include: nil,
70
+ # The default system instructions (i.e. system message) prepended to model calls.
71
+ # This field allows the client to guide the model on desired responses. The model
72
+ # can be instructed on response content and format, (e.g. "be extremely succinct",
73
+ # "act friendly", "here are examples of good responses") and on audio behavior
74
+ # (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
75
+ # instructions are not guaranteed to be followed by the model, but they provide
76
+ # guidance to the model on the desired behavior.
77
+ #
78
+ # Note that the server sets default instructions which will be used if this field
79
+ # is not set and are visible in the `session.created` event at the start of the
80
+ # session.
81
+ instructions: nil,
82
+ # Maximum number of output tokens for a single assistant response, inclusive of
83
+ # tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
84
+ # `inf` for the maximum available tokens for a given model. Defaults to `inf`.
85
+ max_output_tokens: nil,
86
+ # The Realtime model used for this session.
87
+ model: nil,
88
+ # The set of modalities the model can respond with. It defaults to `["audio"]`,
89
+ # indicating that the model will respond with audio plus a transcript. `["text"]`
90
+ # can be used to make the model respond with text only. It is not possible to
91
+ # request both `text` and `audio` at the same time.
92
+ output_modalities: nil,
93
+ # Reference to a prompt template and its variables.
94
+ # [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
95
+ prompt: nil,
96
+ # How the model chooses tools. Provide one of the string modes or force a specific
97
+ # function/MCP tool.
98
+ tool_choice: nil,
99
+ # Tools available to the model.
100
+ tools: nil,
101
+ # Realtime API can write session traces to the
102
+ # [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once
103
+ # tracing is enabled for a session, the configuration cannot be modified.
104
+ #
105
+ # `auto` will create a trace for the session with default values for the workflow
106
+ # name, group id, and metadata.
107
+ tracing: nil,
108
+ # Controls how the realtime conversation is truncated prior to model inference.
109
+ # The default is `auto`.
110
+ truncation: nil,
111
+ # The type of session to create. Always `realtime` for the Realtime API.
112
+ type: :realtime,
113
+ request_options: {}
114
+ )
115
+ end
116
+
117
+ # End an active Realtime API call, whether it was initiated over SIP or WebRTC.
118
+ sig do
119
+ params(
120
+ call_id: String,
121
+ request_options: OpenAI::RequestOptions::OrHash
122
+ ).void
123
+ end
124
+ def hangup(
125
+ # The identifier for the call. For SIP calls, use the value provided in the
126
+ # [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook_events/realtime/call/incoming)
127
+ # webhook. For WebRTC sessions, reuse the call ID returned in the `Location`
128
+ # header when creating the call with
129
+ # [`POST /v1/realtime/calls`](https://platform.openai.com/docs/api-reference/realtime/create-call).
130
+ call_id,
131
+ request_options: {}
132
+ )
133
+ end
134
+
135
+ # Transfer an active SIP call to a new destination using the SIP REFER verb.
136
+ sig do
137
+ params(
138
+ call_id: String,
139
+ target_uri: String,
140
+ request_options: OpenAI::RequestOptions::OrHash
141
+ ).void
142
+ end
143
+ def refer(
144
+ # The identifier for the call provided in the
145
+ # [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook_events/realtime/call/incoming)
146
+ # webhook.
147
+ call_id,
148
+ # URI that should appear in the SIP Refer-To header. Supports values like
149
+ # `tel:+14155550123` or `sip:agent@example.com`.
150
+ target_uri:,
151
+ request_options: {}
152
+ )
153
+ end
154
+
155
+ # Decline an incoming SIP call by returning a SIP status code to the caller.
156
+ sig do
157
+ params(
158
+ call_id: String,
159
+ status_code: Integer,
160
+ request_options: OpenAI::RequestOptions::OrHash
161
+ ).void
162
+ end
163
+ def reject(
164
+ # The identifier for the call provided in the
165
+ # [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook_events/realtime/call/incoming)
166
+ # webhook.
167
+ call_id,
168
+ # SIP response code to send back to the caller. Defaults to `603` (Decline) when
169
+ # omitted.
170
+ status_code: nil,
171
+ request_options: {}
172
+ )
173
+ end
174
+
175
+ # @api private
176
+ sig { params(client: OpenAI::Client).returns(T.attached_class) }
177
+ def self.new(client:)
178
+ end
179
+ end
180
+ end
181
+ end
182
+ end
@@ -6,6 +6,9 @@ module OpenAI
6
6
  sig { returns(OpenAI::Resources::Realtime::ClientSecrets) }
7
7
  attr_reader :client_secrets
8
8
 
9
+ sig { returns(OpenAI::Resources::Realtime::Calls) }
10
+ attr_reader :calls
11
+
9
12
  # @api private
10
13
  sig { params(client: OpenAI::Client).returns(T.attached_class) }
11
14
  def self.new(client:)
@@ -0,0 +1,121 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Resources
5
+ class Videos
6
+ # Create a video
7
+ sig do
8
+ params(
9
+ prompt: String,
10
+ input_reference: OpenAI::Internal::FileInput,
11
+ model: OpenAI::VideoModel::OrSymbol,
12
+ seconds: OpenAI::VideoSeconds::OrSymbol,
13
+ size: OpenAI::VideoSize::OrSymbol,
14
+ request_options: OpenAI::RequestOptions::OrHash
15
+ ).returns(OpenAI::Video)
16
+ end
17
+ def create(
18
+ # Text prompt that describes the video to generate.
19
+ prompt:,
20
+ # Optional image reference that guides generation.
21
+ input_reference: nil,
22
+ # The video generation model to use. Defaults to `sora-2`.
23
+ model: nil,
24
+ # Clip duration in seconds. Defaults to 4 seconds.
25
+ seconds: nil,
26
+ # Output resolution formatted as width x height. Defaults to 720x1280.
27
+ size: nil,
28
+ request_options: {}
29
+ )
30
+ end
31
+
32
+ # Retrieve a video
33
+ sig do
34
+ params(
35
+ video_id: String,
36
+ request_options: OpenAI::RequestOptions::OrHash
37
+ ).returns(OpenAI::Video)
38
+ end
39
+ def retrieve(
40
+ # The identifier of the video to retrieve.
41
+ video_id,
42
+ request_options: {}
43
+ )
44
+ end
45
+
46
+ # List videos
47
+ sig do
48
+ params(
49
+ after: String,
50
+ limit: Integer,
51
+ order: OpenAI::VideoListParams::Order::OrSymbol,
52
+ request_options: OpenAI::RequestOptions::OrHash
53
+ ).returns(OpenAI::Internal::ConversationCursorPage[OpenAI::Video])
54
+ end
55
+ def list(
56
+ # Identifier for the last item from the previous pagination request
57
+ after: nil,
58
+ # Number of items to retrieve
59
+ limit: nil,
60
+ # Sort order of results by timestamp. Use `asc` for ascending order or `desc` for
61
+ # descending order.
62
+ order: nil,
63
+ request_options: {}
64
+ )
65
+ end
66
+
67
+ # Delete a video
68
+ sig do
69
+ params(
70
+ video_id: String,
71
+ request_options: OpenAI::RequestOptions::OrHash
72
+ ).returns(OpenAI::Models::VideoDeleteResponse)
73
+ end
74
+ def delete(
75
+ # The identifier of the video to delete.
76
+ video_id,
77
+ request_options: {}
78
+ )
79
+ end
80
+
81
+ # Download video content
82
+ sig do
83
+ params(
84
+ video_id: String,
85
+ variant: OpenAI::VideoDownloadContentParams::Variant::OrSymbol,
86
+ request_options: OpenAI::RequestOptions::OrHash
87
+ ).returns(StringIO)
88
+ end
89
+ def download_content(
90
+ # The identifier of the video whose media to download.
91
+ video_id,
92
+ # Which downloadable asset to return. Defaults to the MP4 video.
93
+ variant: nil,
94
+ request_options: {}
95
+ )
96
+ end
97
+
98
+ # Create a video remix
99
+ sig do
100
+ params(
101
+ video_id: String,
102
+ prompt: String,
103
+ request_options: OpenAI::RequestOptions::OrHash
104
+ ).returns(OpenAI::Video)
105
+ end
106
+ def remix(
107
+ # The identifier of the completed video to remix.
108
+ video_id,
109
+ # Updated text prompt that directs the remix generation.
110
+ prompt:,
111
+ request_options: {}
112
+ )
113
+ end
114
+
115
+ # @api private
116
+ sig { params(client: OpenAI::Client).returns(T.attached_class) }
117
+ def self.new(client:)
118
+ end
119
+ end
120
+ end
121
+ end
@@ -54,6 +54,8 @@ module OpenAI
54
54
 
55
55
  attr_reader containers: OpenAI::Resources::Containers
56
56
 
57
+ attr_reader videos: OpenAI::Resources::Videos
58
+
57
59
  private def auth_headers: -> ::Hash[String, String]
58
60
 
59
61
  def initialize: (
@@ -20,6 +20,8 @@ module OpenAI
20
20
  | :"computer-use-preview"
21
21
  | :"computer-use-preview-2025-03-11"
22
22
  | :"gpt-5-codex"
23
+ | :"gpt-5-pro"
24
+ | :"gpt-5-pro-2025-10-06"
23
25
 
24
26
  module ResponsesOnlyModel
25
27
  extend OpenAI::Internal::Type::Enum
@@ -35,6 +37,8 @@ module OpenAI
35
37
  COMPUTER_USE_PREVIEW: :"computer-use-preview"
36
38
  COMPUTER_USE_PREVIEW_2025_03_11: :"computer-use-preview-2025-03-11"
37
39
  GPT_5_CODEX: :"gpt-5-codex"
40
+ GPT_5_PRO: :"gpt-5-pro"
41
+ GPT_5_PRO_2025_10_06: :"gpt-5-pro-2025-10-06"
38
42
 
39
43
  def self?.values: -> ::Array[OpenAI::Models::AllModels::responses_only_model]
40
44
  end
@@ -0,0 +1,69 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session =
6
+ {
7
+ id: String,
8
+ chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration,
9
+ client_secret: String,
10
+ expires_at: Integer,
11
+ :max_requests_per_1_minute => Integer,
12
+ object: :"chatkit.session",
13
+ rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits,
14
+ status: OpenAI::Models::Beta::ChatKit::chat_session_status,
15
+ user: String,
16
+ workflow: OpenAI::Beta::ChatKitWorkflow
17
+ }
18
+
19
+ class ChatSession < OpenAI::Internal::Type::BaseModel
20
+ attr_accessor id: String
21
+
22
+ attr_accessor chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration
23
+
24
+ attr_accessor client_secret: String
25
+
26
+ attr_accessor expires_at: Integer
27
+
28
+ attr_accessor max_requests_per_1_minute: Integer
29
+
30
+ attr_accessor object: :"chatkit.session"
31
+
32
+ attr_accessor rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits
33
+
34
+ attr_accessor status: OpenAI::Models::Beta::ChatKit::chat_session_status
35
+
36
+ attr_accessor user: String
37
+
38
+ attr_accessor workflow: OpenAI::Beta::ChatKitWorkflow
39
+
40
+ def initialize: (
41
+ id: String,
42
+ chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration,
43
+ client_secret: String,
44
+ expires_at: Integer,
45
+ max_requests_per_1_minute: Integer,
46
+ rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits,
47
+ status: OpenAI::Models::Beta::ChatKit::chat_session_status,
48
+ user: String,
49
+ workflow: OpenAI::Beta::ChatKitWorkflow,
50
+ ?object: :"chatkit.session"
51
+ ) -> void
52
+
53
+ def to_hash: -> {
54
+ id: String,
55
+ chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration,
56
+ client_secret: String,
57
+ expires_at: Integer,
58
+ :max_requests_per_1_minute => Integer,
59
+ object: :"chatkit.session",
60
+ rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits,
61
+ status: OpenAI::Models::Beta::ChatKit::chat_session_status,
62
+ user: String,
63
+ workflow: OpenAI::Beta::ChatKitWorkflow
64
+ }
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_automatic_thread_titling = { enabled: bool }
6
+
7
+ class ChatSessionAutomaticThreadTitling < OpenAI::Internal::Type::BaseModel
8
+ attr_accessor enabled: bool
9
+
10
+ def initialize: (enabled: bool) -> void
11
+
12
+ def to_hash: -> { enabled: bool }
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,34 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_chatkit_configuration =
6
+ {
7
+ automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling,
8
+ file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload,
9
+ history: OpenAI::Beta::ChatKit::ChatSessionHistory
10
+ }
11
+
12
+ class ChatSessionChatKitConfiguration < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling
14
+
15
+ attr_accessor file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload
16
+
17
+ attr_accessor history: OpenAI::Beta::ChatKit::ChatSessionHistory
18
+
19
+ def initialize: (
20
+ automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling,
21
+ file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload,
22
+ history: OpenAI::Beta::ChatKit::ChatSessionHistory
23
+ ) -> void
24
+
25
+ def to_hash: -> {
26
+ automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling,
27
+ file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload,
28
+ history: OpenAI::Beta::ChatKit::ChatSessionHistory
29
+ }
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,103 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_chatkit_configuration_param =
6
+ {
7
+ automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling,
8
+ file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload,
9
+ history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History
10
+ }
11
+
12
+ class ChatSessionChatKitConfigurationParam < OpenAI::Internal::Type::BaseModel
13
+ attr_reader automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling?
14
+
15
+ def automatic_thread_titling=: (
16
+ OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling
17
+ ) -> OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling
18
+
19
+ attr_reader file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload?
20
+
21
+ def file_upload=: (
22
+ OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload
23
+ ) -> OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload
24
+
25
+ attr_reader history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History?
26
+
27
+ def history=: (
28
+ OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History
29
+ ) -> OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History
30
+
31
+ def initialize: (
32
+ ?automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling,
33
+ ?file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload,
34
+ ?history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History
35
+ ) -> void
36
+
37
+ def to_hash: -> {
38
+ automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling,
39
+ file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload,
40
+ history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History
41
+ }
42
+
43
+ type automatic_thread_titling = { enabled: bool }
44
+
45
+ class AutomaticThreadTitling < OpenAI::Internal::Type::BaseModel
46
+ attr_reader enabled: bool?
47
+
48
+ def enabled=: (bool) -> bool
49
+
50
+ def initialize: (?enabled: bool) -> void
51
+
52
+ def to_hash: -> { enabled: bool }
53
+ end
54
+
55
+ type file_upload =
56
+ { enabled: bool, max_file_size: Integer, max_files: Integer }
57
+
58
+ class FileUpload < OpenAI::Internal::Type::BaseModel
59
+ attr_reader enabled: bool?
60
+
61
+ def enabled=: (bool) -> bool
62
+
63
+ attr_reader max_file_size: Integer?
64
+
65
+ def max_file_size=: (Integer) -> Integer
66
+
67
+ attr_reader max_files: Integer?
68
+
69
+ def max_files=: (Integer) -> Integer
70
+
71
+ def initialize: (
72
+ ?enabled: bool,
73
+ ?max_file_size: Integer,
74
+ ?max_files: Integer
75
+ ) -> void
76
+
77
+ def to_hash: -> {
78
+ enabled: bool,
79
+ max_file_size: Integer,
80
+ max_files: Integer
81
+ }
82
+ end
83
+
84
+ type history = { enabled: bool, recent_threads: Integer }
85
+
86
+ class History < OpenAI::Internal::Type::BaseModel
87
+ attr_reader enabled: bool?
88
+
89
+ def enabled=: (bool) -> bool
90
+
91
+ attr_reader recent_threads: Integer?
92
+
93
+ def recent_threads=: (Integer) -> Integer
94
+
95
+ def initialize: (?enabled: bool, ?recent_threads: Integer) -> void
96
+
97
+ def to_hash: -> { enabled: bool, recent_threads: Integer }
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,20 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_expires_after_param =
6
+ { anchor: :created_at, seconds: Integer }
7
+
8
+ class ChatSessionExpiresAfterParam < OpenAI::Internal::Type::BaseModel
9
+ attr_accessor anchor: :created_at
10
+
11
+ attr_accessor seconds: Integer
12
+
13
+ def initialize: (seconds: Integer, ?anchor: :created_at) -> void
14
+
15
+ def to_hash: -> { anchor: :created_at, seconds: Integer }
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,30 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_file_upload =
6
+ { enabled: bool, max_file_size: Integer?, max_files: Integer? }
7
+
8
+ class ChatSessionFileUpload < OpenAI::Internal::Type::BaseModel
9
+ attr_accessor enabled: bool
10
+
11
+ attr_accessor max_file_size: Integer?
12
+
13
+ attr_accessor max_files: Integer?
14
+
15
+ def initialize: (
16
+ enabled: bool,
17
+ max_file_size: Integer?,
18
+ max_files: Integer?
19
+ ) -> void
20
+
21
+ def to_hash: -> {
22
+ enabled: bool,
23
+ max_file_size: Integer?,
24
+ max_files: Integer?
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,19 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_history = { enabled: bool, recent_threads: Integer? }
6
+
7
+ class ChatSessionHistory < OpenAI::Internal::Type::BaseModel
8
+ attr_accessor enabled: bool
9
+
10
+ attr_accessor recent_threads: Integer?
11
+
12
+ def initialize: (enabled: bool, recent_threads: Integer?) -> void
13
+
14
+ def to_hash: -> { enabled: bool, recent_threads: Integer? }
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_rate_limits =
6
+ { :max_requests_per_1_minute => Integer }
7
+
8
+ class ChatSessionRateLimits < OpenAI::Internal::Type::BaseModel
9
+ attr_accessor max_requests_per_1_minute: Integer
10
+
11
+ def initialize: (max_requests_per_1_minute: Integer) -> void
12
+
13
+ def to_hash: -> { :max_requests_per_1_minute => Integer }
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module ChatKit
5
+ type chat_session_rate_limits_param =
6
+ { :max_requests_per_1_minute => Integer }
7
+
8
+ class ChatSessionRateLimitsParam < OpenAI::Internal::Type::BaseModel
9
+ attr_reader max_requests_per_1_minute: Integer?
10
+
11
+ def max_requests_per_1_minute=: (Integer) -> Integer
12
+
13
+ def initialize: (?max_requests_per_1_minute: Integer) -> void
14
+
15
+ def to_hash: -> { :max_requests_per_1_minute => Integer }
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end