openai 0.19.0 → 0.20.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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/chat/chat_completion_message.rb +7 -5
  5. data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +7 -5
  6. data/lib/openai/models/conversations/item_list_params.rb +2 -0
  7. data/lib/openai/models/evals/run_cancel_response.rb +2 -2
  8. data/lib/openai/models/evals/run_create_params.rb +2 -2
  9. data/lib/openai/models/evals/run_create_response.rb +2 -2
  10. data/lib/openai/models/evals/run_list_response.rb +2 -2
  11. data/lib/openai/models/evals/run_retrieve_response.rb +2 -2
  12. data/lib/openai/models/responses/response.rb +2 -2
  13. data/lib/openai/models/responses/response_create_params.rb +4 -2
  14. data/lib/openai/models/responses/response_function_tool_call.rb +7 -5
  15. data/lib/openai/models/responses/response_function_web_search.rb +35 -1
  16. data/lib/openai/models/responses/response_includable.rb +2 -0
  17. data/lib/openai/models/responses/response_output_text.rb +7 -5
  18. data/lib/openai/models/responses/tool.rb +158 -1
  19. data/lib/openai/resources/conversations.rb +1 -1
  20. data/lib/openai/resources/responses.rb +2 -2
  21. data/lib/openai/version.rb +1 -1
  22. data/rbi/openai/models/conversations/item_list_params.rbi +4 -0
  23. data/rbi/openai/models/evals/run_cancel_response.rbi +2 -0
  24. data/rbi/openai/models/evals/run_create_params.rbi +4 -0
  25. data/rbi/openai/models/evals/run_create_response.rbi +2 -0
  26. data/rbi/openai/models/evals/run_list_response.rbi +2 -0
  27. data/rbi/openai/models/evals/run_retrieve_response.rbi +2 -0
  28. data/rbi/openai/models/responses/response.rbi +1 -0
  29. data/rbi/openai/models/responses/response_create_params.rbi +8 -0
  30. data/rbi/openai/models/responses/response_function_web_search.rbi +78 -2
  31. data/rbi/openai/models/responses/response_includable.rbi +2 -0
  32. data/rbi/openai/models/responses/tool.rbi +347 -0
  33. data/rbi/openai/resources/conversations/items.rbi +2 -0
  34. data/rbi/openai/resources/conversations.rbi +1 -1
  35. data/rbi/openai/resources/responses.rbi +6 -0
  36. data/sig/openai/models/responses/response_function_web_search.rbs +34 -3
  37. data/sig/openai/models/responses/tool.rbs +121 -0
  38. metadata +2 -2
@@ -1126,6 +1126,7 @@ module OpenAI
1126
1126
  OpenAI::Responses::Tool::ImageGeneration,
1127
1127
  OpenAI::Responses::Tool::LocalShell,
1128
1128
  OpenAI::Responses::CustomTool,
1129
+ OpenAI::Responses::Tool::WebSearchTool,
1129
1130
  OpenAI::Responses::WebSearchTool
1130
1131
  )
1131
1132
  ]
@@ -1147,6 +1148,7 @@ module OpenAI
1147
1148
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1148
1149
  OpenAI::Responses::Tool::LocalShell::OrHash,
1149
1150
  OpenAI::Responses::CustomTool::OrHash,
1151
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1150
1152
  OpenAI::Responses::WebSearchTool::OrHash
1151
1153
  )
1152
1154
  ]
@@ -1179,6 +1181,7 @@ module OpenAI
1179
1181
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1180
1182
  OpenAI::Responses::Tool::LocalShell::OrHash,
1181
1183
  OpenAI::Responses::CustomTool::OrHash,
1184
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1182
1185
  OpenAI::Responses::WebSearchTool::OrHash
1183
1186
  )
1184
1187
  ],
@@ -1237,6 +1240,7 @@ module OpenAI
1237
1240
  OpenAI::Responses::Tool::ImageGeneration,
1238
1241
  OpenAI::Responses::Tool::LocalShell,
1239
1242
  OpenAI::Responses::CustomTool,
1243
+ OpenAI::Responses::Tool::WebSearchTool,
1240
1244
  OpenAI::Responses::WebSearchTool
