@effect/ai-openai 4.0.0-beta.10 → 4.0.0-beta.100

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 (61) hide show
  1. package/dist/Generated.d.ts +66675 -37672
  2. package/dist/Generated.d.ts.map +1 -1
  3. package/dist/Generated.js +1 -1
  4. package/dist/Generated.js.map +1 -1
  5. package/dist/OpenAiClient.d.ts +170 -29
  6. package/dist/OpenAiClient.d.ts.map +1 -1
  7. package/dist/OpenAiClient.js +321 -46
  8. package/dist/OpenAiClient.js.map +1 -1
  9. package/dist/OpenAiClientGenerated.d.ts +91 -0
  10. package/dist/OpenAiClientGenerated.d.ts.map +1 -0
  11. package/dist/OpenAiClientGenerated.js +84 -0
  12. package/dist/OpenAiClientGenerated.js.map +1 -0
  13. package/dist/OpenAiConfig.d.ts +88 -10
  14. package/dist/OpenAiConfig.d.ts.map +1 -1
  15. package/dist/OpenAiConfig.js +42 -7
  16. package/dist/OpenAiConfig.js.map +1 -1
  17. package/dist/OpenAiEmbeddingModel.d.ts +188 -0
  18. package/dist/OpenAiEmbeddingModel.d.ts.map +1 -0
  19. package/dist/OpenAiEmbeddingModel.js +194 -0
  20. package/dist/OpenAiEmbeddingModel.js.map +1 -0
  21. package/dist/OpenAiError.d.ts +168 -35
  22. package/dist/OpenAiError.d.ts.map +1 -1
  23. package/dist/OpenAiError.js +1 -1
  24. package/dist/OpenAiLanguageModel.d.ts +360 -72
  25. package/dist/OpenAiLanguageModel.d.ts.map +1 -1
  26. package/dist/OpenAiLanguageModel.js +390 -168
  27. package/dist/OpenAiLanguageModel.js.map +1 -1
  28. package/dist/OpenAiSchema.d.ts +2325 -0
  29. package/dist/OpenAiSchema.d.ts.map +1 -0
  30. package/dist/OpenAiSchema.js +811 -0
  31. package/dist/OpenAiSchema.js.map +1 -0
  32. package/dist/OpenAiTelemetry.d.ts +63 -22
  33. package/dist/OpenAiTelemetry.d.ts.map +1 -1
  34. package/dist/OpenAiTelemetry.js +20 -10
  35. package/dist/OpenAiTelemetry.js.map +1 -1
  36. package/dist/OpenAiTool.d.ts +175 -85
  37. package/dist/OpenAiTool.d.ts.map +1 -1
  38. package/dist/OpenAiTool.js +125 -39
  39. package/dist/OpenAiTool.js.map +1 -1
  40. package/dist/index.d.ts +19 -33
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +19 -33
  43. package/dist/index.js.map +1 -1
  44. package/dist/internal/errors.js +4 -4
  45. package/dist/internal/errors.js.map +1 -1
  46. package/dist/internal/utilities.js +0 -4
  47. package/dist/internal/utilities.js.map +1 -1
  48. package/package.json +5 -6
  49. package/src/Generated.ts +9720 -4890
  50. package/src/OpenAiClient.ts +499 -98
  51. package/src/OpenAiClientGenerated.ts +202 -0
  52. package/src/OpenAiConfig.ts +89 -11
  53. package/src/OpenAiEmbeddingModel.ts +332 -0
  54. package/src/OpenAiError.ts +170 -35
  55. package/src/OpenAiLanguageModel.ts +776 -169
  56. package/src/OpenAiSchema.ts +1286 -0
  57. package/src/OpenAiTelemetry.ts +69 -28
  58. package/src/OpenAiTool.ts +126 -40
  59. package/src/index.ts +22 -33
  60. package/src/internal/errors.ts +6 -4
  61. package/src/internal/utilities.ts +0 -6
