@ai-sdk/openai 2.1.0-beta.5 → 2.1.0-beta.7
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 +17 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +37 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -23
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +225 -14
- package/dist/internal/index.d.ts +225 -14
- package/dist/internal/index.js +55 -22
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +47 -22
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -405,7 +405,7 @@ function prepareChatTools({
|
|
|
405
405
|
// src/chat/openai-chat-language-model.ts
|
|
406
406
|
var OpenAIChatLanguageModel = class {
|
|
407
407
|
constructor(modelId, config) {
|
|
408
|
-
this.specificationVersion = "
|
|
408
|
+
this.specificationVersion = "v3";
|
|
409
409
|
this.supportedUrls = {
|
|
410
410
|
"image/*": [/^https?:\/\/.*$/]
|
|
411
411
|
};
|
|
@@ -1223,7 +1223,7 @@ var openaiCompletionProviderOptions = z4.object({
|
|
|
1223
1223
|
// src/completion/openai-completion-language-model.ts
|
|
1224
1224
|
var OpenAICompletionLanguageModel = class {
|
|
1225
1225
|
constructor(modelId, config) {
|
|
1226
|
-
this.specificationVersion = "
|
|
1226
|
+
this.specificationVersion = "v3";
|
|
1227
1227
|
this.supportedUrls = {
|
|
1228
1228
|
// No URLs are supported for completion models.
|
|
1229
1229
|
};
|
|
@@ -2109,26 +2109,40 @@ async function convertToOpenAIResponsesInput({
|
|
|
2109
2109
|
});
|
|
2110
2110
|
const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
|
|
2111
2111
|
if (reasoningId != null) {
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
if (existingReasoningMessage === void 0) {
|
|
2123
|
-
reasoningMessages[reasoningId] = {
|
|
2124
|
-
type: "reasoning",
|
|
2125
|
-
id: reasoningId,
|
|
2126
|
-
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2127
|
-
summary: summaryParts
|
|
2128
|
-
};
|
|
2129
|
-
input.push(reasoningMessages[reasoningId]);
|
|
2112
|
+
const reasoningMessage = reasoningMessages[reasoningId];
|
|
2113
|
+
if (store) {
|
|
2114
|
+
if (reasoningMessage === void 0) {
|
|
2115
|
+
input.push({ type: "item_reference", id: reasoningId });
|
|
2116
|
+
reasoningMessages[reasoningId] = {
|
|
2117
|
+
type: "reasoning",
|
|
2118
|
+
id: reasoningId,
|
|
2119
|
+
summary: []
|
|
2120
|
+
};
|
|
2121
|
+
}
|
|
2130
2122
|
} else {
|
|
2131
|
-
|
|
2123
|
+
const summaryParts = [];
|
|
2124
|
+
if (part.text.length > 0) {
|
|
2125
|
+
summaryParts.push({
|
|
2126
|
+
type: "summary_text",
|
|
2127
|
+
text: part.text
|
|
2128
|
+
});
|
|
2129
|
+
} else if (reasoningMessage !== void 0) {
|
|
2130
|
+
warnings.push({
|
|
2131
|
+
type: "other",
|
|
2132
|
+
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
if (reasoningMessage === void 0) {
|
|
2136
|
+
reasoningMessages[reasoningId] = {
|
|
2137
|
+
type: "reasoning",
|
|
2138
|
+
id: reasoningId,
|
|
2139
|
+
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2140
|
+
summary: summaryParts
|
|
2141
|
+
};
|
|
2142
|
+
input.push(reasoningMessages[reasoningId]);
|
|
2143
|
+
} else {
|
|
2144
|
+
reasoningMessage.summary.push(...summaryParts);
|
|
2145
|
+
}
|
|
2132
2146
|
}
|
|
2133
2147
|
} else {
|
|
2134
2148
|
warnings.push({
|
|
@@ -2383,7 +2397,7 @@ var LOGPROBS_SCHEMA = z15.array(
|
|
|
2383
2397
|
);
|
|
2384
2398
|
var OpenAIResponsesLanguageModel = class {
|
|
2385
2399
|
constructor(modelId, config) {
|
|
2386
|
-
this.specificationVersion = "
|
|
2400
|
+
this.specificationVersion = "v3";
|
|
2387
2401
|
this.supportedUrls = {
|
|
2388
2402
|
"image/*": [/^https?:\/\/.*$/],
|
|
2389
2403
|
"application/pdf": [/^https?:\/\/.*$/]
|
|
@@ -3905,7 +3919,7 @@ var openaiTranscriptionResponseSchema = z18.object({
|
|
|
3905
3919
|
});
|
|
3906
3920
|
|
|
3907
3921
|
// src/version.ts
|
|
3908
|
-
var VERSION = true ? "2.1.0-beta.
|
|
3922
|
+
var VERSION = true ? "2.1.0-beta.7" : "0.0.0-test";
|
|
3909
3923
|
|
|
3910
3924
|
// src/openai-provider.ts
|
|
3911
3925
|
function createOpenAI(options = {}) {
|