openai 0.22.1 → 0.23.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 (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/realtime/audio_transcription.rb +60 -0
  5. data/lib/openai/models/realtime/client_secret_create_params.rb +18 -9
  6. data/lib/openai/models/realtime/client_secret_create_response.rb +11 -250
  7. data/lib/openai/models/realtime/conversation_item.rb +1 -1
  8. data/lib/openai/models/realtime/conversation_item_added.rb +14 -1
  9. data/lib/openai/models/realtime/conversation_item_done.rb +3 -0
  10. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +10 -8
  11. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +14 -5
  12. data/lib/openai/models/realtime/conversation_item_truncate_event.rb +2 -2
  13. data/lib/openai/models/realtime/input_audio_buffer_append_event.rb +10 -5
  14. data/lib/openai/models/realtime/models.rb +58 -0
  15. data/lib/openai/models/realtime/noise_reduction_type.rb +20 -0
  16. data/lib/openai/models/realtime/realtime_audio_config.rb +6 -427
  17. data/lib/openai/models/realtime/realtime_audio_config_input.rb +89 -0
  18. data/lib/openai/models/realtime/realtime_audio_config_output.rb +100 -0
  19. data/lib/openai/models/realtime/realtime_audio_formats.rb +121 -0
  20. data/lib/openai/models/realtime/realtime_audio_input_turn_detection.rb +131 -0
  21. data/lib/openai/models/realtime/realtime_client_event.rb +31 -23
  22. data/lib/openai/models/realtime/realtime_conversation_item_assistant_message.rb +43 -10
  23. data/lib/openai/models/realtime/realtime_conversation_item_function_call.rb +16 -7
  24. data/lib/openai/models/realtime/realtime_conversation_item_function_call_output.rb +15 -7
  25. data/lib/openai/models/realtime/realtime_conversation_item_system_message.rb +18 -6
  26. data/lib/openai/models/realtime/realtime_conversation_item_user_message.rb +62 -13
  27. data/lib/openai/models/realtime/realtime_response.rb +117 -107
  28. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +100 -0
  29. data/lib/openai/models/realtime/realtime_response_create_mcp_tool.rb +310 -0
  30. data/lib/openai/models/realtime/realtime_response_create_params.rb +225 -0
  31. data/lib/openai/models/realtime/realtime_response_status.rb +1 -1
  32. data/lib/openai/models/realtime/realtime_response_usage.rb +5 -2
  33. data/lib/openai/models/realtime/realtime_response_usage_input_token_details.rb +58 -8
  34. data/lib/openai/models/realtime/realtime_server_event.rb +21 -5
  35. data/lib/openai/models/realtime/realtime_session.rb +9 -125
  36. data/lib/openai/models/realtime/realtime_session_client_secret.rb +36 -0
  37. data/lib/openai/models/realtime/realtime_session_create_request.rb +50 -71
  38. data/lib/openai/models/realtime/realtime_session_create_response.rb +621 -219
  39. data/lib/openai/models/realtime/realtime_tools_config_union.rb +2 -53
  40. data/lib/openai/models/realtime/realtime_tracing_config.rb +7 -6
  41. data/lib/openai/models/realtime/realtime_transcription_session_audio.rb +19 -0
  42. data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +90 -0
  43. data/lib/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rb +131 -0
  44. data/lib/openai/models/realtime/realtime_transcription_session_client_secret.rb +38 -0
  45. data/lib/openai/models/realtime/realtime_transcription_session_create_request.rb +12 -270
  46. data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +78 -0
  47. data/lib/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rb +66 -0
  48. data/lib/openai/models/realtime/realtime_transcription_session_turn_detection.rb +57 -0
  49. data/lib/openai/models/realtime/realtime_truncation.rb +8 -40
  50. data/lib/openai/models/realtime/realtime_truncation_retention_ratio.rb +34 -0
  51. data/lib/openai/models/realtime/response_cancel_event.rb +3 -1
  52. data/lib/openai/models/realtime/response_create_event.rb +18 -348
  53. data/lib/openai/models/realtime/response_done_event.rb +7 -0
  54. data/lib/openai/models/realtime/session_created_event.rb +20 -4
  55. data/lib/openai/models/realtime/session_update_event.rb +36 -12
  56. data/lib/openai/models/realtime/session_updated_event.rb +20 -4
  57. data/lib/openai/models/realtime/transcription_session_created.rb +8 -243
  58. data/lib/openai/models/realtime/transcription_session_update.rb +179 -3
  59. data/lib/openai/models/realtime/transcription_session_updated_event.rb +8 -243
  60. data/lib/openai/resources/realtime/client_secrets.rb +2 -3
  61. data/lib/openai/version.rb +1 -1
  62. data/lib/openai.rb +19 -1
  63. data/rbi/openai/models/realtime/audio_transcription.rbi +132 -0
  64. data/rbi/openai/models/realtime/client_secret_create_params.rbi +25 -11
  65. data/rbi/openai/models/realtime/client_secret_create_response.rbi +2 -587
  66. data/rbi/openai/models/realtime/conversation_item_added.rbi +14 -1
  67. data/rbi/openai/models/realtime/conversation_item_done.rbi +3 -0
  68. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +11 -8
  69. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +15 -5
  70. data/rbi/openai/models/realtime/conversation_item_truncate_event.rbi +2 -2
  71. data/rbi/openai/models/realtime/input_audio_buffer_append_event.rbi +10 -5
  72. data/rbi/openai/models/realtime/models.rbi +97 -0
  73. data/rbi/openai/models/realtime/noise_reduction_type.rbi +31 -0
  74. data/rbi/openai/models/realtime/realtime_audio_config.rbi +8 -956
  75. data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +221 -0
  76. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +222 -0
  77. data/rbi/openai/models/realtime/realtime_audio_formats.rbi +329 -0
  78. data/rbi/openai/models/realtime/realtime_audio_input_turn_detection.rbi +262 -0
  79. data/rbi/openai/models/realtime/realtime_conversation_item_assistant_message.rbi +51 -10
  80. data/rbi/openai/models/realtime/realtime_conversation_item_function_call.rbi +16 -7
  81. data/rbi/openai/models/realtime/realtime_conversation_item_function_call_output.rbi +14 -7
  82. data/rbi/openai/models/realtime/realtime_conversation_item_system_message.rbi +16 -6
  83. data/rbi/openai/models/realtime/realtime_conversation_item_user_message.rbi +110 -12
  84. data/rbi/openai/models/realtime/realtime_response.rbi +287 -212
  85. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +250 -0
  86. data/rbi/openai/models/realtime/realtime_response_create_mcp_tool.rbi +616 -0
  87. data/rbi/openai/models/realtime/realtime_response_create_params.rbi +529 -0
  88. data/rbi/openai/models/realtime/realtime_response_usage.rbi +8 -2
  89. data/rbi/openai/models/realtime/realtime_response_usage_input_token_details.rbi +106 -7
  90. data/rbi/openai/models/realtime/realtime_server_event.rbi +4 -1
  91. data/rbi/openai/models/realtime/realtime_session.rbi +12 -262
  92. data/rbi/openai/models/realtime/realtime_session_client_secret.rbi +49 -0
  93. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +112 -133
  94. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +1229 -405
  95. data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +1 -117
  96. data/rbi/openai/models/realtime/realtime_tracing_config.rbi +11 -10
  97. data/rbi/openai/models/realtime/realtime_transcription_session_audio.rbi +50 -0
  98. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +226 -0
  99. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbi +259 -0
  100. data/rbi/openai/models/realtime/realtime_transcription_session_client_secret.rbi +51 -0
  101. data/rbi/openai/models/realtime/realtime_transcription_session_create_request.rbi +25 -597
  102. data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +195 -0
  103. data/rbi/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbi +144 -0
  104. data/rbi/openai/models/realtime/realtime_transcription_session_turn_detection.rbi +94 -0
  105. data/rbi/openai/models/realtime/realtime_truncation.rbi +5 -56
  106. data/rbi/openai/models/realtime/realtime_truncation_retention_ratio.rbi +45 -0
  107. data/rbi/openai/models/realtime/response_cancel_event.rbi +3 -1
  108. data/rbi/openai/models/realtime/response_create_event.rbi +19 -786
  109. data/rbi/openai/models/realtime/response_done_event.rbi +7 -0
  110. data/rbi/openai/models/realtime/session_created_event.rbi +42 -9
  111. data/rbi/openai/models/realtime/session_update_event.rbi +57 -19
  112. data/rbi/openai/models/realtime/session_updated_event.rbi +42 -9
  113. data/rbi/openai/models/realtime/transcription_session_created.rbi +17 -591
  114. data/rbi/openai/models/realtime/transcription_session_update.rbi +425 -7
  115. data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +14 -591
  116. data/rbi/openai/resources/realtime/client_secrets.rbi +5 -3
  117. data/sig/openai/models/realtime/audio_transcription.rbs +57 -0
  118. data/sig/openai/models/realtime/client_secret_create_response.rbs +1 -251
  119. data/sig/openai/models/realtime/models.rbs +57 -0
  120. data/sig/openai/models/realtime/noise_reduction_type.rbs +16 -0
  121. data/sig/openai/models/realtime/realtime_audio_config.rbs +12 -331
  122. data/sig/openai/models/realtime/realtime_audio_config_input.rbs +72 -0
  123. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +72 -0
  124. data/sig/openai/models/realtime/realtime_audio_formats.rbs +128 -0
  125. data/sig/openai/models/realtime/realtime_audio_input_turn_detection.rbs +99 -0
  126. data/sig/openai/models/realtime/realtime_conversation_item_assistant_message.rbs +17 -2
  127. data/sig/openai/models/realtime/realtime_conversation_item_user_message.rbs +30 -1
  128. data/sig/openai/models/realtime/realtime_response.rbs +103 -82
  129. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +84 -0
  130. data/sig/openai/models/realtime/realtime_response_create_mcp_tool.rbs +218 -0
  131. data/sig/openai/models/realtime/realtime_response_create_params.rbs +148 -0
  132. data/sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs +50 -1
  133. data/sig/openai/models/realtime/realtime_session.rbs +16 -106
  134. data/sig/openai/models/realtime/realtime_session_client_secret.rbs +20 -0
  135. data/sig/openai/models/realtime/realtime_session_create_request.rbs +27 -43
  136. data/sig/openai/models/realtime/realtime_session_create_response.rbs +389 -187
  137. data/sig/openai/models/realtime/realtime_tools_config_union.rbs +1 -53
  138. data/sig/openai/models/realtime/realtime_transcription_session_audio.rbs +24 -0
  139. data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +72 -0
  140. data/sig/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbs +99 -0
  141. data/sig/openai/models/realtime/realtime_transcription_session_client_secret.rbs +20 -0
  142. data/sig/openai/models/realtime/realtime_transcription_session_create_request.rbs +11 -203
  143. data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +69 -0
  144. data/sig/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbs +59 -0
  145. data/sig/openai/models/realtime/realtime_transcription_session_turn_detection.rbs +47 -0
  146. data/sig/openai/models/realtime/realtime_truncation.rbs +1 -28
  147. data/sig/openai/models/realtime/realtime_truncation_retention_ratio.rbs +21 -0
  148. data/sig/openai/models/realtime/response_create_event.rbs +6 -249
  149. data/sig/openai/models/realtime/session_created_event.rbs +14 -4
  150. data/sig/openai/models/realtime/session_update_event.rbs +14 -4
  151. data/sig/openai/models/realtime/session_updated_event.rbs +14 -4
  152. data/sig/openai/models/realtime/transcription_session_created.rbs +4 -254
  153. data/sig/openai/models/realtime/transcription_session_update.rbs +154 -4
  154. data/sig/openai/models/realtime/transcription_session_updated_event.rbs +4 -254
  155. metadata +59 -5
  156. data/lib/openai/models/realtime/realtime_client_secret_config.rb +0 -64
  157. data/rbi/openai/models/realtime/realtime_client_secret_config.rbi +0 -147
  158. data/sig/openai/models/realtime/realtime_client_secret_config.rbs +0 -60
@@ -0,0 +1,616 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeResponseCreateMcpTool < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # A label for this MCP server, used to identify it in tool calls.
16
+ sig { returns(String) }
17
+ attr_accessor :server_label
18
+
19
+ # The type of the MCP tool. Always `mcp`.
20
+ sig { returns(Symbol) }
21
+ attr_accessor :type
22
+
23
+ # List of allowed tool names or a filter object.
24
+ sig do
25
+ returns(
26
+ T.nilable(
27
+ T.any(
28
+ T::Array[String],
29
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::AllowedTools::McpToolFilter
30
+ )
31
+ )
32
+ )
33
+ end
34
+ attr_accessor :allowed_tools
35
+
36
+ # An OAuth access token that can be used with a remote MCP server, either with a
37
+ # custom MCP server URL or a service connector. Your application must handle the
38
+ # OAuth authorization flow and provide the token here.
39
+ sig { returns(T.nilable(String)) }
40
+ attr_reader :authorization
41
+
42
+ sig { params(authorization: String).void }
43
+ attr_writer :authorization
44
+
45
+ # Identifier for service connectors, like those available in ChatGPT. One of
46
+ # `server_url` or `connector_id` must be provided. Learn more about service
47
+ # connectors
48
+ # [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
49
+ #
50
+ # Currently supported `connector_id` values are:
51
+ #
52
+ # - Dropbox: `connector_dropbox`
53
+ # - Gmail: `connector_gmail`
54
+ # - Google Calendar: `connector_googlecalendar`
55
+ # - Google Drive: `connector_googledrive`
56
+ # - Microsoft Teams: `connector_microsoftteams`
57
+ # - Outlook Calendar: `connector_outlookcalendar`
58
+ # - Outlook Email: `connector_outlookemail`
59
+ # - SharePoint: `connector_sharepoint`
60
+ sig do
61
+ returns(
62
+ T.nilable(
63
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::OrSymbol
64
+ )
65
+ )
66
+ end
67
+ attr_reader :connector_id
68
+
69
+ sig do
70
+ params(
71
+ connector_id:
72
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::OrSymbol
73
+ ).void
74
+ end
75
+ attr_writer :connector_id
76
+
77
+ # Optional HTTP headers to send to the MCP server. Use for authentication or other
78
+ # purposes.
79
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
80
+ attr_accessor :headers
81
+
82
+ # Specify which of the MCP server's tools require approval.
83
+ sig do
84
+ returns(
85
+ T.nilable(
86
+ T.any(
87
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter,
88
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting::OrSymbol
89
+ )
90
+ )
91
+ )
92
+ end
93
+ attr_accessor :require_approval
94
+
95
+ # Optional description of the MCP server, used to provide more context.
96
+ sig { returns(T.nilable(String)) }
97
+ attr_reader :server_description
98
+
99
+ sig { params(server_description: String).void }
100
+ attr_writer :server_description
101
+
102
+ # The URL for the MCP server. One of `server_url` or `connector_id` must be
103
+ # provided.
104
+ sig { returns(T.nilable(String)) }
105
+ attr_reader :server_url
106
+
107
+ sig { params(server_url: String).void }
108
+ attr_writer :server_url
109
+
110
+ # Give the model access to additional tools via remote Model Context Protocol
111
+ # (MCP) servers.
112
+ # [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
113
+ sig do
114
+ params(
115
+ server_label: String,
116
+ allowed_tools:
117
+ T.nilable(
118
+ T.any(
119
+ T::Array[String],
120
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::AllowedTools::McpToolFilter::OrHash
121
+ )
122
+ ),
123
+ authorization: String,
124
+ connector_id:
125
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::OrSymbol,
126
+ headers: T.nilable(T::Hash[Symbol, String]),
127
+ require_approval:
128
+ T.nilable(
129
+ T.any(
130
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::OrHash,
131
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting::OrSymbol
132
+ )
133
+ ),
134
+ server_description: String,
135
+ server_url: String,
136
+ type: Symbol
137
+ ).returns(T.attached_class)
138
+ end
139
+ def self.new(
140
+ # A label for this MCP server, used to identify it in tool calls.
141
+ server_label:,
142
+ # List of allowed tool names or a filter object.
143
+ allowed_tools: nil,
144
+ # An OAuth access token that can be used with a remote MCP server, either with a
145
+ # custom MCP server URL or a service connector. Your application must handle the
146
+ # OAuth authorization flow and provide the token here.
147
+ authorization: nil,
148
+ # Identifier for service connectors, like those available in ChatGPT. One of
149
+ # `server_url` or `connector_id` must be provided. Learn more about service
150
+ # connectors
151
+ # [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
152
+ #
153
+ # Currently supported `connector_id` values are:
154
+ #
155
+ # - Dropbox: `connector_dropbox`
156
+ # - Gmail: `connector_gmail`
157
+ # - Google Calendar: `connector_googlecalendar`
158
+ # - Google Drive: `connector_googledrive`
159
+ # - Microsoft Teams: `connector_microsoftteams`
160
+ # - Outlook Calendar: `connector_outlookcalendar`
161
+ # - Outlook Email: `connector_outlookemail`
162
+ # - SharePoint: `connector_sharepoint`
163
+ connector_id: nil,
164
+ # Optional HTTP headers to send to the MCP server. Use for authentication or other
165
+ # purposes.
166
+ headers: nil,
167
+ # Specify which of the MCP server's tools require approval.
168
+ require_approval: nil,
169
+ # Optional description of the MCP server, used to provide more context.
170
+ server_description: nil,
171
+ # The URL for the MCP server. One of `server_url` or `connector_id` must be
172
+ # provided.
173
+ server_url: nil,
174
+ # The type of the MCP tool. Always `mcp`.
175
+ type: :mcp
176
+ )
177
+ end
178
+
179
+ sig do
180
+ override.returns(
181
+ {
182
+ server_label: String,
183
+ type: Symbol,
184
+ allowed_tools:
185
+ T.nilable(
186
+ T.any(
187
+ T::Array[String],
188
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::AllowedTools::McpToolFilter
189
+ )
190
+ ),
191
+ authorization: String,
192
+ connector_id:
193
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::OrSymbol,
194
+ headers: T.nilable(T::Hash[Symbol, String]),
195
+ require_approval:
196
+ T.nilable(
197
+ T.any(
198
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter,
199
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting::OrSymbol
200
+ )
201
+ ),
202
+ server_description: String,
203
+ server_url: String
204
+ }
205
+ )
206
+ end
207
+ def to_hash
208
+ end
209
+
210
+ # List of allowed tool names or a filter object.
211
+ module AllowedTools
212
+ extend OpenAI::Internal::Type::Union
213
+
214
+ Variants =
215
+ T.type_alias do
216
+ T.any(
217
+ T::Array[String],
218
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::AllowedTools::McpToolFilter
219
+ )
220
+ end
221
+
222
+ class McpToolFilter < OpenAI::Internal::Type::BaseModel
223
+ OrHash =
224
+ T.type_alias do
225
+ T.any(
226
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::AllowedTools::McpToolFilter,
227
+ OpenAI::Internal::AnyHash
228
+ )
229
+ end
230
+
231
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
232
+ # is
233
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
234
+ # it will match this filter.
235
+ sig { returns(T.nilable(T::Boolean)) }
236
+ attr_reader :read_only
237
+
238
+ sig { params(read_only: T::Boolean).void }
239
+ attr_writer :read_only
240
+
241
+ # List of allowed tool names.
242
+ sig { returns(T.nilable(T::Array[String])) }
243
+ attr_reader :tool_names
244
+
245
+ sig { params(tool_names: T::Array[String]).void }
246
+ attr_writer :tool_names
247
+
248
+ # A filter object to specify which tools are allowed.
249
+ sig do
250
+ params(
251
+ read_only: T::Boolean,
252
+ tool_names: T::Array[String]
253
+ ).returns(T.attached_class)
254
+ end
255
+ def self.new(
256
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
257
+ # is
258
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
259
+ # it will match this filter.
260
+ read_only: nil,
261
+ # List of allowed tool names.
262
+ tool_names: nil
263
+ )
264
+ end
265
+
266
+ sig do
267
+ override.returns(
268
+ { read_only: T::Boolean, tool_names: T::Array[String] }
269
+ )
270
+ end
271
+ def to_hash
272
+ end
273
+ end
274
+
275
+ sig do
276
+ override.returns(
277
+ T::Array[
278
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::AllowedTools::Variants
279
+ ]
280
+ )
281
+ end
282
+ def self.variants
283
+ end
284
+
285
+ StringArray =
286
+ T.let(
287
+ OpenAI::Internal::Type::ArrayOf[String],
288
+ OpenAI::Internal::Type::Converter
289
+ )
290
+ end
291
+
292
+ # Identifier for service connectors, like those available in ChatGPT. One of
293
+ # `server_url` or `connector_id` must be provided. Learn more about service
294
+ # connectors
295
+ # [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
296
+ #
297
+ # Currently supported `connector_id` values are:
298
+ #
299
+ # - Dropbox: `connector_dropbox`
300
+ # - Gmail: `connector_gmail`
301
+ # - Google Calendar: `connector_googlecalendar`
302
+ # - Google Drive: `connector_googledrive`
303
+ # - Microsoft Teams: `connector_microsoftteams`
304
+ # - Outlook Calendar: `connector_outlookcalendar`
305
+ # - Outlook Email: `connector_outlookemail`
306
+ # - SharePoint: `connector_sharepoint`
307
+ module ConnectorID
308
+ extend OpenAI::Internal::Type::Enum
309
+
310
+ TaggedSymbol =
311
+ T.type_alias do
312
+ T.all(
313
+ Symbol,
314
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID
315
+ )
316
+ end
317
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
318
+
319
+ CONNECTOR_DROPBOX =
320
+ T.let(
321
+ :connector_dropbox,
322
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
323
+ )
324
+ CONNECTOR_GMAIL =
325
+ T.let(
326
+ :connector_gmail,
327
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
328
+ )
329
+ CONNECTOR_GOOGLECALENDAR =
330
+ T.let(
331
+ :connector_googlecalendar,
332
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
333
+ )
334
+ CONNECTOR_GOOGLEDRIVE =
335
+ T.let(
336
+ :connector_googledrive,
337
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
338
+ )
339
+ CONNECTOR_MICROSOFTTEAMS =
340
+ T.let(
341
+ :connector_microsoftteams,
342
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
343
+ )
344
+ CONNECTOR_OUTLOOKCALENDAR =
345
+ T.let(
346
+ :connector_outlookcalendar,
347
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
348
+ )
349
+ CONNECTOR_OUTLOOKEMAIL =
350
+ T.let(
351
+ :connector_outlookemail,
352
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
353
+ )
354
+ CONNECTOR_SHAREPOINT =
355
+ T.let(
356
+ :connector_sharepoint,
357
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
358
+ )
359
+
360
+ sig do
361
+ override.returns(
362
+ T::Array[
363
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::ConnectorID::TaggedSymbol
364
+ ]
365
+ )
366
+ end
367
+ def self.values
368
+ end
369
+ end
370
+
371
+ # Specify which of the MCP server's tools require approval.
372
+ module RequireApproval
373
+ extend OpenAI::Internal::Type::Union
374
+
375
+ Variants =
376
+ T.type_alias do
377
+ T.any(
378
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter,
379
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting::TaggedSymbol
380
+ )
381
+ end
382
+
383
+ class McpToolApprovalFilter < OpenAI::Internal::Type::BaseModel
384
+ OrHash =
385
+ T.type_alias do
386
+ T.any(
387
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter,
388
+ OpenAI::Internal::AnyHash
389
+ )
390
+ end
391
+
392
+ # A filter object to specify which tools are allowed.
393
+ sig do
394
+ returns(
395
+ T.nilable(
396
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Always
397
+ )
398
+ )
399
+ end
400
+ attr_reader :always
401
+
402
+ sig do
403
+ params(
404
+ always:
405
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Always::OrHash
406
+ ).void
407
+ end
408
+ attr_writer :always
409
+
410
+ # A filter object to specify which tools are allowed.
411
+ sig do
412
+ returns(
413
+ T.nilable(
414
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Never
415
+ )
416
+ )
417
+ end
418
+ attr_reader :never
419
+
420
+ sig do
421
+ params(
422
+ never:
423
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Never::OrHash
424
+ ).void
425
+ end
426
+ attr_writer :never
427
+
428
+ # Specify which of the MCP server's tools require approval. Can be `always`,
429
+ # `never`, or a filter object associated with tools that require approval.
430
+ sig do
431
+ params(
432
+ always:
433
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Always::OrHash,
434
+ never:
435
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Never::OrHash
436
+ ).returns(T.attached_class)
437
+ end
438
+ def self.new(
439
+ # A filter object to specify which tools are allowed.
440
+ always: nil,
441
+ # A filter object to specify which tools are allowed.
442
+ never: nil
443
+ )
444
+ end
445
+
446
+ sig do
447
+ override.returns(
448
+ {
449
+ always:
450
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Always,
451
+ never:
452
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Never
453
+ }
454
+ )
455
+ end
456
+ def to_hash
457
+ end
458
+
459
+ class Always < OpenAI::Internal::Type::BaseModel
460
+ OrHash =
461
+ T.type_alias do
462
+ T.any(
463
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Always,
464
+ OpenAI::Internal::AnyHash
465
+ )
466
+ end
467
+
468
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
469
+ # is
470
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
471
+ # it will match this filter.
472
+ sig { returns(T.nilable(T::Boolean)) }
473
+ attr_reader :read_only
474
+
475
+ sig { params(read_only: T::Boolean).void }
476
+ attr_writer :read_only
477
+
478
+ # List of allowed tool names.
479
+ sig { returns(T.nilable(T::Array[String])) }
480
+ attr_reader :tool_names
481
+
482
+ sig { params(tool_names: T::Array[String]).void }
483
+ attr_writer :tool_names
484
+
485
+ # A filter object to specify which tools are allowed.
486
+ sig do
487
+ params(
488
+ read_only: T::Boolean,
489
+ tool_names: T::Array[String]
490
+ ).returns(T.attached_class)
491
+ end
492
+ def self.new(
493
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
494
+ # is
495
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
496
+ # it will match this filter.
497
+ read_only: nil,
498
+ # List of allowed tool names.
499
+ tool_names: nil
500
+ )
501
+ end
502
+
503
+ sig do
504
+ override.returns(
505
+ { read_only: T::Boolean, tool_names: T::Array[String] }
506
+ )
507
+ end
508
+ def to_hash
509
+ end
510
+ end
511
+
512
+ class Never < OpenAI::Internal::Type::BaseModel
513
+ OrHash =
514
+ T.type_alias do
515
+ T.any(
516
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalFilter::Never,
517
+ OpenAI::Internal::AnyHash
518
+ )
519
+ end
520
+
521
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
522
+ # is
523
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
524
+ # it will match this filter.
525
+ sig { returns(T.nilable(T::Boolean)) }
526
+ attr_reader :read_only
527
+
528
+ sig { params(read_only: T::Boolean).void }
529
+ attr_writer :read_only
530
+
531
+ # List of allowed tool names.
532
+ sig { returns(T.nilable(T::Array[String])) }
533
+ attr_reader :tool_names
534
+
535
+ sig { params(tool_names: T::Array[String]).void }
536
+ attr_writer :tool_names
537
+
538
+ # A filter object to specify which tools are allowed.
539
+ sig do
540
+ params(
541
+ read_only: T::Boolean,
542
+ tool_names: T::Array[String]
543
+ ).returns(T.attached_class)
544
+ end
545
+ def self.new(
546
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
547
+ # is
548
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
549
+ # it will match this filter.
550
+ read_only: nil,
551
+ # List of allowed tool names.
552
+ tool_names: nil
553
+ )
554
+ end
555
+
556
+ sig do
557
+ override.returns(
558
+ { read_only: T::Boolean, tool_names: T::Array[String] }
559
+ )
560
+ end
561
+ def to_hash
562
+ end
563
+ end
564
+ end
565
+
566
+ # Specify a single approval policy for all tools. One of `always` or `never`. When
567
+ # set to `always`, all tools will require approval. When set to `never`, all tools
568
+ # will not require approval.
569
+ module McpToolApprovalSetting
570
+ extend OpenAI::Internal::Type::Enum
571
+
572
+ TaggedSymbol =
573
+ T.type_alias do
574
+ T.all(
575
+ Symbol,
576
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting
577
+ )
578
+ end
579
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
580
+
581
+ ALWAYS =
582
+ T.let(
583
+ :always,
584
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting::TaggedSymbol
585
+ )
586
+ NEVER =
587
+ T.let(
588
+ :never,
589
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting::TaggedSymbol
590
+ )
591
+
592
+ sig do
593
+ override.returns(
594
+ T::Array[
595
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::McpToolApprovalSetting::TaggedSymbol
596
+ ]
597
+ )
598
+ end
599
+ def self.values
600
+ end
601
+ end
602
+
603
+ sig do
604
+ override.returns(
605
+ T::Array[
606
+ OpenAI::Realtime::RealtimeResponseCreateMcpTool::RequireApproval::Variants
607
+ ]
608
+ )
609
+ end
610
+ def self.variants
611
+ end
612
+ end
613
+ end
614
+ end
615
+ end
616
+ end