@@ -1,29 +1,34 @@
1
1
  /**
2
- * OpenAI provider-defined tools for use with the LanguageModel.
2
+ * The `OpenAiTool` module defines OpenAI provider tools for Effect AI language
3
+ * model requests. It exposes typed descriptors for tools such as Apply Patch,
4
+ * Code Interpreter, File Search, Image Generation, MCP, Web Search, and
5
+ * shell-like local tools, including their provider names, configuration
6
+ * arguments, call parameters, success schemas, and handler requirements.
3
7
  *
4
- * Provides tools that are natively supported by OpenAI's API, including
5
- * code interpreter, file search, and web search functionality.
6
- *
7
- * @since 1.0.0
8
+ * @since 4.0.0
8
9
  */
9
10
  import * as Schema from "effect/Schema";
10
11
  import * as Tool from "effect/unstable/ai/Tool";
11
12
  /**
12
13
  * Union of all OpenAI provider-defined tools.
13
14
  *
14
- * @since 1.0.0
15
15
  * @category models
16
+ * @since 4.0.0
16
17
  */
17
18
  export type OpenAiTool = ReturnType<typeof ApplyPatch> | ReturnType<typeof CodeInterpreter> | ReturnType<typeof FileSearch> | ReturnType<typeof Shell> | ReturnType<typeof ImageGeneration> | ReturnType<typeof LocalShell> | ReturnType<typeof Mcp> | ReturnType<typeof WebSearch> | ReturnType<typeof WebSearchPreview>;
18
19
  /**
19
- * OpenAI Apply Patch tool.
20
+ * Defines the OpenAI Apply Patch tool that allows the model to apply diffs by creating,
21
+ * deleting, or updating files. This local tool runs in your environment and
22
+ * requires a handler to execute file operations.
23
+ *
24
+ * **When to use**
20
25
  *
21
- * Allows the model to apply diffs by creating, deleting, or updating files.
22
- * This is a local tool that runs in your environment and requires a handler
23
- * to execute file operations.
26
+ * Use when you want an OpenAI model to request structured file edits as create,
27
+ * delete, or update operations that your application executes through a local
28
+ * handler.
24
29
  *
25
- * @since 1.0.0
26
30
  * @category tools
31
+ * @since 4.0.0
27
32
  */
28
33
  export declare const ApplyPatch: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
29
34
  readonly failureMode?: Mode | undefined;
@@ -52,29 +57,38 @@ export declare const ApplyPatch: <Mode extends Tool.FailureMode | undefined = un
52
57
  readonly failureMode: Mode extends undefined ? "error" : Mode;
53
58
  }, true>;
54
59
  /**
55
- * OpenAI Code Interpreter tool.
60
+ * Defines the OpenAI Code Interpreter tool that allows the model to execute Python code in
61
+ * a sandboxed environment.
62
+ *
63
+ * **When to use**
64
+ *
65
+ * Use to enable OpenAI-hosted Python execution for a model response.
56
66
  *
57
- * Allows the model to execute Python code in a sandboxed environment.
67
+ * **Details**
68
+ *
69
+ * The tool is configured with a `container` argument. Successful tool calls
70
+ * expose `outputs`, which may contain logs or generated images, or `null` when
71
+ * no outputs are available.
58
72
  *
59
- * @since 1.0.0
60
73
  * @category tools
74
+ * @since 4.0.0
61
75
  */
62
76
  export declare const CodeInterpreter: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