1241
1245
  )
1242
1246
  ],
@@ -1175,6 +1175,7 @@ module OpenAI
1175
1175
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1176
1176
  OpenAI::Responses::Tool::LocalShell::OrHash,
1177
1177
  OpenAI::Responses::CustomTool::OrHash,
1178
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1178
1179
  OpenAI::Responses::WebSearchTool::OrHash
1179
1180
  )
1180
1181
  ]
@@ -1207,6 +1208,7 @@ module OpenAI
1207
1208
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1208
1209
  OpenAI::Responses::Tool::LocalShell::OrHash,
1209
1210
  OpenAI::Responses::CustomTool::OrHash,
1211
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1210
1212
  OpenAI::Responses::WebSearchTool::OrHash
1211
1213
  )
1212
1214
  ],
@@ -1171,6 +1171,7 @@ module OpenAI
1171
1171
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1172
1172
  OpenAI::Responses::Tool::LocalShell::OrHash,
1173
1173
  OpenAI::Responses::CustomTool::OrHash,
1174
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1174
1175
  OpenAI::Responses::WebSearchTool::OrHash
1175
1176
  )
1176
1177
  ]
@@ -1203,6 +1204,7 @@ module OpenAI
1203
1204
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1204
1205
  OpenAI::Responses::Tool::LocalShell::OrHash,
1205
1206
  OpenAI::Responses::CustomTool::OrHash,
1207
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1206
1208
  OpenAI::Responses::WebSearchTool::OrHash
1207
1209
  )
1208
1210
  ],
@@ -1177,6 +1177,7 @@ module OpenAI
1177
1177
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1178
1178
  OpenAI::Responses::Tool::LocalShell::OrHash,
1179
1179
  OpenAI::Responses::CustomTool::OrHash,
1180
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1180
1181
  OpenAI::Responses::WebSearchTool::OrHash
1181
1182
  )
1182
1183
  ]
@@ -1209,6 +1210,7 @@ module OpenAI
1209
1210
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1210
1211
  OpenAI::Responses::Tool::LocalShell::OrHash,
1211
1212
  OpenAI::Responses::CustomTool::OrHash,
1213
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1212
1214
  OpenAI::Responses::WebSearchTool::OrHash
1213
1215
  )
1214
1216
  ],
@@ -349,6 +349,7 @@ module OpenAI
349
349
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
350
350
  OpenAI::Responses::Tool::LocalShell::OrHash,
351
351
  OpenAI::Responses::CustomTool::OrHash,
352
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
352
353
  OpenAI::Responses::WebSearchTool::OrHash
353
354
  )
354
355
  ],
@@ -36,6 +36,8 @@ module OpenAI
36
36
  # Specify additional output data to include in the model response. Currently
37
37
  # supported values are:
38
38
  #
39
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
40
+ # call.
39
41
  # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
40
42
  # in code interpreter tool call items.
41
43
  # - `computer_call_output.output.image_url`: Include image urls from the computer
@@ -328,6 +330,7 @@ module OpenAI
328
330
  OpenAI::Responses::Tool::ImageGeneration,
329
331
  OpenAI::Responses::Tool::LocalShell,
330
332
  OpenAI::Responses::CustomTool,
333
+ OpenAI::Responses::Tool::WebSearchTool,
331
334
  OpenAI::Responses::WebSearchTool
332
335
  )
333
336
  ]
@@ -349,6 +352,7 @@ module OpenAI
349
352
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
350
353
  OpenAI::Responses::Tool::LocalShell::OrHash,
351
354
  OpenAI::Responses::CustomTool::OrHash,
355
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
352
356
  OpenAI::Responses::WebSearchTool::OrHash
353
357
  )
354
358
  ]
@@ -458,6 +462,7 @@ module OpenAI
458
462
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
459
463
  OpenAI::Responses::Tool::LocalShell::OrHash,
460
464
  OpenAI::Responses::CustomTool::OrHash,
465
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
461
466
  OpenAI::Responses::WebSearchTool::OrHash
462
467
  )
463
468
  ],
@@ -483,6 +488,8 @@ module OpenAI
483
488
  # Specify additional output data to include in the model response. Currently
