@ai-sdk/openai 2.1.0-beta.10 → 2.1.0-beta.11

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.
@@ -2519,6 +2519,7 @@ var imageGenerationArgsSchema = z18.object({
2519
2519
  moderation: z18.enum(["auto"]).optional(),
2520
2520
  outputCompression: z18.number().int().min(0).max(100).optional(),
2521
2521
  outputFormat: z18.enum(["png", "jpeg", "webp"]).optional(),
2522
+ partialImages: z18.number().int().min(0).max(3).optional(),
2522
2523
  quality: z18.enum(["auto", "low", "medium", "high"]).optional(),
2523
2524
  size: z18.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2524
2525
  }).strict();
@@ -2618,11 +2619,12 @@ function prepareResponsesTools({
2618
2619
  image_url: args.inputImageMask.imageUrl
2619
2620
  } : void 0,
2620
2621
  model: args.model,
2621
- size: args.size,
2622
- quality: args.quality,
2623
2622
  moderation: args.moderation,
2623
+ partial_images: args.partialImages,
2624
+ quality: args.quality,
2625
+ output_compression: args.outputCompression,
2624
2626
  output_format: args.outputFormat,
2625
- output_compression: args.outputCompression
2627
+ size: args.size
2626
2628
  });
2627
2629
  break;
2628
2630
  }
@@ -3581,6 +3583,17 @@ var OpenAIResponsesLanguageModel = class {
3581
3583
  delta: value.delta
3582
3584
  });
3583
3585
  }
3586
+ } else if (isResponseImageGenerationCallPartialImageChunk(value)) {
3587
+ controller.enqueue({
3588
+ type: "tool-result",
3589
+ toolCallId: value.item_id,
3590
+ toolName: "image_generation",
3591
+ result: {
3592
+ result: value.partial_image_b64
3593
+ },
3594
+ providerExecuted: true,
3595
+ preliminary: true
3596
+ });
3584
3597
  } else if (isResponseCodeInterpreterCallCodeDeltaChunk(value)) {
3585
3598
  const toolCall = ongoingToolCalls[value.output_index];
3586
3599
  if (toolCall != null) {
@@ -3853,6 +3866,12 @@ var responseFunctionCallArgumentsDeltaSchema = z19.object({
3853
3866
  output_index: z19.number(),
3854
3867
  delta: z19.string()
3855
3868
  });
3869
+ var responseImageGenerationCallPartialImageSchema = z19.object({
3870
+ type: z19.literal("response.image_generation_call.partial_image"),
3871
+ item_id: z19.string(),
3872
+ output_index: z19.number(),
3873
+ partial_image_b64: z19.string()
3874
+ });
3856
3875
  var responseCodeInterpreterCallCodeDeltaSchema = z19.object({
3857
3876
  type: z19.literal("response.code_interpreter_call_code.delta"),
3858
3877
  item_id: z19.string(),
@@ -3902,6 +3921,7 @@ var openaiResponsesChunkSchema = z19.union([
3902
3921
  responseOutputItemAddedSchema,
3903
3922
  responseOutputItemDoneSchema,
3904
3923
  responseFunctionCallArgumentsDeltaSchema,
3924
+ responseImageGenerationCallPartialImageSchema,
3905
3925
  responseCodeInterpreterCallCodeDeltaSchema,
3906
3926
  responseCodeInterpreterCallCodeDoneSchema,
3907
3927
  responseAnnotationAddedSchema,
@@ -3929,6 +3949,9 @@ function isResponseCreatedChunk(chunk) {
3929
3949
  function isResponseFunctionCallArgumentsDeltaChunk(chunk) {
3930
3950
  return chunk.type === "response.function_call_arguments.delta";
3931
3951
  }
3952
+ function isResponseImageGenerationCallPartialImageChunk(chunk) {
3953
+ return chunk.type === "response.image_generation_call.partial_image";
3954
+ }
3932
3955
  function isResponseCodeInterpreterCallCodeDeltaChunk(chunk) {
3933
3956
  return chunk.type === "response.code_interpreter_call_code.delta";
3934
3957
  }