@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.
@@ -27,6 +27,14 @@ __export(internal_exports, {
27
27
  OpenAIResponsesLanguageModel: () => OpenAIResponsesLanguageModel,
28
28
  OpenAISpeechModel: () => OpenAISpeechModel,
29
29
  OpenAITranscriptionModel: () => OpenAITranscriptionModel,
30
+ codeInterpreter: () => codeInterpreter,
31
+ codeInterpreterArgsSchema: () => codeInterpreterArgsSchema,
32
+ codeInterpreterInputSchema: () => codeInterpreterInputSchema,
33
+ codeInterpreterOutputSchema: () => codeInterpreterOutputSchema,
34
+ codeInterpreterToolFactory: () => codeInterpreterToolFactory,
35
+ fileSearch: () => fileSearch,
36
+ fileSearchArgsSchema: () => fileSearchArgsSchema,
37
+ fileSearchOutputSchema: () => fileSearchOutputSchema,
30
38
  hasDefaultResponseFormat: () => hasDefaultResponseFormat,
31
39
  modelMaxImagesPerCall: () => modelMaxImagesPerCall,
32
40
  openAITranscriptionProviderOptions: () => openAITranscriptionProviderOptions,
@@ -422,7 +430,7 @@ function prepareChatTools({
422
430
  // src/chat/openai-chat-language-model.ts
423
431
  var OpenAIChatLanguageModel = class {
424
432
  constructor(modelId, config) {
425
- this.specificationVersion = "v2";
433
+ this.specificationVersion = "v3";
426
434
  this.supportedUrls = {
427
435
  "image/*": [/^https?:\/\/.*$/]
428
436
  };
@@ -1231,7 +1239,7 @@ var openaiCompletionProviderOptions = import_v44.z.object({
1231
1239
  // src/completion/openai-completion-language-model.ts
1232
1240
  var OpenAICompletionLanguageModel = class {
1233
1241
  constructor(modelId, config) {
1234
- this.specificationVersion = "v2";
1242
+ this.specificationVersion = "v3";
1235
1243
  this.supportedUrls = {
1236
1244
  // No URLs are supported for completion models.
1237
1245
  };
@@ -2157,26 +2165,40 @@ async function convertToOpenAIResponsesInput({
2157
2165
  });
2158
2166
  const reasoningId = providerOptions == null ? void 0 : providerOptions.itemId;
2159
2167
  if (reasoningId != null) {
2160
- const existingReasoningMessage = reasoningMessages[reasoningId];
2161
- const summaryParts = [];
2162
- if (part.text.length > 0) {
2163
- summaryParts.push({ type: "summary_text", text: part.text });
2164
- } else if (existingReasoningMessage !== void 0) {
2165
- warnings.push({
2166
- type: "other",
2167
- message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
2168
- });
2169
- }
2170
- if (existingReasoningMessage === void 0) {
2171
- reasoningMessages[reasoningId] = {
2172
- type: "reasoning",
2173
- id: reasoningId,
2174
- encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
2175
- summary: summaryParts
2176
- };
2177
- input.push(reasoningMessages[reasoningId]);
2168
+ const reasoningMessage = reasoningMessages[reasoningId];
2169
+ if (store) {
2170
+ if (reasoningMessage === void 0) {
2171
+ input.push({ type: "item_reference", id: reasoningId });
2172
+ reasoningMessages[reasoningId] = {
2173
+ type: "reasoning",
2174
+ id: reasoningId,
2175
+ summary: []
2176
+ };
2177
+ }
2178
2178
  } else {
2179
- existingReasoningMessage.summary.push(...summaryParts);
2179
+ const summaryParts = [];
2180
+ if (part.text.length > 0) {
2181
+ summaryParts.push({
2182
+ type: "summary_text",
2183
+ text: part.text
2184
+ });
2185
+ } else if (reasoningMessage !== void 0) {
2186
+ warnings.push({
2187
+ type: "other",
2188
+ message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`
2189
+ });
2190
+ }
2191
+ if (reasoningMessage === void 0) {
2192
+ reasoningMessages[reasoningId] = {
2193
+ type: "reasoning",
2194
+ id: reasoningId,
2195
+ encrypted_content: providerOptions == null ? void 0 : providerOptions.reasoningEncryptedContent,
2196
+ summary: summaryParts
2197
+ };
2198
+ input.push(reasoningMessages[reasoningId]);
2199
+ } else {
2200
+ reasoningMessage.summary.push(...summaryParts);
2201
+ }
2180
2202
  }
2181
2203
  } else {
2182
2204
  warnings.push({
@@ -2276,6 +2298,9 @@ var codeInterpreterToolFactory = (0, import_provider_utils10.createProviderDefin
2276
2298
  inputSchema: codeInterpreterInputSchema,
2277
2299
  outputSchema: codeInterpreterOutputSchema
2278
2300
  });
2301
+ var codeInterpreter = (args = {}) => {
2302
+ return codeInterpreterToolFactory(args);
2303
+ };
2279
2304
 
2280
2305
  // src/tool/file-search.ts
2281
2306
  var import_provider_utils11 = require("@ai-sdk/provider-utils");
@@ -2627,7 +2652,7 @@ var LOGPROBS_SCHEMA = import_v418.z.array(
2627
2652
  );
2628
2653
  var OpenAIResponsesLanguageModel = class {
2629
2654
  constructor(modelId, config) {
2630
- this.specificationVersion = "v2";
2655
+ this.specificationVersion = "v3";
2631
2656
  this.supportedUrls = {
2632
2657
  "image/*": [/^https?:\/\/.*$/],
2633
2658
  "application/pdf": [/^https?:\/\/.*$/]
@@ -3813,6 +3838,14 @@ var openaiResponsesProviderOptionsSchema = import_v418.z.object({
3813
3838
  OpenAIResponsesLanguageModel,
3814
3839
  OpenAISpeechModel,
3815
3840
  OpenAITranscriptionModel,
3841
+ codeInterpreter,
3842
+ codeInterpreterArgsSchema,
3843
+ codeInterpreterInputSchema,
3844
+ codeInterpreterOutputSchema,
3845
+ codeInterpreterToolFactory,
3846
+ fileSearch,
3847
+ fileSearchArgsSchema,
3848
+ fileSearchOutputSchema,
3816
3849
  hasDefaultResponseFormat,
3817
3850
  modelMaxImagesPerCall,
3818
3851
  openAITranscriptionProviderOptions,