484
489
  # supported values are:
485
490
  #
491
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
492
+ # call.
486
493
  # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
487
494
  # in code interpreter tool call items.
488
495
  # - `computer_call_output.output.image_url`: Include image urls from the computer
@@ -700,6 +707,7 @@ module OpenAI
700
707
  OpenAI::Responses::Tool::ImageGeneration,
701
708
  OpenAI::Responses::Tool::LocalShell,
702
709
  OpenAI::Responses::CustomTool,
710
+ OpenAI::Responses::Tool::WebSearchTool,
703
711
  OpenAI::Responses::WebSearchTool
704
712
  )
705
713
  ],
@@ -121,21 +121,97 @@ module OpenAI
121
121
  sig { returns(Symbol) }
122
122
  attr_accessor :type
123
123
 
124
+ # The sources used in the search.
125
+ sig do
126
+ returns(
127
+ T.nilable(
128
+ T::Array[
129
+ OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source
130
+ ]
131
+ )
132
+ )
133
+ end
134
+ attr_reader :sources
135
+
136
+ sig do
137
+ params(
138
+ sources:
139
+ T::Array[
140
+ OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source::OrHash
141
+ ]
142
+ ).void
143
+ end
144
+ attr_writer :sources
145
+
124
146
  # Action type "search" - Performs a web search query.
125
147
  sig do
126
- params(query: String, type: Symbol).returns(T.attached_class)
148
+ params(
149
+ query: String,
150
+ sources:
151
+ T::Array[
152
+ OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source::OrHash
153
+ ],
154
+ type: Symbol
155
+ ).returns(T.attached_class)
127
156
  end
128
157
  def self.new(
129
158
  # The search query.
130
159
  query:,
160
+ # The sources used in the search.
161
+ sources: nil,
131
162
  # The action type.
132
163
  type: :search
133
164
  )
134
165
  end
135
166
 
136
- sig { override.returns({ query: String, type: Symbol }) }
167
+ sig do
168
+ override.returns(
169
+ {
170
+ query: String,
171
+ type: Symbol,
172
+ sources:
173
+ T::Array[
174
+ OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source
175
+ ]
176
+ }
177
+ )
178
+ end
137
179
  def to_hash
138
180
  end
181
+
182
+ class Source < OpenAI::Internal::Type::BaseModel
183
+ OrHash =
184
+ T.type_alias do
185
+ T.any(
186
+ OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source,
187
+ OpenAI::Internal::AnyHash
188
+ )
189
+ end
190
+
191
+ # The type of source. Always `url`.
192
+ sig { returns(Symbol) }
193
+ attr_accessor :type
194
+
195
+ # The URL of the source.
196
+ sig { returns(String) }
197
+ attr_accessor :url
198
+
199
+ # A source used in the search.
200
+ sig do
201
+ params(url: String, type: Symbol).returns(T.attached_class)
202
+ end
203
+ def self.new(
204
+ # The URL of the source.
205
+ url:,
206
+ # The type of source. Always `url`.
207
+ type: :url
208
+ )
209
+ end
210
+
211
+ sig { override.returns({ type: Symbol, url: String }) }
212
+ def to_hash
213
+ end
214
+ end
139
215
  end
140
216
 
141
217
  class OpenPage < OpenAI::Internal::Type::BaseModel
@@ -6,6 +6,8 @@ module OpenAI
6
6
  # Specify additional output data to include in the model response. Currently
7
7
  # supported values are:
8
8
  #
9
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
10
+ # call.
9
11
  # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
10
12
  # in code interpreter tool call items.
11
13
  # - `computer_call_output.output.image_url`: Include image urls from the computer
@@ -18,10 +18,357 @@ module OpenAI
18
18
  OpenAI::Responses::Tool::ImageGeneration,
19
19
  OpenAI::Responses::Tool::LocalShell,
20
20
  OpenAI::Responses::CustomTool,
21
+ OpenAI::Responses::Tool::WebSearchTool,
21
22
  OpenAI::Responses::WebSearchTool
22
23
  )
23
24
  end
24
25
 
