@depup/ai-sdk__openai 3.0.41-depup.0 → 3.0.48-depup.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.
- package/CHANGELOG.md +70 -22
- package/README.md +2 -2
- package/changes.json +1 -1
- package/dist/index.d.mts +90 -4
- package/dist/index.d.ts +90 -4
- package/dist/index.js +1196 -859
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1150 -808
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +53 -3
- package/dist/internal/index.d.ts +53 -3
- package/dist/internal/index.js +1227 -901
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1209 -878
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +144 -0
- package/package.json +6 -8
- package/src/chat/openai-chat-options.ts +9 -0
- package/src/openai-language-model-capabilities.ts +7 -4
- package/src/openai-tools.ts +12 -0
- package/src/responses/convert-to-openai-responses-input.ts +109 -5
- package/src/responses/openai-responses-api.ts +112 -1
- package/src/responses/openai-responses-language-model.ts +158 -0
- package/src/responses/openai-responses-options.ts +18 -0
- package/src/responses/openai-responses-prepare-tools.ts +26 -1
- package/src/tool/tool-search.ts +98 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.48
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9c548de: Add `gpt-5.4-mini`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano`, and `gpt-5.4-nano-2026-03-17` models.
|
|
8
|
+
- bcb04df: fix(openai): preserve raw finish reason for failed responses stream events
|
|
9
|
+
|
|
10
|
+
Handle `response.failed` chunks in Responses API streaming so `finishReason.raw` is preserved from `incomplete_details.reason` (e.g. `max_output_tokens`), and map failed-without-reason cases to unified `error` instead of `other`.
|
|
11
|
+
|
|
12
|
+
## 3.0.47
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 055cd68: fix: publish v6 to latest npm dist tag
|
|
17
|
+
- Updated dependencies [055cd68]
|
|
18
|
+
- @ai-sdk/provider-utils@4.0.21
|
|
19
|
+
|
|
20
|
+
## 3.0.46
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 75fc0e7: feat(openai): add new tool search tool
|
|
25
|
+
|
|
26
|
+
## 3.0.45
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 023088c: feat(provider/openai): add `gpt-5.3-chat-latest`
|
|
31
|
+
|
|
32
|
+
## 3.0.44
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- f4a734a: fix(provider/openai): drop reasoning parts without encrypted content when store: false
|
|
37
|
+
|
|
38
|
+
## 3.0.43
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Updated dependencies [64ac0fd]
|
|
43
|
+
- @ai-sdk/provider-utils@4.0.20
|
|
44
|
+
|
|
45
|
+
## 3.0.42
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- 2589004: feat(provider/openai): add GPT-5.4 model support
|
|
50
|
+
|
|
3
51
|
## 3.0.41
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
|
@@ -335,13 +383,13 @@
|
|
|
335
383
|
Before
|
|
336
384
|
|
|
337
385
|
```ts
|
|
338
|
-
model.textEmbeddingModel(
|
|
386
|
+
model.textEmbeddingModel("my-model-id");
|
|
339
387
|
```
|
|
340
388
|
|
|
341
389
|
After
|
|
342
390
|
|
|
343
391
|
```ts
|
|
344
|
-
model.embeddingModel(
|
|
392
|
+
model.embeddingModel("my-model-id");
|
|
345
393
|
```
|
|
346
394
|
|
|
347
395
|
- 60f4775: fix: remove code for unsuported o1-mini and o1-preview models
|
|
@@ -351,15 +399,15 @@
|
|
|
351
399
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
352
400
|
|
|
353
401
|
```ts
|
|
354
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
355
|
-
import { generateText } from
|
|
402
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
403
|
+
import { generateText } from "ai";
|
|
356
404
|
|
|
357
405
|
await generateText({
|
|
358
|
-
model: openai.chat(
|
|
359
|
-
prompt:
|
|
406
|
+
model: openai.chat("gpt-4o"),
|
|
407
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
360
408
|
providerOptions: {
|
|
361
409
|
openai: {
|
|
362
|
-
user:
|
|
410
|
+
user: "user-123",
|
|
363
411
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
364
412
|
},
|
|
365
413
|
});
|
|
@@ -760,13 +808,13 @@
|
|
|
760
808
|
Before
|
|
761
809
|
|
|
762
810
|
```ts
|
|
763
|
-
model.textEmbeddingModel(
|
|
811
|
+
model.textEmbeddingModel("my-model-id");
|
|
764
812
|
```
|
|
765
813
|
|
|
766
814
|
After
|
|
767
815
|
|
|
768
816
|
```ts
|
|
769
|
-
model.embeddingModel(
|
|
817
|
+
model.embeddingModel("my-model-id");
|
|
770
818
|
```
|
|
771
819
|
|
|
772
820
|
- Updated dependencies [8d9e8ad]
|
|
@@ -1236,15 +1284,15 @@
|
|
|
1236
1284
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
1237
1285
|
|
|
1238
1286
|
```ts
|
|
1239
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
1240
|
-
import { generateText } from
|
|
1287
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
1288
|
+
import { generateText } from "ai";
|
|
1241
1289
|
|
|
1242
1290
|
await generateText({
|
|
1243
|
-
model: openai.chat(
|
|
1244
|
-
prompt:
|
|
1291
|
+
model: openai.chat("gpt-4o"),
|
|
1292
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
1245
1293
|
providerOptions: {
|
|
1246
1294
|
openai: {
|
|
1247
|
-
user:
|
|
1295
|
+
user: "user-123",
|
|
1248
1296
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
1249
1297
|
},
|
|
1250
1298
|
});
|
|
@@ -1540,7 +1588,7 @@
|
|
|
1540
1588
|
|
|
1541
1589
|
```js
|
|
1542
1590
|
await generateImage({
|
|
1543
|
-
model: luma.image(
|
|
1591
|
+
model: luma.image("photon-flash-1", {
|
|
1544
1592
|
maxImagesPerCall: 5,
|
|
1545
1593
|
pollIntervalMillis: 500,
|
|
1546
1594
|
}),
|
|
@@ -1553,7 +1601,7 @@
|
|
|
1553
1601
|
|
|
1554
1602
|
```js
|
|
1555
1603
|
await generateImage({
|
|
1556
|
-
model: luma.image(
|
|
1604
|
+
model: luma.image("photon-flash-1"),
|
|
1557
1605
|
prompt,
|
|
1558
1606
|
n: 10,
|
|
1559
1607
|
maxImagesPerCall: 5,
|
|
@@ -1615,10 +1663,10 @@
|
|
|
1615
1663
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
1616
1664
|
|
|
1617
1665
|
```js
|
|
1618
|
-
const prompt =
|
|
1666
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
1619
1667
|
|
|
1620
1668
|
const { providerMetadata } = await experimental_generateImage({
|
|
1621
|
-
model: openai.image(
|
|
1669
|
+
model: openai.image("dall-e-3"),
|
|
1622
1670
|
prompt,
|
|
1623
1671
|
});
|
|
1624
1672
|
|
|
@@ -1917,7 +1965,7 @@
|
|
|
1917
1965
|
|
|
1918
1966
|
```js
|
|
1919
1967
|
await generateImage({
|
|
1920
|
-
model: luma.image(
|
|
1968
|
+
model: luma.image("photon-flash-1", {
|
|
1921
1969
|
maxImagesPerCall: 5,
|
|
1922
1970
|
pollIntervalMillis: 500,
|
|
1923
1971
|
}),
|
|
@@ -1930,7 +1978,7 @@
|
|
|
1930
1978
|
|
|
1931
1979
|
```js
|
|
1932
1980
|
await generateImage({
|
|
1933
|
-
model: luma.image(
|
|
1981
|
+
model: luma.image("photon-flash-1"),
|
|
1934
1982
|
prompt,
|
|
1935
1983
|
n: 10,
|
|
1936
1984
|
maxImagesPerCall: 5,
|
|
@@ -1975,10 +2023,10 @@
|
|
|
1975
2023
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
1976
2024
|
|
|
1977
2025
|
```js
|
|
1978
|
-
const prompt =
|
|
2026
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
1979
2027
|
|
|
1980
2028
|
const { providerMetadata } = await experimental_generateImage({
|
|
1981
|
-
model: openai.image(
|
|
2029
|
+
model: openai.image("dall-e-3"),
|
|
1982
2030
|
prompt,
|
|
1983
2031
|
});
|
|
1984
2032
|
|
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/ai-sdk__openai
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@ai-sdk/openai](https://www.npmjs.com/package/@ai-sdk/openai) @ 3.0.
|
|
17
|
-
| Processed | 2026-03-
|
|
16
|
+
| Original | [@ai-sdk/openai](https://www.npmjs.com/package/@ai-sdk/openai) @ 3.0.48 |
|
|
17
|
+
| Processed | 2026-03-23 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
2
|
-
import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
2
|
+
import { JSONValue, ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | (string & {});
|
|
6
|
+
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | (string & {});
|
|
7
7
|
declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
8
8
|
logitBias?: Record<number, number> | undefined;
|
|
9
9
|
logprobs?: number | boolean | undefined;
|
|
@@ -206,6 +206,28 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
206
206
|
} | null | undefined;
|
|
207
207
|
service_tier?: string | null | undefined;
|
|
208
208
|
};
|
|
209
|
+
} | {
|
|
210
|
+
type: "response.failed";
|
|
211
|
+
response: {
|
|
212
|
+
error?: {
|
|
213
|
+
message: string;
|
|
214
|
+
code?: string | null | undefined;
|
|
215
|
+
} | null | undefined;
|
|
216
|
+
incomplete_details?: {
|
|
217
|
+
reason: string;
|
|
218
|
+
} | null | undefined;
|
|
219
|
+
usage?: {
|
|
220
|
+
input_tokens: number;
|
|
221
|
+
output_tokens: number;
|
|
222
|
+
input_tokens_details?: {
|
|
223
|
+
cached_tokens?: number | null | undefined;
|
|
224
|
+
} | null | undefined;
|
|
225
|
+
output_tokens_details?: {
|
|
226
|
+
reasoning_tokens?: number | null | undefined;
|
|
227
|
+
} | null | undefined;
|
|
228
|
+
} | null | undefined;
|
|
229
|
+
service_tier?: string | null | undefined;
|
|
230
|
+
};
|
|
209
231
|
} | {
|
|
210
232
|
type: "response.created";
|
|
211
233
|
response: {
|
|
@@ -315,6 +337,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
315
337
|
exit_code: number;
|
|
316
338
|
};
|
|
317
339
|
}[];
|
|
340
|
+
} | {
|
|
341
|
+
type: "tool_search_call";
|
|
342
|
+
id: string;
|
|
343
|
+
execution: "server" | "client";
|
|
344
|
+
call_id: string | null;
|
|
345
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
346
|
+
arguments: unknown;
|
|
347
|
+
} | {
|
|
348
|
+
type: "tool_search_output";
|
|
349
|
+
id: string;
|
|
350
|
+
execution: "server" | "client";
|
|
351
|
+
call_id: string | null;
|
|
352
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
353
|
+
tools: Record<string, JSONValue | undefined>[];
|
|
318
354
|
};
|
|
319
355
|
} | {
|
|
320
356
|
type: "response.output_item.done";
|
|
@@ -484,6 +520,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
484
520
|
exit_code: number;
|
|
485
521
|
};
|
|
486
522
|
}[];
|
|
523
|
+
} | {
|
|
524
|
+
type: "tool_search_call";
|
|
525
|
+
id: string;
|
|
526
|
+
execution: "server" | "client";
|
|
527
|
+
call_id: string | null;
|
|
528
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
529
|
+
arguments: unknown;
|
|
530
|
+
} | {
|
|
531
|
+
type: "tool_search_output";
|
|
532
|
+
id: string;
|
|
533
|
+
execution: "server" | "client";
|
|
534
|
+
call_id: string | null;
|
|
535
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
536
|
+
tools: Record<string, JSONValue | undefined>[];
|
|
487
537
|
};
|
|
488
538
|
} | {
|
|
489
539
|
type: "response.function_call_arguments.delta";
|
|
@@ -849,7 +899,19 @@ declare const openaiTools: {
|
|
|
849
899
|
type: "approximate";
|
|
850
900
|
country?: string;
|
|
851
901
|
city?: string;
|
|
852
|
-
region
|
|
902
|
+
region
|
|
903
|
+
/**
|
|
904
|
+
* Local shell is a tool that allows agents to run shell commands locally
|
|
905
|
+
* on a machine you or the user provides.
|
|
906
|
+
*
|
|
907
|
+
* Supported models: `gpt-5-codex`
|
|
908
|
+
*/
|
|
909
|
+
? /**
|
|
910
|
+
* Local shell is a tool that allows agents to run shell commands locally
|
|
911
|
+
* on a machine you or the user provides.
|
|
912
|
+
*
|
|
913
|
+
* Supported models: `gpt-5-codex`
|
|
914
|
+
*/: string;
|
|
853
915
|
timezone?: string;
|
|
854
916
|
};
|
|
855
917
|
}>;
|
|
@@ -918,9 +980,33 @@ declare const openaiTools: {
|
|
|
918
980
|
output?: string | null;
|
|
919
981
|
error?: _ai_sdk_provider.JSONValue;
|
|
920
982
|
}>;
|
|
983
|
+
/**
|
|
984
|
+
* Tool search allows the model to dynamically search for and load deferred
|
|
985
|
+
* tools into the model's context as needed. This helps reduce overall token
|
|
986
|
+
* usage, cost, and latency by only loading tools when the model needs them.
|
|
987
|
+
*
|
|
988
|
+
* To use tool search, mark functions or namespaces with `defer_loading: true`
|
|
989
|
+
* in the tools array. The model will use tool search to load these tools
|
|
990
|
+
* when it determines they are needed.
|
|
991
|
+
*/
|
|
992
|
+
toolSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
993
|
+
arguments?: unknown;
|
|
994
|
+
call_id?: string | null;
|
|
995
|
+
}, {
|
|
996
|
+
tools: Array<_ai_sdk_provider.JSONObject>;
|
|
997
|
+
}, {
|
|
998
|
+
execution?: "server" | "client";
|
|
999
|
+
description?: string;
|
|
1000
|
+
parameters?: Record<string, unknown>;
|
|
1001
|
+
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
1002
|
+
arguments?: unknown;
|
|
1003
|
+
call_id?: string | null;
|
|
1004
|
+
}, {
|
|
1005
|
+
tools: Array<_ai_sdk_provider.JSONObject>;
|
|
1006
|
+
}>;
|
|
921
1007
|
};
|
|
922
1008
|
|
|
923
|
-
type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-codex' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
|
|
1009
|
+
type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
|
|
924
1010
|
declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
925
1011
|
conversation?: string | null | undefined;
|
|
926
1012
|
include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
2
|
-
import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
2
|
+
import { JSONValue, ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | (string & {});
|
|
6
|
+
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | (string & {});
|
|
7
7
|
declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
8
8
|
logitBias?: Record<number, number> | undefined;
|
|
9
9
|
logprobs?: number | boolean | undefined;
|
|
@@ -206,6 +206,28 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
206
206
|
} | null | undefined;
|
|
207
207
|
service_tier?: string | null | undefined;
|
|
208
208
|
};
|
|
209
|
+
} | {
|
|
210
|
+
type: "response.failed";
|
|
211
|
+
response: {
|
|
212
|
+
error?: {
|
|
213
|
+
message: string;
|
|
214
|
+
code?: string | null | undefined;
|
|
215
|
+
} | null | undefined;
|
|
216
|
+
incomplete_details?: {
|
|
217
|
+
reason: string;
|
|
218
|
+
} | null | undefined;
|
|
219
|
+
usage?: {
|
|
220
|
+
input_tokens: number;
|
|
221
|
+
output_tokens: number;
|
|
222
|
+
input_tokens_details?: {
|
|
223
|
+
cached_tokens?: number | null | undefined;
|
|
224
|
+
} | null | undefined;
|
|
225
|
+
output_tokens_details?: {
|
|
226
|
+
reasoning_tokens?: number | null | undefined;
|
|
227
|
+
} | null | undefined;
|
|
228
|
+
} | null | undefined;
|
|
229
|
+
service_tier?: string | null | undefined;
|
|
230
|
+
};
|
|
209
231
|
} | {
|
|
210
232
|
type: "response.created";
|
|
211
233
|
response: {
|
|
@@ -315,6 +337,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
315
337
|
exit_code: number;
|
|
316
338
|
};
|
|
317
339
|
}[];
|
|
340
|
+
} | {
|
|
341
|
+
type: "tool_search_call";
|
|
342
|
+
id: string;
|
|
343
|
+
execution: "server" | "client";
|
|
344
|
+
call_id: string | null;
|
|
345
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
346
|
+
arguments: unknown;
|
|
347
|
+
} | {
|
|
348
|
+
type: "tool_search_output";
|
|
349
|
+
id: string;
|
|
350
|
+
execution: "server" | "client";
|
|
351
|
+
call_id: string | null;
|
|
352
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
353
|
+
tools: Record<string, JSONValue | undefined>[];
|
|
318
354
|
};
|
|
319
355
|
} | {
|
|
320
356
|
type: "response.output_item.done";
|
|
@@ -484,6 +520,20 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
484
520
|
exit_code: number;
|
|
485
521
|
};
|
|
486
522
|
}[];
|
|
523
|
+
} | {
|
|
524
|
+
type: "tool_search_call";
|
|
525
|
+
id: string;
|
|
526
|
+
execution: "server" | "client";
|
|
527
|
+
call_id: string | null;
|
|
528
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
529
|
+
arguments: unknown;
|
|
530
|
+
} | {
|
|
531
|
+
type: "tool_search_output";
|
|
532
|
+
id: string;
|
|
533
|
+
execution: "server" | "client";
|
|
534
|
+
call_id: string | null;
|
|
535
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
536
|
+
tools: Record<string, JSONValue | undefined>[];
|
|
487
537
|
};
|
|
488
538
|
} | {
|
|
489
539
|
type: "response.function_call_arguments.delta";
|
|
@@ -849,7 +899,19 @@ declare const openaiTools: {
|
|
|
849
899
|
type: "approximate";
|
|
850
900
|
country?: string;
|
|
851
901
|
city?: string;
|
|
852
|
-
region
|
|
902
|
+
region
|
|
903
|
+
/**
|
|
904
|
+
* Local shell is a tool that allows agents to run shell commands locally
|
|
905
|
+
* on a machine you or the user provides.
|
|
906
|
+
*
|
|
907
|
+
* Supported models: `gpt-5-codex`
|
|
908
|
+
*/
|
|
909
|
+
? /**
|
|
910
|
+
* Local shell is a tool that allows agents to run shell commands locally
|
|
911
|
+
* on a machine you or the user provides.
|
|
912
|
+
*
|
|
913
|
+
* Supported models: `gpt-5-codex`
|
|
914
|
+
*/: string;
|
|
853
915
|
timezone?: string;
|
|
854
916
|
};
|
|
855
917
|
}>;
|
|
@@ -918,9 +980,33 @@ declare const openaiTools: {
|
|
|
918
980
|
output?: string | null;
|
|
919
981
|
error?: _ai_sdk_provider.JSONValue;
|
|
920
982
|
}>;
|
|
983
|
+
/**
|
|
984
|
+
* Tool search allows the model to dynamically search for and load deferred
|
|
985
|
+
* tools into the model's context as needed. This helps reduce overall token
|
|
986
|
+
* usage, cost, and latency by only loading tools when the model needs them.
|
|
987
|
+
*
|
|
988
|
+
* To use tool search, mark functions or namespaces with `defer_loading: true`
|
|
989
|
+
* in the tools array. The model will use tool search to load these tools
|
|
990
|
+
* when it determines they are needed.
|
|
991
|
+
*/
|
|
992
|
+
toolSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
993
|
+
arguments?: unknown;
|
|
994
|
+
call_id?: string | null;
|
|
995
|
+
}, {
|
|
996
|
+
tools: Array<_ai_sdk_provider.JSONObject>;
|
|
997
|
+
}, {
|
|
998
|
+
execution?: "server" | "client";
|
|
999
|
+
description?: string;
|
|
1000
|
+
parameters?: Record<string, unknown>;
|
|
1001
|
+
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
1002
|
+
arguments?: unknown;
|
|
1003
|
+
call_id?: string | null;
|
|
1004
|
+
}, {
|
|
1005
|
+
tools: Array<_ai_sdk_provider.JSONObject>;
|
|
1006
|
+
}>;
|
|
921
1007
|
};
|
|
922
1008
|
|
|
923
|
-
type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-codex' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
|
|
1009
|
+
type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
|
|
924
1010
|
declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
925
1011
|
conversation?: string | null | undefined;
|
|
926
1012
|
include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|