63
77
  readonly container: string | {
64
78
  readonly type: "auto";
65
- readonly memory_limit?: "1g" | "4g" | "16g" | "64g" | null;
66
- readonly network_policy?: {
67
- readonly type: "disabled";
68
- } | {
79
+ readonly file_ids?: readonly string[];
80
+ readonly memory_limit?: "16g" | "1g" | "4g" | "64g" | null;
81
+ readonly network_policy?: Schema.Struct.ReadonlySide<{
82
+ readonly type: Schema.Literal<"disabled">;
83
+ }, "Encoded"> | {
69
84
  readonly type: "allowlist";
70
85
  readonly allowed_domains: readonly string[];
71
- readonly domain_secrets?: readonly {
72
- readonly value: string;
73
- readonly name: string;
74
- readonly domain: string;
75
- }[];
86
+ readonly domain_secrets?: readonly Schema.Struct.ReadonlySide<{
87
+ readonly domain: Schema.String;
88
+ readonly name: Schema.String;
89
+ readonly value: Schema.String;
90
+ }, "Encoded">[];
76
91
  };
77
- readonly file_ids?: readonly string[];
78
92
  };
79
93
  }) => Tool.ProviderDefined<"openai.code_interpreter", "OpenAiCodeInterpreter", {
80
94
  readonly args: Schema.Struct<{
@@ -112,42 +126,56 @@ export declare const CodeInterpreter: <Mode extends Tool.FailureMode | undefined
112
126
  readonly failureMode: Mode extends undefined ? "error" : Mode;
113
127
  }, false>;
114
128
  /**
115
- * OpenAI File Search tool.
129
+ * Defines the OpenAI File Search tool that enables the model to search through uploaded
130
+ * files and vector stores.
131
+ *
132
+ * **When to use**
116
133
  *
117
- * Enables the model to search through uploaded files and vector stores.
134
+ * Use to let an OpenAI model search uploaded files through one or more vector
135
+ * stores.
136
+ *
137
+ * **Details**
138
+ *
139
+ * The tool requires `vector_store_ids` and accepts optional `filters`,
140
+ * `max_num_results`, and `ranking_options`. Successful tool calls expose the
141
+ * search `status`, generated `queries`, and optional `results`.
118
142
  *
119
- * @since 1.0.0
120
143
  * @category tools
144
+ * @since 4.0.0
121
145
  */
122
146
  export declare const FileSearch: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
123
- readonly vector_store_ids: readonly string[];
124
- readonly filters?: {
125
- readonly value: string | number | boolean | readonly (string | number)[];
126
- readonly type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
127
- readonly key: string;
128
- } | {
129
- readonly type: "and" | "or";
130
- readonly filters: readonly unknown[];
131
- } | null;
147
+ readonly filters?: Schema.Struct.ReadonlySide<{
148
+ readonly type: Schema.Literals<readonly ["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]>;
149
+ readonly key: Schema.String;
150
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>]>;
151
+ }, "Encoded"> | Schema.Struct.ReadonlySide<{
152
+ readonly type: Schema.Literals<readonly ["and", "or"]>;
153
+ readonly filters: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
154
+ readonly type: Schema.Literals<readonly ["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]>;
155
+ readonly key: Schema.String;
156
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>]>;
157
+ }>, Schema.Unknown]>>;
158
+ }, "Encoded"> | null;
132
159
  readonly max_num_results?: number;
133
160
  readonly ranking_options?: {
134
161
  readonly ranker?: "auto" | "default-2024-11-15";
135
162
  readonly score_threshold?: number;
136
- readonly hybrid_search?: {
137
- readonly embedding_weight: number;
138
- readonly text_weight: number;
139
- };
163
+ readonly hybrid_search?: Schema.Struct.ReadonlySide<{
164
+ readonly embedding_weight: Schema.Number;
165
+ readonly text_weight: Schema.Number;
166
+ }, "Encoded">;
140
167
  };
168
+ readonly vector_store_ids: readonly string[];
141
169
  }) => Tool.ProviderDefined<"openai.file_search", "OpenAiFileSearch", {
142
170
  readonly args: Schema.Struct<{
143
171
  readonly filters: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
144
- readonly type: Schema.Literals<readonly ["eq", "ne", "gt", "gte", "lt", "lte"]>;
172
+ readonly type: Schema.Literals<readonly ["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]>;
145
173
  readonly key: Schema.String;
146
174
  readonly value: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>]>;
147
175
  }>, Schema.Struct<{
148
176
  readonly type: Schema.Literals<readonly ["and", "or"]>;
149
177
  readonly filters: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
150
- readonly type: Schema.Literals<readonly ["eq", "ne", "gt", "gte", "lt", "lte"]>;
178
+ readonly type: Schema.Literals<readonly ["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]>;
151
179
  readonly key: Schema.String;
152
180
  readonly value: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>]>;
153
181
  }>, Schema.Unknown]>>;
@@ -179,27 +207,38 @@ export declare const FileSearch: <Mode extends Tool.FailureMode | undefined = un
179
207
  readonly failureMode: Mode extends undefined ? "error" : Mode;
180
208
  }, false>;
