@ai-sdk/openai 3.0.57 → 3.0.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "3.0.57",
3
+ "version": "3.0.59",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -179,7 +179,7 @@ export function convertToOpenAIChatMessages({
179
179
 
180
180
  messages.push({
181
181
  role: 'assistant',
182
- content: text || null,
182
+ content: toolCalls.length > 0 ? text || null : text,
183
183
  tool_calls: toolCalls.length > 0 ? toolCalls : undefined,
184
184
  });
185
185
 
@@ -555,6 +555,7 @@ export const openaiResponsesChunkSchema = lazySchema(() =>
555
555
  call_id: z.string(),
556
556
  name: z.string(),
557
557
  arguments: z.string(),
558
+ namespace: z.string().nullish(),
558
559
  }),
559
560
  z.object({
560
561
  type: z.literal('web_search_call'),
@@ -699,6 +700,7 @@ export const openaiResponsesChunkSchema = lazySchema(() =>
699
700
  name: z.string(),
700
701
  arguments: z.string(),
701
702
  status: z.literal('completed'),
703
+ namespace: z.string().nullish(),
702
704
  }),
703
705
  z.object({
704
706
  type: z.literal('custom_tool_call'),
@@ -1209,6 +1211,7 @@ export const openaiResponsesResponseSchema = lazySchema(() =>
1209
1211
  name: z.string(),
1210
1212
  arguments: z.string(),
1211
1213
  id: z.string(),
1214
+ namespace: z.string().nullish(),
1212
1215
  }),
1213
1216
  z.object({
1214
1217
  type: z.literal('custom_tool_call'),
@@ -775,6 +775,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
775
775
  providerMetadata: {
776
776
  [providerOptionsName]: {
777
777
  itemId: part.id,
778
+ ...(part.namespace != null && { namespace: part.namespace }),
778
779
  },
779
780
  },
780
781
  });
@@ -1383,6 +1384,13 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
1383
1384
  controller.enqueue({
1384
1385
  type: 'tool-input-end',
1385
1386
  id: value.item.call_id,
1387
+ ...(value.item.namespace != null && {
1388
+ providerMetadata: {
1389
+ [providerOptionsName]: {
1390
+ namespace: value.item.namespace,
1391
+ },
1392
+ },
1393
+ }),
1386
1394
  });
1387
1395
 
1388
1396
  controller.enqueue({
@@ -1393,6 +1401,9 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
1393
1401
  providerMetadata: {
1394
1402
  [providerOptionsName]: {
1395
1403
  itemId: value.item.id,
1404
+ ...(value.item.namespace != null && {
1405
+ namespace: value.item.namespace,
1406
+ }),
1396
1407
  },
1397
1408
  },
1398
1409
  });