@ai-sdk/openai 4.0.46 → 4.0.49
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 +31 -0
- package/dist/index.d.ts +29 -12
- package/dist/index.js +384 -276
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +45 -26
- package/dist/internal/index.js +271 -167
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +31 -11
- package/package.json +6 -6
- package/src/chat/convert-openai-chat-usage.ts +1 -1
- package/src/chat/convert-to-openai-chat-messages.ts +5 -1
- package/src/chat/openai-chat-language-model.ts +9 -2
- package/src/completion/openai-completion-language-model.ts +9 -2
- package/src/embedding/openai-embedding-model.ts +2 -0
- package/src/openai-responses-batch.ts +103 -103
- package/src/openai-stream-error.ts +68 -15
- package/src/responses/openai-responses-api.ts +114 -40
- package/src/responses/openai-responses-language-model.ts +28 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.49
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2523403: Normalize non-object replayed Chat Completions tool arguments to empty objects.
|
|
8
|
+
- Updated dependencies [3e125ba]
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.32
|
|
10
|
+
|
|
11
|
+
## 4.0.48
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- a9782e1: fix: align batch result parsing, request counts, and lifecycle behavior across providers
|
|
16
|
+
- eee6200: Signal schema-invalid known Responses stream events and preserve the error finish reason.
|
|
17
|
+
- 35841f5: feat: normalize mid-stream provider error events across supported providers into public StreamProviderError instances and preserve provider-owned type, code, status, retry, and raw payload metadata
|
|
18
|
+
- d2f3353: Split OpenAI and Azure OpenAI embedding requests by a conservative UTF-8 byte budget derived from their aggregate token limit, in addition to input count limits.
|
|
19
|
+
- Updated dependencies [a9782e1]
|
|
20
|
+
- Updated dependencies [35841f5]
|
|
21
|
+
- Updated dependencies [d2f3353]
|
|
22
|
+
- @ai-sdk/provider-utils@5.0.31
|
|
23
|
+
|
|
24
|
+
## 4.0.47
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 591d25b: feat: add batch completion webhooks. `experimental_startTextBatch` accepts a `webhookUrl`, and the gateway provider registers it through the batch `callbackUrl` contract and exports typed async-job metadata. Direct Anthropic and OpenAI batch providers return an unsupported warning when the option is provided.
|
|
29
|
+
- 2214258: Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.
|
|
30
|
+
- Updated dependencies [591d25b]
|
|
31
|
+
- @ai-sdk/provider@4.0.8
|
|
32
|
+
- @ai-sdk/provider-utils@5.0.30
|
|
33
|
+
|
|
3
34
|
## 4.0.46
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -415,6 +415,18 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
415
415
|
code?: string | null | undefined;
|
|
416
416
|
message?: string | null | undefined;
|
|
417
417
|
}[] | null | undefined;
|
|
418
|
+
} | {
|
|
419
|
+
type: "local_shell_call";
|
|
420
|
+
id: string;
|
|
421
|
+
call_id: string;
|
|
422
|
+
action: {
|
|
423
|
+
type: "exec";
|
|
424
|
+
command: string[];
|
|
425
|
+
timeout_ms?: number | undefined;
|
|
426
|
+
user?: string | undefined;
|
|
427
|
+
working_directory?: string | undefined;
|
|
428
|
+
env?: Record<string, string> | undefined;
|
|
429
|
+
};
|
|
418
430
|
} | {
|
|
419
431
|
type: "message";
|
|
420
432
|
id: string;
|
|
@@ -642,6 +654,18 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
642
654
|
code?: string | null | undefined;
|
|
643
655
|
message?: string | null | undefined;
|
|
644
656
|
}[] | null | undefined;
|
|
657
|
+
} | {
|
|
658
|
+
type: "local_shell_call";
|
|
659
|
+
id: string;
|
|
660
|
+
call_id: string;
|
|
661
|
+
action: {
|
|
662
|
+
type: "exec";
|
|
663
|
+
command: string[];
|
|
664
|
+
timeout_ms?: number | undefined;
|
|
665
|
+
user?: string | undefined;
|
|
666
|
+
working_directory?: string | undefined;
|
|
667
|
+
env?: Record<string, string> | undefined;
|
|
668
|
+
};
|
|
645
669
|
} | {
|
|
646
670
|
type: "program";
|
|
647
671
|
id: string;
|
|
@@ -733,18 +757,6 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
733
757
|
score: number;
|
|
734
758
|
text: string;
|
|
735
759
|
}[] | null | undefined;
|
|
736
|
-
} | {
|
|
737
|
-
type: "local_shell_call";
|
|
738
|
-
id: string;
|
|
739
|
-
call_id: string;
|
|
740
|
-
action: {
|
|
741
|
-
type: "exec";
|
|
742
|
-
command: string[];
|
|
743
|
-
timeout_ms?: number | undefined;
|
|
744
|
-
user?: string | undefined;
|
|
745
|
-
working_directory?: string | undefined;
|
|
746
|
-
env?: Record<string, string> | undefined;
|
|
747
|
-
};
|
|
748
760
|
} | {
|
|
749
761
|
type: "mcp_call";
|
|
750
762
|
id: string;
|
|
@@ -847,6 +859,11 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
847
859
|
item_id: string;
|
|
848
860
|
output_index: number;
|
|
849
861
|
delta: string;
|
|
862
|
+
} | {
|
|
863
|
+
type: "response.function_call_arguments.done";
|
|
864
|
+
item_id: string;
|
|
865
|
+
output_index: number;
|
|
866
|
+
arguments: string;
|
|
850
867
|
} | {
|
|
851
868
|
type: "response.custom_tool_call_input.delta";
|
|
852
869
|
item_id: string;
|