181
209
  /**
182
- * OpenAI Image Generation tool.
210
+ * Defines the OpenAI Image Generation tool that enables the model to generate images using
211
+ * the GPT image models.
212
+ *
213
+ * **When to use**
214
+ *
215
+ * Use to enable OpenAI provider-defined image generation through a language
216
+ * model response.
217
+ *
218
+ * **Details**
183
219
  *
184
- * Enables the model to generate images using the GPT image models.
220
+ * The tool configures the `image_generation` provider tool, including model,
221
+ * size, quality, output format, moderation, background, input-image options,
222
+ * and partial image settings. Successful tool calls expose `result` as base64
223
+ * image data or `null`.
185
224
  *
186
- * @since 1.0.0
187
225
  * @category tools
226
+ * @since 4.0.0
188
227
  */
189
228
  export declare const ImageGeneration: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
190
- readonly model?: string;
191
- readonly size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
192
- readonly quality?: "auto" | "low" | "high" | "medium";
193
- readonly background?: "auto" | "transparent" | "opaque";
194
- readonly output_format?: "png" | "webp" | "jpeg";
195
- readonly output_compression?: number;
196
- readonly partial_images?: number;
197
- readonly moderation?: "auto" | "low";
198
- readonly input_fidelity?: "low" | "high" | null;
229
+ readonly background?: "auto" | "opaque" | "transparent";
230
+ readonly input_fidelity?: "high" | "low" | null;
199
231
  readonly input_image_mask?: {
200
- readonly file_id?: string;
201
232
  readonly image_url?: string;
233
+ readonly file_id?: string;
202
234
  };
235
+ readonly model?: string;
236
+ readonly moderation?: "auto" | "low";
237
+ readonly output_compression?: number;
238
+ readonly output_format?: "jpeg" | "png" | "webp";
239
+ readonly partial_images?: number;
240
+ readonly quality?: "auto" | "high" | "low" | "medium";
241
+ readonly size?: string;
203
242
  }) => Tool.ProviderDefined<"openai.image_generation", "OpenAiImageGeneration", {
204
243
  readonly args: Schema.Struct<{
205
244
  readonly background: Schema.optionalKey<Schema.Literals<readonly ["transparent", "opaque", "auto"]>>;
@@ -214,7 +253,7 @@ export declare const ImageGeneration: <Mode extends Tool.FailureMode | undefined
214
253
  readonly output_format: Schema.optionalKey<Schema.Literals<readonly ["png", "webp", "jpeg"]>>;
215
254
  readonly partial_images: Schema.optionalKey<Schema.Number>;
216
255
  readonly quality: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "auto"]>>;
217
- readonly size: Schema.optionalKey<Schema.Literals<readonly ["1024x1024", "1024x1536", "1536x1024", "auto"]>>;
256
+ readonly size: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Literals<readonly ["1024x1024", "1024x1536", "1536x1024", "auto"]>]>>;
218
257
  }>;
219
258
  readonly parameters: Schema.Void;
220
259
  readonly success: Schema.Struct<{
@@ -224,13 +263,23 @@ export declare const ImageGeneration: <Mode extends Tool.FailureMode | undefined
224
263
  readonly failureMode: Mode extends undefined ? "error" : Mode;
225
264
  }, false>;
226
265
  /**
227
- * OpenAI Local Shell tool.
266
+ * Defines the OpenAI Local Shell tool that enables the model to run a command with a local
267
+ * shell. This local tool runs in your environment and requires a handler to
268
+ * execute commands.
269
+ *
270
+ * **When to use**
271
+ *
272
+ * Use to let an OpenAI model request local shell commands that your application
273
+ * executes through a handler.
228
274
  *
229
- * Enables the model to run a command with a local shell. This is a local tool
230
- * that runs in your environment and requires a handler to execute commands.
275
+ * **Details**
276
+ *
277
+ * The tool exposes a provider-defined `local_shell` call. It is marked as
278
+ * handler-required, so applications must provide the command execution policy
279
+ * and implementation.
231
280
  *
232
- * @since 1.0.0
233
281
  * @category tools
282
+ * @since 4.0.0
234
283
  */
235
284
  export declare const LocalShell: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
236
285
  readonly failureMode?: Mode | undefined;
@@ -253,24 +302,35 @@ export declare const LocalShell: <Mode extends Tool.FailureMode | undefined = un
253
302
  readonly failureMode: Mode extends undefined ? "error" : Mode;
