@ai-sdk/openai 1.3.2 → 1.3.4

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.
@@ -2,7 +2,7 @@ import { LanguageModelV1, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provide
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  import { z } from 'zod';
4
4
 
5
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | (string & {});
5
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
6
6
  interface OpenAIChatSettings {
7
7
  /**
8
8
  Modify the likelihood of specified tokens appearing in the completion.
@@ -244,7 +244,7 @@ declare class OpenAIImageModel implements ImageModelV1 {
244
244
  doGenerate({ prompt, n, size, aspectRatio, seed, providerOptions, headers, abortSignal, }: Parameters<ImageModelV1['doGenerate']>[0]): Promise<Awaited<ReturnType<ImageModelV1['doGenerate']>>>;
245
245
  }
246
246
 
247
- type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | (string & {});
247
+ type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
248
248
 
249
249
  declare class OpenAIResponsesLanguageModel implements LanguageModelV1 {
250
250
  readonly specificationVersion = "v1";
@@ -265,6 +265,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
265
265
  user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
266
266
  reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
267
267
  strictSchemas: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
268
+ instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
268
269
  }, "strip", z.ZodTypeAny, {
269
270
  user?: string | null | undefined;
270
271
  store?: boolean | null | undefined;
@@ -273,6 +274,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
273
274
  parallelToolCalls?: boolean | null | undefined;
274
275
  previousResponseId?: string | null | undefined;
275
276
  strictSchemas?: boolean | null | undefined;
277
+ instructions?: string | null | undefined;
276
278
  }, {
277
279
  user?: string | null | undefined;
278
280
  store?: boolean | null | undefined;
@@ -281,6 +283,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
281
283
  parallelToolCalls?: boolean | null | undefined;
282
284
  previousResponseId?: string | null | undefined;
283
285
  strictSchemas?: boolean | null | undefined;
286
+ instructions?: string | null | undefined;
284
287
  }>;
285
288
  type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
286
289
 
@@ -2,7 +2,7 @@ import { LanguageModelV1, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provide
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  import { z } from 'zod';
4
4
 
5
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | (string & {});
5
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
6
6
  interface OpenAIChatSettings {
7
7
  /**
8
8
  Modify the likelihood of specified tokens appearing in the completion.
@@ -244,7 +244,7 @@ declare class OpenAIImageModel implements ImageModelV1 {
244
244
  doGenerate({ prompt, n, size, aspectRatio, seed, providerOptions, headers, abortSignal, }: Parameters<ImageModelV1['doGenerate']>[0]): Promise<Awaited<ReturnType<ImageModelV1['doGenerate']>>>;
245
245
  }
246
246
 
247
- type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | (string & {});
247
+ type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
248
248
 
249
249
  declare class OpenAIResponsesLanguageModel implements LanguageModelV1 {
250
250
  readonly specificationVersion = "v1";
@@ -265,6 +265,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
265
265
  user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
266
266
  reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
267
267
  strictSchemas: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
268
+ instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
268
269
  }, "strip", z.ZodTypeAny, {
269
270
  user?: string | null | undefined;
270
271
  store?: boolean | null | undefined;
@@ -273,6 +274,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
273
274
  parallelToolCalls?: boolean | null | undefined;
274
275
  previousResponseId?: string | null | undefined;
275
276
  strictSchemas?: boolean | null | undefined;
277
+ instructions?: string | null | undefined;
276
278
  }, {
277
279
  user?: string | null | undefined;
278
280
  store?: boolean | null | undefined;
@@ -281,6 +283,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
281
283
  parallelToolCalls?: boolean | null | undefined;
282
284
  previousResponseId?: string | null | undefined;
283
285
  strictSchemas?: boolean | null | undefined;
286
+ instructions?: string | null | undefined;
284
287
  }>;
285
288
  type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
286
289
 
@@ -1910,6 +1910,7 @@ var OpenAIResponsesLanguageModel = class {
1910
1910
  previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,
1911
1911
  store: openaiOptions == null ? void 0 : openaiOptions.store,
1912
1912
  user: openaiOptions == null ? void 0 : openaiOptions.user,
1913
+ instructions: openaiOptions == null ? void 0 : openaiOptions.instructions,
1913
1914
  // model-specific settings:
1914
1915
  ...modelConfig.isReasoningModel && (openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null && {
1915
1916
  reasoning: { effort: openaiOptions == null ? void 0 : openaiOptions.reasoningEffort }
@@ -2381,7 +2382,8 @@ var openaiResponsesProviderOptionsSchema = import_zod6.z.object({
2381
2382
  store: import_zod6.z.boolean().nullish(),
2382
2383
  user: import_zod6.z.string().nullish(),
2383
2384
  reasoningEffort: import_zod6.z.string().nullish(),
2384
- strictSchemas: import_zod6.z.boolean().nullish()
2385
+ strictSchemas: import_zod6.z.boolean().nullish(),
2386
+ instructions: import_zod6.z.string().nullish()
2385
2387
  });
2386
2388
  // Annotate the CommonJS export names for ESM import in node:
2387
2389
  0 && (module.exports = {