26
+ class WebSearchTool < OpenAI::Internal::Type::BaseModel
27
+ OrHash =
28
+ T.type_alias do
29
+ T.any(
30
+ OpenAI::Responses::Tool::WebSearchTool,
31
+ OpenAI::Internal::AnyHash
32
+ )
33
+ end
34
+
35
+ # The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
36
+ sig do
37
+ returns(OpenAI::Responses::Tool::WebSearchTool::Type::OrSymbol)
38
+ end
39
+ attr_accessor :type
40
+
41
+ # Filters for the search.
42
+ sig do
43
+ returns(T.nilable(OpenAI::Responses::Tool::WebSearchTool::Filters))
44
+ end
45
+ attr_reader :filters
46
+
47
+ sig do
48
+ params(
49
+ filters:
50
+ T.nilable(
51
+ OpenAI::Responses::Tool::WebSearchTool::Filters::OrHash
52
+ )
53
+ ).void
54
+ end
55
+ attr_writer :filters
56
+
57
+ # High level guidance for the amount of context window space to use for the
58
+ # search. One of `low`, `medium`, or `high`. `medium` is the default.
59
+ sig do
60
+ returns(
61
+ T.nilable(
62
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::OrSymbol
63
+ )
64
+ )
65
+ end
66
+ attr_reader :search_context_size
67
+
68
+ sig do
69
+ params(
70
+ search_context_size:
71
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::OrSymbol
72
+ ).void
73
+ end
74
+ attr_writer :search_context_size
75
+
76
+ # The approximate location of the user.
77
+ sig do
78
+ returns(
79
+ T.nilable(OpenAI::Responses::Tool::WebSearchTool::UserLocation)
80
+ )
81
+ end
82
+ attr_reader :user_location
83
+
84
+ sig do
85
+ params(
86
+ user_location:
87
+ T.nilable(
88
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::OrHash
89
+ )
90
+ ).void
91
+ end
92
+ attr_writer :user_location
93
+
94
+ # Search the Internet for sources related to the prompt. Learn more about the
95
+ # [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
96
+ sig do
97
+ params(
98
+ type: OpenAI::Responses::Tool::WebSearchTool::Type::OrSymbol,
99
+ filters:
100
+ T.nilable(
101
+ OpenAI::Responses::Tool::WebSearchTool::Filters::OrHash
102
+ ),
103
+ search_context_size:
104
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::OrSymbol,
105
+ user_location:
106
+ T.nilable(
107
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::OrHash
108
+ )
109
+ ).returns(T.attached_class)
110
+ end
111
+ def self.new(
112
+ # The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
113
+ type:,
114
+ # Filters for the search.
115
+ filters: nil,
116
+ # High level guidance for the amount of context window space to use for the
117
+ # search. One of `low`, `medium`, or `high`. `medium` is the default.
118
+ search_context_size: nil,
119
+ # The approximate location of the user.
120
+ user_location: nil
121
+ )
122
+ end
123
+
124
+ sig do
125
+ override.returns(
126
+ {
127
+ type: OpenAI::Responses::Tool::WebSearchTool::Type::OrSymbol,
128
+ filters:
129
+ T.nilable(OpenAI::Responses::Tool::WebSearchTool::Filters),
130
+ search_context_size:
131
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::OrSymbol,
132
+ user_location:
133
+ T.nilable(
134
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation
135
+ )
136
+ }
137
+ )
138
+ end
139
+ def to_hash
140
+ end
141
+
142
+ # The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
143
+ module Type
144
+ extend OpenAI::Internal::Type::Enum
145
+
146
+ TaggedSymbol =
147
+ T.type_alias do
148
+ T.all(Symbol, OpenAI::Responses::Tool::WebSearchTool::Type)
149
+ end
150
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
151
+
152
+ WEB_SEARCH =
153
+ T.let(
154
+ :web_search,
155
+ OpenAI::Responses::Tool::WebSearchTool::Type::TaggedSymbol
156
+ )
157
+ WEB_SEARCH_2025_08_26 =
158
+ T.let(
159
+ :web_search_2025_08_26,
160
+ OpenAI::Responses::Tool::WebSearchTool::Type::TaggedSymbol
161
+ )
162
+
163
+ sig do
164
+ override.returns(
165
+ T::Array[
166
+ OpenAI::Responses::Tool::WebSearchTool::Type::TaggedSymbol
167
+ ]
168
+ )
169
+ end
170
+ def self.values
171
+ end
172
+ end
173
+
174
+ class Filters < OpenAI::Internal::Type::BaseModel
175
+ OrHash =
176
+ T.type_alias do
177
+ T.any(
178
+ OpenAI::Responses::Tool::WebSearchTool::Filters,
179
+ OpenAI::Internal::AnyHash
180
+ )
181
+ end
182
+
183
+ # Allowed domains for the search. If not provided, all domains are allowed.
184
+ # Subdomains of the provided domains are allowed as well.
185
+ #
186
+ # Example: `["pubmed.ncbi.nlm.nih.gov"]`
187
+ sig { returns(T.nilable(T::Array[String])) }
188
+ attr_accessor :allowed_domains
189
+
190
+ # Filters for the search.
191
+ sig do
192
+ params(allowed_domains: T.nilable(T::Array[String])).returns(
193
+ T.attached_class
194
+ )
195
+ end
196
+ def self.new(
197
+ # Allowed domains for the search. If not provided, all domains are allowed.
198
+ # Subdomains of the provided domains are allowed as well.
199
+ #
200
+ # Example: `["pubmed.ncbi.nlm.nih.gov"]`
201
+ allowed_domains: nil
202
+ )
203
+ end
204
+
205
+ sig do
206
+ override.returns({ allowed_domains: T.nilable(T::Array[String]) })
207
+ end
208
+ def to_hash
209
+ end
210
+ end
211
+
212
+ # High level guidance for the amount of context window space to use for the
213
+ # search. One of `low`, `medium`, or `high`. `medium` is the default.
214
+ module SearchContextSize
215
+ extend OpenAI::Internal::Type::Enum
216
+
217
+ TaggedSymbol =
218
+ T.type_alias do
219
+ T.all(
220
+ Symbol,
221
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize
222
+ )
223
+ end
224
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
225
+
226
+ LOW =
227
+ T.let(
228
+ :low,
229
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::TaggedSymbol
230
+ )
231
+ MEDIUM =
232
+ T.let(
233
+ :medium,
234
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::TaggedSymbol
235
+ )
236
+ HIGH =
237
+ T.let(
238
+ :high,
239
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::TaggedSymbol
240
+ )
241
+
242
+ sig do
243
+ override.returns(
244
+ T::Array[
245
+ OpenAI::Responses::Tool::WebSearchTool::SearchContextSize::TaggedSymbol
246
+ ]
247
+ )
248
+ end
249
+ def self.values
250
+ end
251
+ end
252
+
253
+ class UserLocation < OpenAI::Internal::Type::BaseModel
254
+ OrHash =
255
+ T.type_alias do
256
+ T.any(
257
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation,
258
+ OpenAI::Internal::AnyHash
259
+ )
260
+ end
261
+
262
+ # Free text input for the city of the user, e.g. `San Francisco`.
263
+ sig { returns(T.nilable(String)) }
264
+ attr_accessor :city
265
+
266
+ # The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of
267
+ # the user, e.g. `US`.
268
+ sig { returns(T.nilable(String)) }
269
+ attr_accessor :country
270
+
271
+ # Free text input for the region of the user, e.g. `California`.
272
+ sig { returns(T.nilable(String)) }
273
+ attr_accessor :region
274
+
275
+ # The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the
276
+ # user, e.g. `America/Los_Angeles`.
277
+ sig { returns(T.nilable(String)) }
278
+ attr_accessor :timezone
279
+
280
+ # The type of location approximation. Always `approximate`.
281
+ sig do
282
+ returns(
283
+ T.nilable(
284
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::Type::OrSymbol
285
+ )
286
+ )
287
+ end
288
+ attr_reader :type
289
+
290
+ sig do
291
+ params(
292
+ type:
293
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::Type::OrSymbol
294
+ ).void
295
+ end
296
+ attr_writer :type
297
+
298
+ # The approximate location of the user.
299
+ sig do
300
+ params(
301
+ city: T.nilable(String),
302
+ country: T.nilable(String),
303
+ region: T.nilable(String),
304
+ timezone: T.nilable(String),
305
+ type:
306
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::Type::OrSymbol
307
+ ).returns(T.attached_class)
308
+ end
309
+ def self.new(
310
+ # Free text input for the city of the user, e.g. `San Francisco`.
311
+ city: nil,
312
+ # The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of
313
+ # the user, e.g. `US`.
314
+ country: nil,
315
+ # Free text input for the region of the user, e.g. `California`.
316
+ region: nil,
317
+ # The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the
318
+ # user, e.g. `America/Los_Angeles`.
319
+ timezone: nil,
320
+ # The type of location approximation. Always `approximate`.
321
+ type: nil
322
+ )
323
+ end
324
+
325
+ sig do
326
+ override.returns(
327
+ {
328
+ city: T.nilable(String),
329
+ country: T.nilable(String),
330
+ region: T.nilable(String),
331
+ timezone: T.nilable(String),
332
+ type:
333
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::Type::OrSymbol
334
+ }
335
+ )
336
+ end
337
+ def to_hash
338
+ end
339
+
340
+ # The type of location approximation. Always `approximate`.
341
+ module Type
342
+ extend OpenAI::Internal::Type::Enum
343
+
344
+ TaggedSymbol =
345
+ T.type_alias do
346
+ T.all(
347
+ Symbol,
348
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::Type
349
+ )
350
+ end
351
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
352
+
353
+ APPROXIMATE =
354
+ T.let(
355
+ :approximate,
356
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::Type::TaggedSymbol
357
+ )
358
+
359
+ sig do
360
+ override.returns(
361
+ T::Array[
362
+ OpenAI::Responses::Tool::WebSearchTool::UserLocation::Type::TaggedSymbol
363
+ ]
364
+ )
365
+ end
366
+ def self.values
367
+ end
368
+ end
369
+ end
370
+ end
371
+
25
372
  class Mcp < OpenAI::Internal::Type::BaseModel