254
303
  }, true>;
255
304
  /**
256
- * OpenAI MCP tool.
305
+ * Defines the OpenAI MCP tool that gives the model access to additional tools via remote
306
+ * Model Context Protocol (MCP) servers.
307
+ *
308
+ * **When to use**
309
+ *
310
+ * Use to let an OpenAI model call tools exposed by a remote MCP server.
311
+ *
312
+ * **Details**
257
313
  *
258
- * Gives the model access to additional tools via remote Model Context Protocol
259
- * (MCP) servers
314
+ * The tool accepts MCP server configuration such as allowed tools,
315
+ * authorization, connector id, approval requirements, server metadata, and
316
+ * server URL. Tool call results include the called tool name, arguments, output,
317
+ * error, and server label.
318
+ *
319
+ * **Gotchas**
320
+ *
321
+ * This schema leaves both `server_url` and `connector_id` optional, but OpenAI
322
+ * may require a server URL or connector id for a usable MCP tool configuration.
260
323
  *
261
- * @since 1.0.0
262
324
  * @category tools
325
+ * @since 4.0.0
263
326
  */
264
327
  export declare const Mcp: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
265
- readonly server_label: string;
266
328
  readonly allowed_tools?: readonly string[] | {
267
329
  readonly tool_names?: readonly string[];
268
330
  readonly read_only?: boolean;
269
331
  } | null;
270
- readonly server_url?: string;
271
- readonly connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | "connector_googledrive" | "connector_microsoftteams" | "connector_outlookcalendar" | "connector_outlookemail" | "connector_sharepoint";
272
332
  readonly authorization?: string;
273
- readonly server_description?: string;
333
+ readonly connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | "connector_googledrive" | "connector_microsoftteams" | "connector_outlookcalendar" | "connector_outlookemail" | "connector_sharepoint";
274
334
  readonly require_approval?: "always" | "never" | {
275
335
  readonly always?: {
276
336
  readonly tool_names?: readonly string[];
@@ -281,6 +341,9 @@ export declare const Mcp: <Mode extends Tool.FailureMode | undefined = undefined
281
341
  readonly read_only?: boolean;
282
342
  };
283
343
  } | null;
344
+ readonly server_description?: string;
345
+ readonly server_label: string;
346
+ readonly server_url?: string;
284
347
  }) => Tool.ProviderDefined<"openai.mcp", "OpenAiMcp", {
285
348
  readonly args: Schema.Struct<{
286
349
  readonly allowed_tools: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.$Array<Schema.String>, Schema.Struct<{
@@ -303,7 +366,7 @@ export declare const Mcp: <Mode extends Tool.FailureMode | undefined = undefined
303
366
  readonly server_label: Schema.String;
304
367
  readonly server_url: Schema.optionalKey<Schema.String>;
305
368
  }>;
306
- readonly parameters: Schema.Void;
369
+ readonly parameters: Schema.Unknown;
307
370
  readonly success: Schema.Struct<{
308
371
  readonly type: Schema.Literal<"mcp_call">;
309
372
  readonly name: Schema.String;
@@ -316,14 +379,21 @@ export declare const Mcp: <Mode extends Tool.FailureMode | undefined = undefined
316
379
  readonly failureMode: Mode extends undefined ? "error" : Mode;
317
380
  }, false>;
318
381
  /**
319
- * OpenAI Function Shell tool.
382
+ * Defines the OpenAI shell tool for model-requested command execution.
383
+ *
384
+ * **When to use**
320
385
  *
321
- * Enables the model to execute one or more shell commands in a managed
322
- * environment. This is a local tool that runs in your environment and requires
323
- * a handler to execute commands.
386
+ * Use to let an OpenAI model request shell commands that your application
387
+ * executes through a handler.
388
+ *
389
+ * **Details**
390
+ *
391
+ * The tool exposes a provider-defined `shell` call. It is marked as
392
+ * handler-required, so applications must provide the command execution policy
393
+ * and implementation.
324
394
  *
325
- * @since 1.0.0
326
395
  * @category tools
396
+ * @since 4.0.0
327
397
  */
328
398
  export declare const Shell: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
329
399
  readonly failureMode?: Mode | undefined;
@@ -346,20 +416,34 @@ export declare const Shell: <Mode extends Tool.FailureMode | undefined = undefin
346
416
  readonly type: Schema.Literal<"exit">;
347
417
  readonly exit_code: Schema.Number;
348
418
  }>]>;
