@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/internal/index.mjs
CHANGED
|
@@ -398,7 +398,7 @@ function prepareChatTools({
|
|
|
398
398
|
// src/chat/openai-chat-language-model.ts
|
|
399
399
|
var OpenAIChatLanguageModel = class {
|
|
400
400
|
constructor(modelId, config) {
|
|
401
|
-
this.specificationVersion = "
|
|
401
|
+
this.specificationVersion = "v3";
|
|
402
402
|
this.supportedUrls = {
|
|
403
403
|
"image/*": [/^https?:\/\/.*$/]
|
|
404
404
|
};
|
|
@@ -1216,7 +1216,7 @@ var openaiCompletionProviderOptions = z4.object({
|
|
|
1216
1216
|
// src/completion/openai-completion-language-model.ts
|
|
1217
1217
|
var OpenAICompletionLanguageModel = class {
|
|
1218
1218
|
constructor(modelId, config) {
|
|
1219
|
-
this.specificationVersion = "
|
|
1219
|
+
this.specificationVersion = "v3";
|
|
1220
1220
|
this.supportedUrls = {
|
|
1221
1221
|
// No URLs are supported for completion models.
|
|
1222
1222
|
};
|
|
@@ -2176,26 +2176,40 @@ async function convertToOpenAIResponsesInput({
|
|
|
2176
2176
|
});
|
|
2177
2177
|
const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
|
|
2178
2178
|
if (reasoningId != null) {
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
if (existingReasoningMessage === void 0) {
|
|
2190
|
-
reasoningMessages[reasoningId] = {
|
|
2191
|
-
type: "reasoning",
|
|
2192
|
-
id: reasoningId,
|
|
2193
|
-
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2194
|
-
summary: summaryParts
|
|
2195
|
-
};
|
|
2196
|
-
input.push(reasoningMessages[reasoningId]);
|
|
2179
|
+
const reasoningMessage = reasoningMessages[reasoningId];
|
|
2180
|
+
if (store) {
|
|
2181
|
+
if (reasoningMessage === void 0) {
|
|
2182
|
+
input.push({ type: "item_reference", id: reasoningId });
|
|
2183
|
+
reasoningMessages[reasoningId] = {
|
|
2184
|
+
type: "reasoning",
|
|
2185
|
+
id: reasoningId,
|
|
2186
|
+
summary: []
|
|
2187
|
+
};
|
|
2188
|
+
}
|
|
2197
2189
|
} else {
|
|
2198
|
-
|
|
2190
|
+
const summaryParts = [];
|
|
2191
|
+
if (part.text.length > 0) {
|
|
2192
|
+
summaryParts.push({
|
|
2193
|
+
type: "summary_text",
|
|
2194
|
+
text: part.text
|
|
2195
|
+
});
|
|
2196
|
+
} else if (reasoningMessage !== void 0) {
|
|
2197
|
+
warnings.push({
|
|
2198
|
+
type: "other",
|
|
2199
|
+
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
|
|
2200
|
+
});
|
|
2201
|
+
}
|
|
2202
|
+
if (reasoningMessage === void 0) {
|
|
2203
|
+
reasoningMessages[reasoningId] = {
|
|
2204
|
+
type: "reasoning",
|
|
2205
|
+
id: reasoningId,
|
|
2206
|
+
encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
|
|
2207
|
+
summary: summaryParts
|
|
2208
|
+
};
|
|
2209
|
+
input.push(reasoningMessages[reasoningId]);
|
|
2210
|
+
} else {
|
|
2211
|
+
reasoningMessage.summary.push(...summaryParts);
|
|
2212
|
+
}
|
|
2199
2213
|
}
|
|
2200
2214
|
} else {
|
|
2201
2215
|
warnings.push({
|
|
@@ -2297,6 +2311,9 @@ var codeInterpreterToolFactory = createProviderDefinedToolFactoryWithOutputSchem
|
|
|
2297
2311
|
inputSchema: codeInterpreterInputSchema,
|
|
2298
2312
|
outputSchema: codeInterpreterOutputSchema
|
|
2299
2313
|
});
|
|
2314
|
+
var codeInterpreter = (args = {}) => {
|
|
2315
|
+
return codeInterpreterToolFactory(args);
|
|
2316
|
+
};
|
|
2300
2317
|
|
|
2301
2318
|
// src/tool/file-search.ts
|
|
2302
2319
|
import { createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2 } from "@ai-sdk/provider-utils";
|
|
@@ -2648,7 +2665,7 @@ var LOGPROBS_SCHEMA = z18.array(
|
|
|
2648
2665
|
);
|
|
2649
2666
|
var OpenAIResponsesLanguageModel = class {
|
|
2650
2667
|
constructor(modelId, config) {
|
|
2651
|
-
this.specificationVersion = "
|
|
2668
|
+
this.specificationVersion = "v3";
|
|
2652
2669
|
this.supportedUrls = {
|
|
2653
2670
|
"image/*": [/^https?:\/\/.*$/],
|
|
2654
2671
|
"application/pdf": [/^https?:\/\/.*$/]
|
|
@@ -3833,6 +3850,14 @@ export {
|
|
|
3833
3850
|
OpenAIResponsesLanguageModel,
|
|
3834
3851
|
OpenAISpeechModel,
|
|
3835
3852
|
OpenAITranscriptionModel,
|
|
3853
|
+
codeInterpreter,
|
|
3854
|
+
codeInterpreterArgsSchema,
|
|
3855
|
+
codeInterpreterInputSchema,
|
|
3856
|
+
codeInterpreterOutputSchema,
|
|
3857
|
+
codeInterpreterToolFactory,
|
|
3858
|
+
fileSearch,
|
|
3859
|
+
fileSearchArgsSchema,
|
|
3860
|
+
fileSearchOutputSchema,
|
|
3836
3861
|
hasDefaultResponseFormat,
|
|
3837
3862
|
modelMaxImagesPerCall,
|
|
3838
3863
|
openAITranscriptionProviderOptions,
|