@effect/ai-openai 4.0.0-beta.70 → 4.0.0-beta.71
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.
- package/dist/OpenAiClient.d.ts +87 -3
- package/dist/OpenAiClient.d.ts.map +1 -1
- package/dist/OpenAiClient.js +118 -6
- package/dist/OpenAiClient.js.map +1 -1
- package/dist/OpenAiConfig.d.ts +84 -15
- package/dist/OpenAiConfig.d.ts.map +1 -1
- package/dist/OpenAiConfig.js +52 -15
- package/dist/OpenAiConfig.js.map +1 -1
- package/dist/OpenAiEmbeddingModel.d.ts +126 -2
- package/dist/OpenAiEmbeddingModel.d.ts.map +1 -1
- package/dist/OpenAiEmbeddingModel.js +100 -2
- package/dist/OpenAiEmbeddingModel.js.map +1 -1
- package/dist/OpenAiLanguageModel.d.ts +138 -9
- package/dist/OpenAiLanguageModel.d.ts.map +1 -1
- package/dist/OpenAiLanguageModel.js +106 -7
- package/dist/OpenAiLanguageModel.js.map +1 -1
- package/dist/OpenAiSchema.d.ts +281 -12
- package/dist/OpenAiSchema.d.ts.map +1 -1
- package/dist/OpenAiSchema.js +227 -4
- package/dist/OpenAiSchema.js.map +1 -1
- package/dist/OpenAiTelemetry.d.ts +29 -1
- package/dist/OpenAiTelemetry.d.ts.map +1 -1
- package/dist/OpenAiTelemetry.js +29 -4
- package/dist/OpenAiTelemetry.js.map +1 -1
- package/dist/OpenAiTool.d.ts +111 -5
- package/dist/OpenAiTool.d.ts.map +1 -1
- package/dist/OpenAiTool.js +111 -5
- package/dist/OpenAiTool.js.map +1 -1
- package/dist/index.d.ts +1 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -49
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/OpenAiClient.ts +118 -6
- package/src/OpenAiConfig.ts +84 -15
- package/src/OpenAiEmbeddingModel.ts +152 -2
- package/src/OpenAiLanguageModel.ts +170 -11
- package/src/OpenAiSchema.ts +309 -4
- package/src/OpenAiTelemetry.ts +50 -5
- package/src/OpenAiTool.ts +111 -5
- package/src/index.ts +1 -49
package/dist/OpenAiTool.d.ts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OpenAI provider-defined tools for
|
|
2
|
+
* OpenAI provider-defined tools for Effect AI language model requests.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* This module exposes typed descriptors for OpenAI tools such as code
|
|
5
|
+
* interpreter, file search, image generation, MCP, web search, and shell-like
|
|
6
|
+
* local tools. Each descriptor captures the OpenAI provider name, user-facing
|
|
7
|
+
* configuration arguments, provider call parameters, success output schema, and
|
|
8
|
+
* whether the tool call needs an application-provided handler.
|
|
9
|
+
*
|
|
10
|
+
* **Mental model**
|
|
11
|
+
*
|
|
12
|
+
* Provider-defined tools are not implementations of the capability themselves.
|
|
13
|
+
* They are schemas and metadata that tell the language model provider which
|
|
14
|
+
* tool to make available and tell Effect AI how to decode any tool calls or
|
|
15
|
+
* tool results that come back.
|
|
16
|
+
*
|
|
17
|
+
* **Common tasks**
|
|
18
|
+
*
|
|
19
|
+
* Use hosted or provider-routed tools such as {@link CodeInterpreter},
|
|
20
|
+
* {@link FileSearch}, {@link ImageGeneration}, {@link Mcp}, {@link WebSearch},
|
|
21
|
+
* and {@link WebSearchPreview} to opt into OpenAI-managed capabilities. Use
|
|
22
|
+
* handler-required tools such as {@link ApplyPatch}, {@link Shell}, and
|
|
23
|
+
* {@link LocalShell} only when your application is prepared to execute the
|
|
24
|
+
* requested local operation and enforce its own safety policy.
|
|
6
25
|
*
|
|
7
26
|
* @since 4.0.0
|
|
8
27
|
*/
|
|
@@ -20,6 +39,12 @@ export type OpenAiTool = ReturnType<typeof ApplyPatch> | ReturnType<typeof CodeI
|
|
|
20
39
|
* deleting, or updating files. This local tool runs in your environment and
|
|
21
40
|
* requires a handler to execute file operations.
|
|
22
41
|
*
|
|
42
|
+
* **When to use**
|
|
43
|
+
*
|
|
44
|
+
* Use when you want an OpenAI model to request structured file edits as create,
|
|
45
|
+
* delete, or update operations that your application executes through a local
|
|
46
|
+
* handler.
|
|
47
|
+
*
|
|
23
48
|
* @category tools
|
|
24
49
|
* @since 4.0.0
|
|
25
50
|
*/
|
|
@@ -53,6 +78,16 @@ export declare const ApplyPatch: <Mode extends Tool.FailureMode | undefined = un
|
|
|
53
78
|
* OpenAI Code Interpreter tool that allows the model to execute Python code in
|
|
54
79
|
* a sandboxed environment.
|
|
55
80
|
*
|
|
81
|
+
* **When to use**
|
|
82
|
+
*
|
|
83
|
+
* Use to enable OpenAI-hosted Python execution for a model response.
|
|
84
|
+
*
|
|
85
|
+
* **Details**
|
|
86
|
+
*
|
|
87
|
+
* The tool is configured with a `container` argument. Successful tool calls
|
|
88
|
+
* expose `outputs`, which may contain logs or generated images, or `null` when
|
|
89
|
+
* no outputs are available.
|
|
90
|
+
*
|
|
56
91
|
* @category tools
|
|
57
92
|
* @since 4.0.0
|
|
58
93
|
*/
|
|
@@ -112,6 +147,17 @@ export declare const CodeInterpreter: <Mode extends Tool.FailureMode | undefined
|
|
|
112
147
|
* OpenAI File Search tool that enables the model to search through uploaded
|
|
113
148
|
* files and vector stores.
|
|
114
149
|
*
|
|
150
|
+
* **When to use**
|
|
151
|
+
*
|
|
152
|
+
* Use to let an OpenAI model search uploaded files through one or more vector
|
|
153
|
+
* stores.
|
|
154
|
+
*
|
|
155
|
+
* **Details**
|
|
156
|
+
*
|
|
157
|
+
* The tool requires `vector_store_ids` and accepts optional `filters`,
|
|
158
|
+
* `max_num_results`, and `ranking_options`. Successful tool calls expose the
|
|
159
|
+
* search `status`, generated `queries`, and optional `results`.
|
|
160
|
+
*
|
|
115
161
|
* @category tools
|
|
116
162
|
* @since 4.0.0
|
|
117
163
|
*/
|
|
@@ -178,6 +224,18 @@ export declare const FileSearch: <Mode extends Tool.FailureMode | undefined = un
|
|
|
178
224
|
* OpenAI Image Generation tool that enables the model to generate images using
|
|
179
225
|
* the GPT image models.
|
|
180
226
|
*
|
|
227
|
+
* **When to use**
|
|
228
|
+
*
|
|
229
|
+
* Use to enable OpenAI provider-defined image generation through a language
|
|
230
|
+
* model response.
|
|
231
|
+
*
|
|
232
|
+
* **Details**
|
|
233
|
+
*
|
|
234
|
+
* The tool configures the `image_generation` provider tool, including model,
|
|
235
|
+
* size, quality, output format, moderation, background, input-image options,
|
|
236
|
+
* and partial image settings. Successful tool calls expose `result` as base64
|
|
237
|
+
* image data or `null`.
|
|
238
|
+
*
|
|
181
239
|
* @category tools
|
|
182
240
|
* @since 4.0.0
|
|
183
241
|
*/
|
|
@@ -223,6 +281,17 @@ export declare const ImageGeneration: <Mode extends Tool.FailureMode | undefined
|
|
|
223
281
|
* shell. This local tool runs in your environment and requires a handler to
|
|
224
282
|
* execute commands.
|
|
225
283
|
*
|
|
284
|
+
* **When to use**
|
|
285
|
+
*
|
|
286
|
+
* Use to let an OpenAI model request local shell commands that your application
|
|
287
|
+
* executes through a handler.
|
|
288
|
+
*
|
|
289
|
+
* **Details**
|
|
290
|
+
*
|
|
291
|
+
* The tool exposes a provider-defined `local_shell` call. It is marked as
|
|
292
|
+
* handler-required, so applications must provide the command execution policy
|
|
293
|
+
* and implementation.
|
|
294
|
+
*
|
|
226
295
|
* @category tools
|
|
227
296
|
* @since 4.0.0
|
|
228
297
|
*/
|
|
@@ -250,6 +319,22 @@ export declare const LocalShell: <Mode extends Tool.FailureMode | undefined = un
|
|
|
250
319
|
* OpenAI MCP tool that gives the model access to additional tools via remote
|
|
251
320
|
* Model Context Protocol (MCP) servers.
|
|
252
321
|
*
|
|
322
|
+
* **When to use**
|
|
323
|
+
*
|
|
324
|
+
* Use to let an OpenAI model call tools exposed by a remote MCP server.
|
|
325
|
+
*
|
|
326
|
+
* **Details**
|
|
327
|
+
*
|
|
328
|
+
* The tool accepts MCP server configuration such as allowed tools,
|
|
329
|
+
* authorization, connector id, approval requirements, server metadata, and
|
|
330
|
+
* server URL. Tool call results include the called tool name, arguments, output,
|
|
331
|
+
* error, and server label.
|
|
332
|
+
*
|
|
333
|
+
* **Gotchas**
|
|
334
|
+
*
|
|
335
|
+
* This schema leaves both `server_url` and `connector_id` optional, but OpenAI
|
|
336
|
+
* may require a server URL or connector id for a usable MCP tool configuration.
|
|
337
|
+
*
|
|
253
338
|
* @category tools
|
|
254
339
|
* @since 4.0.0
|
|
255
340
|
*/
|
|
@@ -346,6 +431,17 @@ export declare const Shell: <Mode extends Tool.FailureMode | undefined = undefin
|
|
|
346
431
|
* OpenAI Web Search tool that enables the model to search the web for
|
|
347
432
|
* information.
|
|
348
433
|
*
|
|
434
|
+
* **When to use**
|
|
435
|
+
*
|
|
436
|
+
* Use to enable OpenAI provider-defined web search for a model response.
|
|
437
|
+
*
|
|
438
|
+
* **Details**
|
|
439
|
+
*
|
|
440
|
+
* The tool accepts optional filters, user location, and search context size.
|
|
441
|
+
* Successful calls expose the performed search action and status.
|
|
442
|
+
*
|
|
443
|
+
* @see {@link WebSearchPreview} for the preview web search provider tool
|
|
444
|
+
*
|
|
349
445
|
* @category tools
|
|
350
446
|
* @since 4.0.0
|
|
351
447
|
*/
|
|
@@ -416,8 +512,18 @@ export declare const WebSearch: <Mode extends Tool.FailureMode | undefined = und
|
|
|
416
512
|
readonly failureMode: Mode extends undefined ? "error" : Mode;
|
|
417
513
|
}, false>;
|
|
418
514
|
/**
|
|
419
|
-
* OpenAI Web Search
|
|
420
|
-
*
|
|
515
|
+
* OpenAI preview Web Search tool for model responses.
|
|
516
|
+
*
|
|
517
|
+
* **When to use**
|
|
518
|
+
*
|
|
519
|
+
* Use to enable the preview OpenAI web search provider tool.
|
|
520
|
+
*
|
|
521
|
+
* **Details**
|
|
522
|
+
*
|
|
523
|
+
* The preview tool accepts optional user location and search context size, then
|
|
524
|
+
* exposes the performed search action and status in successful calls.
|
|
525
|
+
*
|
|
526
|
+
* @see {@link WebSearch} for the stable web search provider tool
|
|
421
527
|
*
|
|
422
528
|
* @category tools
|
|
423
529
|
* @since 4.0.0
|
package/dist/OpenAiTool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAiTool.d.ts","sourceRoot":"","sources":["../src/OpenAiTool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"OpenAiTool.d.ts","sourceRoot":"","sources":["../src/OpenAiTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;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,UAAU,CAAC,OAAO,UAAU,CAAC,GAC7B,UAAU,CAAC,OAAO,KAAK,CAAC,GACxB,UAAU,CAAC,OAAO,eAAe,CAAC,GAClC,UAAU,CAAC,OAAO,UAAU,CAAC,GAC7B,UAAU,CAAC,OAAO,GAAG,CAAC,GACtB,UAAU,CAAC,OAAO,SAAS,CAAC,GAC5B,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEvC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;QAarB,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAc1B,CAAA;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAerB,CAAA;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAmB1B,CAAA;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;QAWrB,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAsBd,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;QAWhB,CAAA;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAgBpB,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAY3B,CAAA"}
|
package/dist/OpenAiTool.js
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OpenAI provider-defined tools for
|
|
2
|
+
* OpenAI provider-defined tools for Effect AI language model requests.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* This module exposes typed descriptors for OpenAI tools such as code
|
|
5
|
+
* interpreter, file search, image generation, MCP, web search, and shell-like
|
|
6
|
+
* local tools. Each descriptor captures the OpenAI provider name, user-facing
|
|
7
|
+
* configuration arguments, provider call parameters, success output schema, and
|
|
8
|
+
* whether the tool call needs an application-provided handler.
|
|
9
|
+
*
|
|
10
|
+
* **Mental model**
|
|
11
|
+
*
|
|
12
|
+
* Provider-defined tools are not implementations of the capability themselves.
|
|
13
|
+
* They are schemas and metadata that tell the language model provider which
|
|
14
|
+
* tool to make available and tell Effect AI how to decode any tool calls or
|
|
15
|
+
* tool results that come back.
|
|
16
|
+
*
|
|
17
|
+
* **Common tasks**
|
|
18
|
+
*
|
|
19
|
+
* Use hosted or provider-routed tools such as {@link CodeInterpreter},
|
|
20
|
+
* {@link FileSearch}, {@link ImageGeneration}, {@link Mcp}, {@link WebSearch},
|
|
21
|
+
* and {@link WebSearchPreview} to opt into OpenAI-managed capabilities. Use
|
|
22
|
+
* handler-required tools such as {@link ApplyPatch}, {@link Shell}, and
|
|
23
|
+
* {@link LocalShell} only when your application is prepared to execute the
|
|
24
|
+
* requested local operation and enforce its own safety policy.
|
|
6
25
|
*
|
|
7
26
|
* @since 4.0.0
|
|
8
27
|
*/
|
|
@@ -14,6 +33,12 @@ import * as Generated from "./Generated.js";
|
|
|
14
33
|
* deleting, or updating files. This local tool runs in your environment and
|
|
15
34
|
* requires a handler to execute file operations.
|
|
16
35
|
*
|
|
36
|
+
* **When to use**
|
|
37
|
+
*
|
|
38
|
+
* Use when you want an OpenAI model to request structured file edits as create,
|
|
39
|
+
* delete, or update operations that your application executes through a local
|
|
40
|
+
* handler.
|
|
41
|
+
*
|
|
17
42
|
* @category tools
|
|
18
43
|
* @since 4.0.0
|
|
19
44
|
*/
|
|
@@ -35,6 +60,16 @@ export const ApplyPatch = /*#__PURE__*/Tool.providerDefined({
|
|
|
35
60
|
* OpenAI Code Interpreter tool that allows the model to execute Python code in
|
|
36
61
|
* a sandboxed environment.
|
|
37
62
|
*
|
|
63
|
+
* **When to use**
|
|
64
|
+
*
|
|
65
|
+
* Use to enable OpenAI-hosted Python execution for a model response.
|
|
66
|
+
*
|
|
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.
|
|
72
|
+
*
|
|
38
73
|
* @category tools
|
|
39
74
|
* @since 4.0.0
|
|
40
75
|
*/
|
|
@@ -57,6 +92,17 @@ export const CodeInterpreter = /*#__PURE__*/Tool.providerDefined({
|
|
|
57
92
|
* OpenAI File Search tool that enables the model to search through uploaded
|
|
58
93
|
* files and vector stores.
|
|
59
94
|
*
|
|
95
|
+
* **When to use**
|
|
96
|
+
*
|
|
97
|
+
* Use to let an OpenAI model search uploaded files through one or more vector
|
|
98
|
+
* stores.
|
|
99
|
+
*
|
|
100
|
+
* **Details**
|
|
101
|
+
*
|
|
102
|
+
* The tool requires `vector_store_ids` and accepts optional `filters`,
|
|
103
|
+
* `max_num_results`, and `ranking_options`. Successful tool calls expose the
|
|
104
|
+
* search `status`, generated `queries`, and optional `results`.
|
|
105
|
+
*
|
|
60
106
|
* @category tools
|
|
61
107
|
* @since 4.0.0
|
|
62
108
|
*/
|
|
@@ -80,6 +126,18 @@ export const FileSearch = /*#__PURE__*/Tool.providerDefined({
|
|
|
80
126
|
* OpenAI Image Generation tool that enables the model to generate images using
|
|
81
127
|
* the GPT image models.
|
|
82
128
|
*
|
|
129
|
+
* **When to use**
|
|
130
|
+
*
|
|
131
|
+
* Use to enable OpenAI provider-defined image generation through a language
|
|
132
|
+
* model response.
|
|
133
|
+
*
|
|
134
|
+
* **Details**
|
|
135
|
+
*
|
|
136
|
+
* The tool configures the `image_generation` provider tool, including model,
|
|
137
|
+
* size, quality, output format, moderation, background, input-image options,
|
|
138
|
+
* and partial image settings. Successful tool calls expose `result` as base64
|
|
139
|
+
* image data or `null`.
|
|
140
|
+
*
|
|
83
141
|
* @category tools
|
|
84
142
|
* @since 4.0.0
|
|
85
143
|
*/
|
|
@@ -108,6 +166,17 @@ export const ImageGeneration = /*#__PURE__*/Tool.providerDefined({
|
|
|
108
166
|
* shell. This local tool runs in your environment and requires a handler to
|
|
109
167
|
* execute commands.
|
|
110
168
|
*
|
|
169
|
+
* **When to use**
|
|
170
|
+
*
|
|
171
|
+
* Use to let an OpenAI model request local shell commands that your application
|
|
172
|
+
* executes through a handler.
|
|
173
|
+
*
|
|
174
|
+
* **Details**
|
|
175
|
+
*
|
|
176
|
+
* The tool exposes a provider-defined `local_shell` call. It is marked as
|
|
177
|
+
* handler-required, so applications must provide the command execution policy
|
|
178
|
+
* and implementation.
|
|
179
|
+
*
|
|
111
180
|
* @category tools
|
|
112
181
|
* @since 4.0.0
|
|
113
182
|
*/
|
|
@@ -127,6 +196,22 @@ export const LocalShell = /*#__PURE__*/Tool.providerDefined({
|
|
|
127
196
|
* OpenAI MCP tool that gives the model access to additional tools via remote
|
|
128
197
|
* Model Context Protocol (MCP) servers.
|
|
129
198
|
*
|
|
199
|
+
* **When to use**
|
|
200
|
+
*
|
|
201
|
+
* Use to let an OpenAI model call tools exposed by a remote MCP server.
|
|
202
|
+
*
|
|
203
|
+
* **Details**
|
|
204
|
+
*
|
|
205
|
+
* The tool accepts MCP server configuration such as allowed tools,
|
|
206
|
+
* authorization, connector id, approval requirements, server metadata, and
|
|
207
|
+
* server URL. Tool call results include the called tool name, arguments, output,
|
|
208
|
+
* error, and server label.
|
|
209
|
+
*
|
|
210
|
+
* **Gotchas**
|
|
211
|
+
*
|
|
212
|
+
* This schema leaves both `server_url` and `connector_id` optional, but OpenAI
|
|
213
|
+
* may require a server URL or connector id for a usable MCP tool configuration.
|
|
214
|
+
*
|
|
130
215
|
* @category tools
|
|
131
216
|
* @since 4.0.0
|
|
132
217
|
*/
|
|
@@ -177,6 +262,17 @@ export const Shell = /*#__PURE__*/Tool.providerDefined({
|
|
|
177
262
|
* OpenAI Web Search tool that enables the model to search the web for
|
|
178
263
|
* information.
|
|
179
264
|
*
|
|
265
|
+
* **When to use**
|
|
266
|
+
*
|
|
267
|
+
* Use to enable OpenAI provider-defined web search for a model response.
|
|
268
|
+
*
|
|
269
|
+
* **Details**
|
|
270
|
+
*
|
|
271
|
+
* The tool accepts optional filters, user location, and search context size.
|
|
272
|
+
* Successful calls expose the performed search action and status.
|
|
273
|
+
*
|
|
274
|
+
* @see {@link WebSearchPreview} for the preview web search provider tool
|
|
275
|
+
*
|
|
180
276
|
* @category tools
|
|
181
277
|
* @since 4.0.0
|
|
182
278
|
*/
|
|
@@ -198,8 +294,18 @@ export const WebSearch = /*#__PURE__*/Tool.providerDefined({
|
|
|
198
294
|
})
|
|
199
295
|
});
|
|
200
296
|
/**
|
|
201
|
-
* OpenAI Web Search
|
|
202
|
-
*
|
|
297
|
+
* OpenAI preview Web Search tool for model responses.
|
|
298
|
+
*
|
|
299
|
+
* **When to use**
|
|
300
|
+
*
|
|
301
|
+
* Use to enable the preview OpenAI web search provider tool.
|
|
302
|
+
*
|
|
303
|
+
* **Details**
|
|
304
|
+
*
|
|
305
|
+
* The preview tool accepts optional user location and search context size, then
|
|
306
|
+
* exposes the performed search action and status in successful calls.
|
|
307
|
+
*
|
|
308
|
+
* @see {@link WebSearch} for the stable web search provider tool
|
|
203
309
|
*
|
|
204
310
|
* @category tools
|
|
205
311
|
* @since 4.0.0
|
package/dist/OpenAiTool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAiTool.js","names":["Schema","Tool","Generated","ApplyPatch","providerDefined","id","customName","providerName","requiresHandler","parameters","Struct","call_id","ApplyPatchToolCall","fields","operation","success","status","ApplyPatchToolCallOutput","output","CodeInterpreter","args","container","CodeInterpreterTool","code","CodeInterpreterToolCall","container_id","outputs","FileSearch","filters","FileSearchTool","max_num_results","ranking_options","vector_store_ids","FileSearchToolCall","queries","results","ImageGeneration","background","ImageGenTool","input_fidelity","input_image_mask","model","moderation","output_compression","output_format","partial_images","quality","size","result","ImageGenToolCall","LocalShell","action","LocalShellToolCall","LocalShellToolCallOutput","Mcp","allowed_tools","MCPTool","authorization","connector_id","require_approval","server_description","server_label","server_url","Unknown","type","MCPToolCall","name","arguments","error","Shell","FunctionShellCall","FunctionShellCallOutput","WebSearch","WebSearchTool","user_location","search_context_size","WebSearchToolCall","WebSearchPreview","WebSearchPreviewTool"],"sources":["../src/OpenAiTool.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"OpenAiTool.js","names":["Schema","Tool","Generated","ApplyPatch","providerDefined","id","customName","providerName","requiresHandler","parameters","Struct","call_id","ApplyPatchToolCall","fields","operation","success","status","ApplyPatchToolCallOutput","output","CodeInterpreter","args","container","CodeInterpreterTool","code","CodeInterpreterToolCall","container_id","outputs","FileSearch","filters","FileSearchTool","max_num_results","ranking_options","vector_store_ids","FileSearchToolCall","queries","results","ImageGeneration","background","ImageGenTool","input_fidelity","input_image_mask","model","moderation","output_compression","output_format","partial_images","quality","size","result","ImageGenToolCall","LocalShell","action","LocalShellToolCall","LocalShellToolCallOutput","Mcp","allowed_tools","MCPTool","authorization","connector_id","require_approval","server_description","server_label","server_url","Unknown","type","MCPToolCall","name","arguments","error","Shell","FunctionShellCall","FunctionShellCallOutput","WebSearch","WebSearchTool","user_location","search_context_size","WebSearchToolCall","WebSearchPreview","WebSearchPreviewTool"],"sources":["../src/OpenAiTool.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,yBAAyB;AAC/C,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAmB3C;;;;;;;;;;;;;;AAcA,OAAO,MAAMC,UAAU,gBAAGF,IAAI,CAACG,eAAe,CAAC;EAC7CC,EAAE,EAAE,oBAAoB;EACxBC,UAAU,EAAE,kBAAkB;EAC9BC,YAAY,EAAE,aAAa;EAC3BC,eAAe,EAAE,IAAI;EACrBC,UAAU,eAAET,MAAM,CAACU,MAAM,CAAC;IACxBC,OAAO,EAAET,SAAS,CAACU,kBAAkB,CAACC,MAAM,CAACF,OAAO;IACpDG,SAAS,EAAEZ,SAAS,CAACU,kBAAkB,CAACC,MAAM,CAACC;GAChD,CAAC;EACFC,OAAO,eAAEf,MAAM,CAACU,MAAM,CAAC;IACrBM,MAAM,EAAEd,SAAS,CAACe,wBAAwB,CAACJ,MAAM,CAACG,MAAM;IACxDE,MAAM,EAAEhB,SAAS,CAACe,wBAAwB,CAACJ,MAAM,CAACK;GACnD;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMC,eAAe,gB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AAC;IACxByC,MAAM,EAAEjD,SAAS,CAAC0E,iBAAiB,CAAC/D,MAAM,CAACsC;GAC5C,CAAC;EACFpC,OAAO,eAAEf,MAAM,CAACU,MAAM,CAAC;IACrByC,MAAM,EAAEjD,SAAS,CAAC0E,iBAAiB,CAAC/D,MAAM,CAACsC,MAAM;IACjDnC,MAAM,EAAEd,SAAS,CAAC0E,iBAAiB,CAAC/D,MAAM,CAACG;GAC5C;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAM6D,gBAAgB,gBAAG5E,IAAI,CAACG,eAAe,CAAC;EACnDC,EAAE,EAAE,2BAA2B;EAC/BC,UAAU,EAAE,wBAAwB;EACpCC,YAAY,EAAE,oBAAoB;EAClCa,IAAI,eAAEpB,MAAM,CAACU,MAAM,CAAC;IAClBgE,aAAa,EAAExE,SAAS,CAAC4E,oBAAoB,CAACjE,MAAM,CAAC6D,aAAa;IAClEC,mBAAmB,EAAEzE,SAAS,CAAC4E,oBAAoB,CAACjE,MAAM,CAAC8D;GAC5D,CAAC;EACF5D,OAAO,eAAEf,MAAM,CAACU,MAAM,CAAC;IACrByC,MAAM,EAAEjD,SAAS,CAAC0E,iBAAiB,CAAC/D,MAAM,CAACsC,MAAM;IACjDnC,MAAM,EAAEd,SAAS,CAAC0E,iBAAiB,CAAC/D,MAAM,CAACG;GAC5C;CACF,CAAC","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* @since
|
|
5
|
+
* @since 1.0.0
|
|
6
6
|
*/
|
|
7
7
|
export * as Generated from "./Generated.ts";
|
|
8
8
|
/**
|
|
9
|
-
* OpenAI Client module for interacting with OpenAI's API.
|
|
10
|
-
*
|
|
11
|
-
* Provides a type-safe, Effect-based client for OpenAI operations including
|
|
12
|
-
* completions, embeddings, and streaming responses.
|
|
13
|
-
*
|
|
14
9
|
* @since 4.0.0
|
|
15
10
|
*/
|
|
16
11
|
export * as OpenAiClient from "./OpenAiClient.ts";
|
|
@@ -19,73 +14,30 @@ export * as OpenAiClient from "./OpenAiClient.ts";
|
|
|
19
14
|
*/
|
|
20
15
|
export * as OpenAiClientGenerated from "./OpenAiClientGenerated.ts";
|
|
21
16
|
/**
|
|
22
|
-
* The `OpenAiConfig` module provides contextual configuration for the
|
|
23
|
-
* `@effect/ai-openai` integration. It is used to customize how OpenAI clients
|
|
24
|
-
* are built and interpreted without threading configuration through every API
|
|
25
|
-
* call manually.
|
|
26
|
-
*
|
|
27
|
-
* The primary use case is installing an HTTP client transform with
|
|
28
|
-
* {@link withClientTransform}. This lets applications adapt the underlying
|
|
29
|
-
* OpenAI HTTP client for cross-cutting concerns such as custom middleware,
|
|
30
|
-
* instrumentation, proxying, or request policy changes while keeping the
|
|
31
|
-
* OpenAI service APIs unchanged.
|
|
32
|
-
*
|
|
33
|
-
* Configuration is scoped through Effect's context, so transforms only apply to
|
|
34
|
-
* the effect they are provided to and anything evaluated inside that scope.
|
|
35
|
-
* When multiple transforms are needed, compose them into a single
|
|
36
|
-
* `HttpClient => HttpClient` function before providing the configuration.
|
|
37
|
-
*
|
|
38
17
|
* @since 4.0.0
|
|
39
18
|
*/
|
|
40
19
|
export * as OpenAiConfig from "./OpenAiConfig.ts";
|
|
41
20
|
/**
|
|
42
|
-
* OpenAI Embedding Model implementation.
|
|
43
|
-
*
|
|
44
|
-
* Provides an EmbeddingModel implementation for OpenAI's embeddings API.
|
|
45
|
-
*
|
|
46
21
|
* @since 4.0.0
|
|
47
22
|
*/
|
|
48
23
|
export * as OpenAiEmbeddingModel from "./OpenAiEmbeddingModel.ts";
|
|
49
24
|
/**
|
|
50
|
-
* OpenAI error metadata augmentation.
|
|
51
|
-
*
|
|
52
|
-
* Provides OpenAI-specific metadata fields for AI error types through module
|
|
53
|
-
* augmentation, enabling typed access to OpenAI error details.
|
|
54
|
-
*
|
|
55
25
|
* @since 4.0.0
|
|
56
26
|
*/
|
|
57
27
|
export * as OpenAiError from "./OpenAiError.ts";
|
|
58
28
|
/**
|
|
59
|
-
* OpenAI Language Model implementation.
|
|
60
|
-
*
|
|
61
|
-
* Provides a LanguageModel implementation for OpenAI's responses API,
|
|
62
|
-
* supporting text generation, structured output, tool calling, and streaming.
|
|
63
|
-
*
|
|
64
29
|
* @since 4.0.0
|
|
65
30
|
*/
|
|
66
31
|
export * as OpenAiLanguageModel from "./OpenAiLanguageModel.ts";
|
|
67
32
|
/**
|
|
68
|
-
* Minimal local OpenAI schemas used by the handwritten Responses client path.
|
|
69
|
-
*
|
|
70
33
|
* @since 4.0.0
|
|
71
34
|
*/
|
|
72
35
|
export * as OpenAiSchema from "./OpenAiSchema.ts";
|
|
73
36
|
/**
|
|
74
|
-
* OpenAI telemetry attributes for OpenTelemetry integration.
|
|
75
|
-
*
|
|
76
|
-
* Provides OpenAI-specific GenAI telemetry attributes following OpenTelemetry
|
|
77
|
-
* semantic conventions, extending the base GenAI attributes with OpenAI-specific
|
|
78
|
-
* request and response metadata.
|
|
79
|
-
*
|
|
80
37
|
* @since 4.0.0
|
|
81
38
|
*/
|
|
82
39
|
export * as OpenAiTelemetry from "./OpenAiTelemetry.ts";
|
|
83
40
|
/**
|
|
84
|
-
* OpenAI provider-defined tools for use with the LanguageModel.
|
|
85
|
-
*
|
|
86
|
-
* Provides tools that are natively supported by OpenAI's API, including
|
|
87
|
-
* code interpreter, file search, and web search functionality.
|
|
88
|
-
*
|
|
89
41
|
* @since 4.0.0
|
|
90
42
|
*/
|
|
91
43
|
export * as OpenAiTool from "./OpenAiTool.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;GAEG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA;AAEnE;;GAEG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAA;AAEjE;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAA;AAE/D;;GAEG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;GAEG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,15 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
5
5
|
/**
|
|
6
|
-
* @since
|
|
6
|
+
* @since 1.0.0
|
|
7
7
|
*/
|
|
8
8
|
export * as Generated from "./Generated.js";
|
|
9
9
|
/**
|
|
10
|
-
* OpenAI Client module for interacting with OpenAI's API.
|
|
11
|
-
*
|
|
12
|
-
* Provides a type-safe, Effect-based client for OpenAI operations including
|
|
13
|
-
* completions, embeddings, and streaming responses.
|
|
14
|
-
*
|
|
15
10
|
* @since 4.0.0
|
|
16
11
|
*/
|
|
17
12
|
export * as OpenAiClient from "./OpenAiClient.js";
|
|
@@ -20,73 +15,30 @@ export * as OpenAiClient from "./OpenAiClient.js";
|
|
|
20
15
|
*/
|
|
21
16
|
export * as OpenAiClientGenerated from "./OpenAiClientGenerated.js";
|
|
22
17
|
/**
|
|
23
|
-
* The `OpenAiConfig` module provides contextual configuration for the
|
|
24
|
-
* `@effect/ai-openai` integration. It is used to customize how OpenAI clients
|
|
25
|
-
* are built and interpreted without threading configuration through every API
|
|
26
|
-
* call manually.
|
|
27
|
-
*
|
|
28
|
-
* The primary use case is installing an HTTP client transform with
|
|
29
|
-
* {@link withClientTransform}. This lets applications adapt the underlying
|
|
30
|
-
* OpenAI HTTP client for cross-cutting concerns such as custom middleware,
|
|
31
|
-
* instrumentation, proxying, or request policy changes while keeping the
|
|
32
|
-
* OpenAI service APIs unchanged.
|
|
33
|
-
*
|
|
34
|
-
* Configuration is scoped through Effect's context, so transforms only apply to
|
|
35
|
-
* the effect they are provided to and anything evaluated inside that scope.
|
|
36
|
-
* When multiple transforms are needed, compose them into a single
|
|
37
|
-
* `HttpClient => HttpClient` function before providing the configuration.
|
|
38
|
-
*
|
|
39
18
|
* @since 4.0.0
|
|
40
19
|
*/
|
|
41
20
|
export * as OpenAiConfig from "./OpenAiConfig.js";
|
|
42
21
|
/**
|
|
43
|
-
* OpenAI Embedding Model implementation.
|
|
44
|
-
*
|
|
45
|
-
* Provides an EmbeddingModel implementation for OpenAI's embeddings API.
|
|
46
|
-
*
|
|
47
22
|
* @since 4.0.0
|
|
48
23
|
*/
|
|
49
24
|
export * as OpenAiEmbeddingModel from "./OpenAiEmbeddingModel.js";
|
|
50
25
|
/**
|
|
51
|
-
* OpenAI error metadata augmentation.
|
|
52
|
-
*
|
|
53
|
-
* Provides OpenAI-specific metadata fields for AI error types through module
|
|
54
|
-
* augmentation, enabling typed access to OpenAI error details.
|
|
55
|
-
*
|
|
56
26
|
* @since 4.0.0
|
|
57
27
|
*/
|
|
58
28
|
export * as OpenAiError from "./OpenAiError.js";
|
|
59
29
|
/**
|
|
60
|
-
* OpenAI Language Model implementation.
|
|
61
|
-
*
|
|
62
|
-
* Provides a LanguageModel implementation for OpenAI's responses API,
|
|
63
|
-
* supporting text generation, structured output, tool calling, and streaming.
|
|
64
|
-
*
|
|
65
30
|
* @since 4.0.0
|
|
66
31
|
*/
|
|
67
32
|
export * as OpenAiLanguageModel from "./OpenAiLanguageModel.js";
|
|
68
33
|
/**
|
|
69
|
-
* Minimal local OpenAI schemas used by the handwritten Responses client path.
|
|
70
|
-
*
|
|
71
34
|
* @since 4.0.0
|
|
72
35
|
*/
|
|
73
36
|
export * as OpenAiSchema from "./OpenAiSchema.js";
|
|
74
37
|
/**
|
|
75
|
-
* OpenAI telemetry attributes for OpenTelemetry integration.
|
|
76
|
-
*
|
|
77
|
-
* Provides OpenAI-specific GenAI telemetry attributes following OpenTelemetry
|
|
78
|
-
* semantic conventions, extending the base GenAI attributes with OpenAI-specific
|
|
79
|
-
* request and response metadata.
|
|
80
|
-
*
|
|
81
38
|
* @since 4.0.0
|
|
82
39
|
*/
|
|
83
40
|
export * as OpenAiTelemetry from "./OpenAiTelemetry.js";
|
|
84
41
|
/**
|
|
85
|
-
* OpenAI provider-defined tools for use with the LanguageModel.
|
|
86
|
-
*
|
|
87
|
-
* Provides tools that are natively supported by OpenAI's API, including
|
|
88
|
-
* code interpreter, file search, and web search functionality.
|
|
89
|
-
*
|
|
90
42
|
* @since 4.0.0
|
|
91
43
|
*/
|
|
92
44
|
export * as OpenAiTool from "./OpenAiTool.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Generated","OpenAiClient","OpenAiClientGenerated","OpenAiConfig","OpenAiEmbeddingModel","OpenAiError","OpenAiLanguageModel","OpenAiSchema","OpenAiTelemetry","OpenAiTool"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;AAGA,OAAO,KAAKA,SAAS,MAAM,gBAAgB;AAE3C
|
|
1
|
+
{"version":3,"file":"index.js","names":["Generated","OpenAiClient","OpenAiClientGenerated","OpenAiConfig","OpenAiEmbeddingModel","OpenAiError","OpenAiLanguageModel","OpenAiSchema","OpenAiTelemetry","OpenAiTool"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;AAGA,OAAO,KAAKA,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAEjD;;;AAGA,OAAO,KAAKC,qBAAqB,MAAM,4BAA4B;AAEnE;;;AAGA,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAEjD;;;AAGA,OAAO,KAAKC,oBAAoB,MAAM,2BAA2B;AAEjE;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,mBAAmB,MAAM,0BAA0B;AAE/D;;;AAGA,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAEjD;;;AAGA,OAAO,KAAKC,eAAe,MAAM,sBAAsB;AAEvD;;;AAGA,OAAO,KAAKC,UAAU,MAAM,iBAAiB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/ai-openai",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.71",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "An OpenAI provider integration for Effect AI SDK",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"provenance": true
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"effect": "^4.0.0-beta.
|
|
46
|
+
"effect": "^4.0.0-beta.71"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"effect": "^4.0.0-beta.
|
|
49
|
+
"effect": "^4.0.0-beta.71"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"codegen": "effect-utils codegen",
|