@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.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +5 -2
- package/internal/dist/index.d.ts +5 -2
- package/internal/dist/index.js +3 -1
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +3 -1
- package/internal/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 1.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b520dba: feat (provider/openai): add chatgpt-4o-latest model
|
|
8
|
+
|
|
9
|
+
## 1.3.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 24befd8: feat (provider/openai): add instructions to providerOptions
|
|
14
|
+
|
|
3
15
|
## 1.3.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { LanguageModelV1, ProviderV1, EmbeddingModelV1, ImageModelV1 } from '@ai
|
|
|
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.
|
|
@@ -179,7 +179,7 @@ interface OpenAIImageSettings {
|
|
|
179
179
|
maxImagesPerCall?: number;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
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 & {});
|
|
182
|
+
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 & {});
|
|
183
183
|
|
|
184
184
|
declare const WebSearchPreviewParameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
185
185
|
declare function webSearchPreviewTool({ searchContextSize, userLocation, }?: {
|
|
@@ -302,6 +302,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
302
302
|
user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
303
303
|
reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
304
|
strictSchemas: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
305
|
+
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
306
|
}, "strip", z.ZodTypeAny, {
|
|
306
307
|
user?: string | null | undefined;
|
|
307
308
|
store?: boolean | null | undefined;
|
|
@@ -310,6 +311,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
310
311
|
parallelToolCalls?: boolean | null | undefined;
|
|
311
312
|
previousResponseId?: string | null | undefined;
|
|
312
313
|
strictSchemas?: boolean | null | undefined;
|
|
314
|
+
instructions?: string | null | undefined;
|
|
313
315
|
}, {
|
|
314
316
|
user?: string | null | undefined;
|
|
315
317
|
store?: boolean | null | undefined;
|
|
@@ -318,6 +320,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
318
320
|
parallelToolCalls?: boolean | null | undefined;
|
|
319
321
|
previousResponseId?: string | null | undefined;
|
|
320
322
|
strictSchemas?: boolean | null | undefined;
|
|
323
|
+
instructions?: string | null | undefined;
|
|
321
324
|
}>;
|
|
322
325
|
type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
|
|
323
326
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LanguageModelV1, ProviderV1, EmbeddingModelV1, ImageModelV1 } from '@ai
|
|
|
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.
|
|
@@ -179,7 +179,7 @@ interface OpenAIImageSettings {
|
|
|
179
179
|
maxImagesPerCall?: number;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
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 & {});
|
|
182
|
+
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 & {});
|
|
183
183
|
|
|
184
184
|
declare const WebSearchPreviewParameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
185
185
|
declare function webSearchPreviewTool({ searchContextSize, userLocation, }?: {
|
|
@@ -302,6 +302,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
302
302
|
user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
303
303
|
reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
304
|
strictSchemas: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
305
|
+
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
306
|
}, "strip", z.ZodTypeAny, {
|
|
306
307
|
user?: string | null | undefined;
|
|
307
308
|
store?: boolean | null | undefined;
|
|
@@ -310,6 +311,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
310
311
|
parallelToolCalls?: boolean | null | undefined;
|
|
311
312
|
previousResponseId?: string | null | undefined;
|
|
312
313
|
strictSchemas?: boolean | null | undefined;
|
|
314
|
+
instructions?: string | null | undefined;
|
|
313
315
|
}, {
|
|
314
316
|
user?: string | null | undefined;
|
|
315
317
|
store?: boolean | null | undefined;
|
|
@@ -318,6 +320,7 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
318
320
|
parallelToolCalls?: boolean | null | undefined;
|
|
319
321
|
previousResponseId?: string | null | undefined;
|
|
320
322
|
strictSchemas?: boolean | null | undefined;
|
|
323
|
+
instructions?: string | null | undefined;
|
|
321
324
|
}>;
|
|
322
325
|
type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
|
|
323
326
|
|
package/dist/index.js
CHANGED
|
@@ -1909,6 +1909,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
1909
1909
|
previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,
|
|
1910
1910
|
store: openaiOptions == null ? void 0 : openaiOptions.store,
|
|
1911
1911
|
user: openaiOptions == null ? void 0 : openaiOptions.user,
|
|
1912
|
+
instructions: openaiOptions == null ? void 0 : openaiOptions.instructions,
|
|
1912
1913
|
// model-specific settings:
|
|
1913
1914
|
...modelConfig.isReasoningModel && (openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null && {
|
|
1914
1915
|
reasoning: { effort: openaiOptions == null ? void 0 : openaiOptions.reasoningEffort }
|
|
@@ -2380,7 +2381,8 @@ var openaiResponsesProviderOptionsSchema = import_zod6.z.object({
|
|
|
2380
2381
|
store: import_zod6.z.boolean().nullish(),
|
|
2381
2382
|
user: import_zod6.z.string().nullish(),
|
|
2382
2383
|
reasoningEffort: import_zod6.z.string().nullish(),
|
|
2383
|
-
strictSchemas: import_zod6.z.boolean().nullish()
|
|
2384
|
+
strictSchemas: import_zod6.z.boolean().nullish(),
|
|
2385
|
+
instructions: import_zod6.z.string().nullish()
|
|
2384
2386
|
});
|
|
2385
2387
|
|
|
2386
2388
|
// src/openai-tools.ts
|