26
373
  OrHash =
27
374
  T.type_alias do
@@ -99,6 +99,8 @@ module OpenAI
99
99
  # Specify additional output data to include in the model response. Currently
100
100
  # supported values are:
101
101
  #
102
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
103
+ # call.
102
104
  # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
103
105
  # in code interpreter tool call items.
104
106
  # - `computer_call_output.output.image_url`: Include image urls from the computer
@@ -6,7 +6,7 @@ module OpenAI
6
6
  sig { returns(OpenAI::Resources::Conversations::Items) }
7
7
  attr_reader :items
8
8
 
9
- # Create a conversation with the given ID.
9
+ # Create a conversation.
10
10
  sig do
11
11
  params(
12
12
  items:
@@ -85,6 +85,7 @@ module OpenAI
85
85
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
86
86
  OpenAI::Responses::Tool::LocalShell::OrHash,
87
87
  OpenAI::Responses::CustomTool::OrHash,
88
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
88
89
  OpenAI::Responses::WebSearchTool::OrHash
89
90
  )
90
91
  ],
@@ -111,6 +112,8 @@ module OpenAI
111
112
  # Specify additional output data to include in the model response. Currently
112
113
  # supported values are:
113
114
  #
115
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
116
+ # call.
114
117
  # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
115
118
  # in code interpreter tool call items.
116
119
  # - `computer_call_output.output.image_url`: Include image urls from the computer
@@ -352,6 +355,7 @@ module OpenAI
352
355
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
353
356
  OpenAI::Responses::Tool::LocalShell::OrHash,
354
357
  OpenAI::Responses::CustomTool::OrHash,
358
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
355
359
  OpenAI::Responses::WebSearchTool::OrHash
356
360
  )
357
361
  ],
@@ -382,6 +386,8 @@ module OpenAI
382
386
  # Specify additional output data to include in the model response. Currently
383
387
  # supported values are:
384
388
  #
389
+ # - `web_search_call.action.sources`: Include the sources of the web search tool
390
+ # call.
385
391
  # - `code_interpreter_call.outputs`: Includes the outputs of python code execution
386
392
  # in code interpreter tool call items.
387
393
  # - `computer_call_output.output.image_url`: Include image urls from the computer