@ai-sdk/openai 3.0.0-beta.67 → 3.0.0-beta.69

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.
@@ -105,7 +105,7 @@ declare const openaiEmbeddingProviderOptions: _ai_sdk_provider_utils.LazySchema<
105
105
  }>;
106
106
  type OpenAIEmbeddingProviderOptions = InferSchema<typeof openaiEmbeddingProviderOptions>;
107
107
 
108
- declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
108
+ declare class OpenAIEmbeddingModel implements EmbeddingModelV3 {
109
109
  readonly specificationVersion = "v3";
110
110
  readonly modelId: OpenAIEmbeddingModelId;
111
111
  readonly maxEmbeddingsPerCall = 2048;
@@ -113,7 +113,7 @@ declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
113
113
  private readonly config;
114
114
  get provider(): string;
115
115
  constructor(modelId: OpenAIEmbeddingModelId, config: OpenAIConfig);
116
- doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV3<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV3<string>['doEmbed']>>>;
116
+ doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV3['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV3['doEmbed']>>>;
117
117
  }
118
118
 
119
119
  type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | (string & {});
@@ -105,7 +105,7 @@ declare const openaiEmbeddingProviderOptions: _ai_sdk_provider_utils.LazySchema<
105
105
  }>;
106
106
  type OpenAIEmbeddingProviderOptions = InferSchema<typeof openaiEmbeddingProviderOptions>;
107
107
 
108
- declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
108
+ declare class OpenAIEmbeddingModel implements EmbeddingModelV3 {
109
109
  readonly specificationVersion = "v3";
110
110
  readonly modelId: OpenAIEmbeddingModelId;
111
111
  readonly maxEmbeddingsPerCall = 2048;
@@ -113,7 +113,7 @@ declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
113
113
  private readonly config;
114
114
  get provider(): string;
115
115
  constructor(modelId: OpenAIEmbeddingModelId, config: OpenAIConfig);
116
- doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV3<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV3<string>['doEmbed']>>>;
116
+ doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV3['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV3['doEmbed']>>>;
117
117
  }
118
118
 
119
119
  type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | (string & {});
@@ -4448,8 +4448,21 @@ var OpenAIResponsesLanguageModel = class {
4448
4448
  }
4449
4449
  });
4450
4450
  }
4451
- } else if (isResponseOutputItemDoneChunk(value) && value.item.type !== "message") {
4452
- if (value.item.type === "function_call") {
4451
+ } else if (isResponseOutputItemDoneChunk(value)) {
4452
+ if (value.item.type === "message") {
4453
+ controller.enqueue({
4454
+ type: "text-end",
4455
+ id: value.item.id,
4456
+ providerMetadata: {
4457
+ [providerKey]: {
4458
+ itemId: value.item.id,
4459
+ ...ongoingAnnotations.length > 0 && {
4460
+ annotations: ongoingAnnotations
4461
+ }
4462
+ }
4463
+ }
4464
+ });
4465
+ } else if (value.item.type === "function_call") {
4453
4466
  ongoingToolCalls[value.output_index] = void 0;
4454
4467
  hasFunctionCall = true;
4455
4468
  controller.enqueue({
@@ -4818,19 +4831,6 @@ var OpenAIResponsesLanguageModel = class {
4818
4831
  }
4819
4832
  });
4820
4833
  }
4821
- } else if (isResponseOutputItemDoneChunk(value) && value.item.type === "message") {
4822
- controller.enqueue({
4823
- type: "text-end",
4824
- id: value.item.id,
4825
- providerMetadata: {
4826
- [providerKey]: {
4827
- itemId: value.item.id,
4828
- ...ongoingAnnotations.length > 0 && {
4829
- annotations: ongoingAnnotations
4830
- }
4831
- }
4832
- }
4833
- });
4834
4834
  } else if (isErrorChunk(value)) {
4835
4835
  controller.enqueue({ type: "error", error: value });
4836
4836
  }