@ai-sdk/openai 4.0.99 → 4.0.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.
- package/CHANGELOG.md +16 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +3 -3
- package/dist/internal/index.js.map +1 -1
- package/package.json +3 -3
- package/src/chat/openai-chat-language-model.ts +2 -1
- package/src/completion/openai-completion-language-model.ts +2 -1
- package/src/responses/openai-responses-language-model.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.100
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 43ad966: Report `interrupted` when a stream ends cleanly without its provider completion signal, preserving partial output without emitting an error solely for the interruption.
|
|
8
|
+
|
|
9
|
+
This applies to OpenAI (Chat, Responses, and Completions), Anthropic, Google (Generate Content and Interactions), Alibaba, Amazon Bedrock Converse, Cohere, DeepSeek, Groq, Hugging Face Responses, Mistral Chat, Moonshot AI, Open Responses, Perplexity, and xAI Responses. It also covers cutoffs in later Anthropic messages and Google automatic continuations.
|
|
10
|
+
|
|
11
|
+
**Compatibility notice:** These streams previously fell back to `other` or omitted the finish part. Applications must now handle `interrupted` in finish-reason switches, mappings, and custom validation. Check `finishReason === 'interrupted'` to detect incomplete responses; interruption alone does not trigger error handling.
|
|
12
|
+
|
|
13
|
+
Explicit unknown completion reasons still map to `other`. Actual provider, parsing, and transport errors retain their error paths; affected error paths that previously left the finish reason as `other` now report `error`. OpenAI-compatible remains unchanged.
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [10026d1]
|
|
16
|
+
- @ai-sdk/provider@4.0.32
|
|
17
|
+
- @ai-sdk/provider-utils@5.0.66
|
|
18
|
+
|
|
3
19
|
## 4.0.99
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1442,7 +1442,7 @@ var OpenAIChatLanguageModel = class OpenAIChatLanguageModel {
|
|
|
1442
1442
|
});
|
|
1443
1443
|
let toolCallTracker;
|
|
1444
1444
|
let finishReason = {
|
|
1445
|
-
unified: "
|
|
1445
|
+
unified: "interrupted",
|
|
1446
1446
|
raw: void 0
|
|
1447
1447
|
};
|
|
1448
1448
|
let usage = void 0;
|
|
@@ -1861,7 +1861,7 @@ var OpenAICompletionLanguageModel = class OpenAICompletionLanguageModel {
|
|
|
1861
1861
|
responseHeaders
|
|
1862
1862
|
});
|
|
1863
1863
|
let finishReason = {
|
|
1864
|
-
unified: "
|
|
1864
|
+
unified: "interrupted",
|
|
1865
1865
|
raw: void 0
|
|
1866
1866
|
};
|
|
1867
1867
|
const providerMetadata = { openai: {} };
|
|
@@ -7022,7 +7022,7 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7022
7022
|
const functionTools = options.tools?.filter((tool) => tool.type === "function") ?? [];
|
|
7023
7023
|
const approvalRequestIdToDummyToolCallIdFromStream = /* @__PURE__ */ new Map();
|
|
7024
7024
|
let finishReason = {
|
|
7025
|
-
unified: "
|
|
7025
|
+
unified: "interrupted",
|
|
7026
7026
|
raw: void 0
|
|
7027
7027
|
};
|
|
7028
7028
|
let usage = void 0;
|
|
@@ -10248,7 +10248,7 @@ var OpenAISkills = class {
|
|
|
10248
10248
|
};
|
|
10249
10249
|
//#endregion
|
|
10250
10250
|
//#region src/version.ts
|
|
10251
|
-
const VERSION = "4.0.
|
|
10251
|
+
const VERSION = "4.0.100";
|
|
10252
10252
|
//#endregion
|
|
10253
10253
|
//#region src/openai-provider.ts
|
|
10254
10254
|
/**
|