419
+ readonly created_by: Schema.optionalKey<Schema.String>;
349
420
  }>>;
350
421
  }>;
351
422
  readonly failure: Schema.Never;
352
423
  readonly failureMode: Mode extends undefined ? "error" : Mode;
353
424
  }, true>;
354
425
  /**
355
- * OpenAI Web Search tool.
426
+ * Defines the OpenAI Web Search tool that enables the model to search the web for
427
+ * information.
428
+ *
429
+ * **When to use**
430
+ *
431
+ * Use to enable OpenAI provider-defined web search for a model response.
356
432
  *
357
- * Enables the model to search the web for information.
433
+ * **Details**
434
+ *
435
+ * The tool accepts optional filters, user location, and search context size.
436
+ * Successful calls expose the performed search action and status.
437
+ *
438
+ * @see {@link WebSearchPreview} for the preview web search provider tool
358
439
  *
359
- * @since 1.0.0
360
440
  * @category tools
441
+ * @since 4.0.0
361
442
  */
362
443
  export declare const WebSearch: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
444
+ readonly filters?: {
445
+ readonly allowed_domains?: readonly string[] | null;
446
+ } | null;
363
447
  readonly user_location?: {
364
448
  readonly type?: "approximate";
365
449
  readonly country?: string | null;
@@ -367,10 +451,7 @@ export declare const WebSearch: <Mode extends Tool.FailureMode | undefined = und
367
451
  readonly city?: string | null;
368
452
  readonly timezone?: string | null;
369
453
  } | null;
370
- readonly search_context_size?: "low" | "high" | "medium";
371
- readonly filters?: {
372
- readonly allowed_domains?: readonly string[] | null;
373
- } | null;
454
+ readonly search_context_size?: "high" | "low" | "medium";
374
455
  }) => Tool.ProviderDefined<"openai.web_search", "OpenAiWebSearch", {
375
456
  readonly args: Schema.Struct<{
376
457
  readonly filters: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
@@ -426,12 +507,21 @@ export declare const WebSearch: <Mode extends Tool.FailureMode | undefined = und
426
507
  readonly failureMode: Mode extends undefined ? "error" : Mode;
427
508
  }, false>;
428
509
  /**
429
- * OpenAI Web Search Preview tool.
510
+ * Defines the OpenAI preview Web Search tool for model responses.
511
+ *
512
+ * **When to use**
513
+ *
514
+ * Use to enable the preview OpenAI web search provider tool.
515
+ *
516
+ * **Details**
517
+ *
518
+ * The preview tool accepts optional user location and search context size, then
519
+ * exposes the performed search action and status in successful calls.
430
520
  *
431
- * Preview version of the web search tool with additional features.
521
+ * @see {@link WebSearch} for the stable web search provider tool
432
522
  *
433
- * @since 1.0.0
434
523
  * @category tools
524
+ * @since 4.0.0
435
525
  */
436
526
  export declare const WebSearchPreview: <Mode extends Tool.FailureMode | undefined = undefined>(args: {
437
527
  readonly user_location?: {
@@ -441,7 +531,7 @@ export declare const WebSearchPreview: <Mode extends Tool.FailureMode | undefine
441
531
  readonly city?: string | null;
442
532
  readonly timezone?: string | null;
443
533
  } | null;
444
- readonly search_context_size?: "low" | "high" | "medium";
534
+ readonly search_context_size?: "high" | "low" | "medium";
445
535
  }) => Tool.ProviderDefined<"openai.web_search_preview", "OpenAiWebSearchPreview", {
446
536
  readonly args: Schema.Struct<{
447
537
  readonly user_location: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAiTool.d.ts","sourceRoot":"","sources":["../src/OpenAiTool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAA;AAG/C;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAClB,UAAU,CAAC,OAAO,UAAU,CAAC,GAC7B,UAAU,CAAC,OAAO,eAAe,CAAC,GAClC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