@ai-sdk/openai 2.0.0-canary.5 → 2.0.0-canary.6
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 +18 -0
- package/dist/index.d.mts +6 -67
- package/dist/index.d.ts +6 -67
- package/dist/index.js +416 -503
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +383 -470
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +88 -80
- package/dist/internal/index.d.ts +88 -80
- package/dist/internal/index.js +415 -500
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +383 -469
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -2,62 +2,83 @@ import { LanguageModelV2, EmbeddingModelV1, ImageModelV1, TranscriptionModelV1Ca
|
|
|
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' | 'chatgpt-4o-latest' | (string & {});
|
|
6
|
-
|
|
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-search-preview' | 'gpt-4o-search-preview-2025-03-11' | '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
|
+
declare const openaiProviderOptions: z.ZodObject<{
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
The exact effect will vary per model, but values between -1 and 1 should
|
|
15
|
-
decrease or increase likelihood of selection; values like -100 or 100
|
|
16
|
-
should result in a ban or exclusive selection of the relevant token.
|
|
17
|
-
|
|
18
|
-
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
19
|
-
token from being generated.
|
|
20
|
-
*/
|
|
21
|
-
logitBias?: Record<number, number>;
|
|
8
|
+
* Modify the likelihood of specified tokens appearing in the completion.
|
|
9
|
+
*
|
|
10
|
+
* Accepts a JSON object that maps tokens (specified by their token ID in
|
|
11
|
+
* the GPT tokenizer) to an associated bias value from -100 to 100.
|
|
12
|
+
*/
|
|
13
|
+
logitBias: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodNumber>>;
|
|
22
14
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
logprobs?: boolean | number;
|
|
15
|
+
* Return the log probabilities of the tokens.
|
|
16
|
+
*
|
|
17
|
+
* Setting to true will return the log probabilities of the tokens that
|
|
18
|
+
* were generated.
|
|
19
|
+
*
|
|
20
|
+
* Setting to a number will return the log probabilities of the top n
|
|
21
|
+
* tokens that were generated.
|
|
22
|
+
*/
|
|
23
|
+
logprobs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
34
24
|
/**
|
|
35
|
-
|
|
25
|
+
* Whether to enable parallel function calling during tool use. Default to true.
|
|
36
26
|
*/
|
|
37
|
-
parallelToolCalls
|
|
27
|
+
parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
38
28
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
structuredOutputs?: boolean;
|
|
29
|
+
* A unique identifier representing your end-user, which can help OpenAI to
|
|
30
|
+
* monitor and detect abuse.
|
|
31
|
+
*/
|
|
32
|
+
user: z.ZodOptional<z.ZodString>;
|
|
44
33
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Required by some open source inference engines which do not support the `tools` API. May also
|
|
48
|
-
provide a workaround for `parallelToolCalls` resulting in the provider buffering tool calls,
|
|
49
|
-
which causes `streamObject` to be non-streaming.
|
|
50
|
-
|
|
51
|
-
Prefer setting `parallelToolCalls: false` over this option.
|
|
52
|
-
|
|
53
|
-
@deprecated this API is supported but deprecated by OpenAI.
|
|
34
|
+
* Reasoning effort for reasoning models. Defaults to `medium`.
|
|
54
35
|
*/
|
|
55
|
-
|
|
36
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
56
37
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
38
|
+
* Maximum number of completion tokens to generate. Useful for reasoning models.
|
|
39
|
+
*/
|
|
40
|
+
maxCompletionTokens: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to enable persistence in responses API.
|
|
43
|
+
*/
|
|
44
|
+
store: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Metadata to associate with the request.
|
|
47
|
+
*/
|
|
48
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
49
|
+
/**
|
|
50
|
+
* Parameters for prediction mode.
|
|
51
|
+
*/
|
|
52
|
+
prediction: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
user?: string | undefined;
|
|
55
|
+
logitBias?: Record<number, number> | undefined;
|
|
56
|
+
logprobs?: number | boolean | undefined;
|
|
57
|
+
parallelToolCalls?: boolean | undefined;
|
|
58
|
+
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
59
|
+
maxCompletionTokens?: number | undefined;
|
|
60
|
+
store?: boolean | undefined;
|
|
61
|
+
metadata?: Record<string, string> | undefined;
|
|
62
|
+
prediction?: Record<string, any> | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
user?: string | undefined;
|
|
65
|
+
logitBias?: Record<number, number> | undefined;
|
|
66
|
+
logprobs?: number | boolean | undefined;
|
|
67
|
+
parallelToolCalls?: boolean | undefined;
|
|
68
|
+
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
69
|
+
maxCompletionTokens?: number | undefined;
|
|
70
|
+
store?: boolean | undefined;
|
|
71
|
+
metadata?: Record<string, string> | undefined;
|
|
72
|
+
prediction?: Record<string, any> | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
type OpenAIProviderOptions = z.infer<typeof openaiProviderOptions>;
|
|
75
|
+
interface OpenAIChatSettings {
|
|
76
|
+
/**
|
|
77
|
+
Whether to use structured outputs. Defaults to false.
|
|
78
|
+
|
|
79
|
+
When enabled, tool calls and object generation will be strict and follow the provided schema.
|
|
59
80
|
*/
|
|
60
|
-
|
|
81
|
+
structuredOutputs?: boolean;
|
|
61
82
|
/**
|
|
62
83
|
Automatically download images and pass the image as data to the model.
|
|
63
84
|
OpenAI supports image URLs for public models, so this is only needed for
|
|
@@ -66,19 +87,6 @@ interface OpenAIChatSettings {
|
|
|
66
87
|
Defaults to `false`.
|
|
67
88
|
*/
|
|
68
89
|
downloadImages?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
Simulates streaming by using a normal generate call and returning it as a stream.
|
|
71
|
-
Enable this if the model that you are using does not support streaming.
|
|
72
|
-
|
|
73
|
-
Defaults to `false`.
|
|
74
|
-
|
|
75
|
-
@deprecated Use `simulateStreamingMiddleware` instead.
|
|
76
|
-
*/
|
|
77
|
-
simulateStreaming?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
Reasoning effort for reasoning models. Defaults to `medium`.
|
|
80
|
-
*/
|
|
81
|
-
reasoningEffort?: 'low' | 'medium' | 'high';
|
|
82
90
|
}
|
|
83
91
|
|
|
84
92
|
type OpenAIChatConfig = {
|
|
@@ -271,23 +279,23 @@ type OpenAITranscriptionModelOptions = {
|
|
|
271
279
|
};
|
|
272
280
|
|
|
273
281
|
declare const OpenAIProviderOptionsSchema: z.ZodObject<{
|
|
274
|
-
include: z.ZodOptional<z.ZodArray<z.ZodString, "many"
|
|
275
|
-
language: z.ZodOptional<z.ZodString
|
|
276
|
-
prompt: z.ZodOptional<z.ZodString
|
|
277
|
-
temperature: z.ZodDefault<z.ZodOptional<z.ZodNumber
|
|
278
|
-
timestampGranularities: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["word", "segment"]>, "many"
|
|
282
|
+
include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
283
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
285
|
+
temperature: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
286
|
+
timestampGranularities: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["word", "segment"]>, "many">>>>;
|
|
279
287
|
}, "strip", z.ZodTypeAny, {
|
|
280
|
-
temperature: number;
|
|
281
|
-
timestampGranularities: ("word" | "segment")[];
|
|
282
|
-
prompt?: string | undefined;
|
|
283
|
-
include?: string[] | undefined;
|
|
284
|
-
language?: string | undefined;
|
|
288
|
+
temperature: number | null;
|
|
289
|
+
timestampGranularities: ("word" | "segment")[] | null;
|
|
290
|
+
prompt?: string | null | undefined;
|
|
291
|
+
include?: string[] | null | undefined;
|
|
292
|
+
language?: string | null | undefined;
|
|
285
293
|
}, {
|
|
286
|
-
prompt?: string | undefined;
|
|
287
|
-
temperature?: number | undefined;
|
|
288
|
-
include?: string[] | undefined;
|
|
289
|
-
language?: string | undefined;
|
|
290
|
-
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
294
|
+
prompt?: string | null | undefined;
|
|
295
|
+
temperature?: number | null | undefined;
|
|
296
|
+
include?: string[] | null | undefined;
|
|
297
|
+
language?: string | null | undefined;
|
|
298
|
+
timestampGranularities?: ("word" | "segment")[] | null | undefined;
|
|
291
299
|
}>;
|
|
292
300
|
type OpenAITranscriptionCallOptions = Omit<TranscriptionModelV1CallOptions, 'providerOptions'> & {
|
|
293
301
|
providerOptions?: {
|
|
@@ -333,23 +341,23 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
333
341
|
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
334
342
|
}, "strip", z.ZodTypeAny, {
|
|
335
343
|
user?: string | null | undefined;
|
|
344
|
+
parallelToolCalls?: boolean | null | undefined;
|
|
345
|
+
reasoningEffort?: string | null | undefined;
|
|
336
346
|
store?: boolean | null | undefined;
|
|
337
347
|
metadata?: any;
|
|
338
|
-
reasoningEffort?: string | null | undefined;
|
|
339
|
-
parallelToolCalls?: boolean | null | undefined;
|
|
340
348
|
previousResponseId?: string | null | undefined;
|
|
341
349
|
strictSchemas?: boolean | null | undefined;
|
|
342
350
|
instructions?: string | null | undefined;
|
|
343
351
|
}, {
|
|
344
352
|
user?: string | null | undefined;
|
|
353
|
+
parallelToolCalls?: boolean | null | undefined;
|
|
354
|
+
reasoningEffort?: string | null | undefined;
|
|
345
355
|
store?: boolean | null | undefined;
|
|
346
356
|
metadata?: any;
|
|
347
|
-
reasoningEffort?: string | null | undefined;
|
|
348
|
-
parallelToolCalls?: boolean | null | undefined;
|
|
349
357
|
previousResponseId?: string | null | undefined;
|
|
350
358
|
strictSchemas?: boolean | null | undefined;
|
|
351
359
|
instructions?: string | null | undefined;
|
|
352
360
|
}>;
|
|
353
361
|
type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
|
|
354
362
|
|
|
355
|
-
export { OpenAIChatLanguageModel, type OpenAIChatModelId, type OpenAIChatSettings, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionSettings, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingSettings, OpenAIImageModel, type OpenAIImageModelId, type OpenAIImageSettings, OpenAIResponsesLanguageModel, type OpenAIResponsesProviderOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, modelMaxImagesPerCall };
|
|
363
|
+
export { OpenAIChatLanguageModel, type OpenAIChatModelId, type OpenAIChatSettings, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionSettings, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingSettings, OpenAIImageModel, type OpenAIImageModelId, type OpenAIImageSettings, type OpenAIProviderOptions, OpenAIResponsesLanguageModel, type OpenAIResponsesProviderOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, modelMaxImagesPerCall, openaiProviderOptions };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -2,62 +2,83 @@ import { LanguageModelV2, EmbeddingModelV1, ImageModelV1, TranscriptionModelV1Ca
|
|
|
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' | 'chatgpt-4o-latest' | (string & {});
|
|
6
|
-
|
|
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-search-preview' | 'gpt-4o-search-preview-2025-03-11' | '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
|
+
declare const openaiProviderOptions: z.ZodObject<{
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
The exact effect will vary per model, but values between -1 and 1 should
|
|
15
|
-
decrease or increase likelihood of selection; values like -100 or 100
|
|
16
|
-
should result in a ban or exclusive selection of the relevant token.
|
|
17
|
-
|
|
18
|
-
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
19
|
-
token from being generated.
|
|
20
|
-
*/
|
|
21
|
-
logitBias?: Record<number, number>;
|
|
8
|
+
* Modify the likelihood of specified tokens appearing in the completion.
|
|
9
|
+
*
|
|
10
|
+
* Accepts a JSON object that maps tokens (specified by their token ID in
|
|
11
|
+
* the GPT tokenizer) to an associated bias value from -100 to 100.
|
|
12
|
+
*/
|
|
13
|
+
logitBias: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodNumber>>;
|
|
22
14
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
logprobs?: boolean | number;
|
|
15
|
+
* Return the log probabilities of the tokens.
|
|
16
|
+
*
|
|
17
|
+
* Setting to true will return the log probabilities of the tokens that
|
|
18
|
+
* were generated.
|
|
19
|
+
*
|
|
20
|
+
* Setting to a number will return the log probabilities of the top n
|
|
21
|
+
* tokens that were generated.
|
|
22
|
+
*/
|
|
23
|
+
logprobs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
34
24
|
/**
|
|
35
|
-
|
|
25
|
+
* Whether to enable parallel function calling during tool use. Default to true.
|
|
36
26
|
*/
|
|
37
|
-
parallelToolCalls
|
|
27
|
+
parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
38
28
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
structuredOutputs?: boolean;
|
|
29
|
+
* A unique identifier representing your end-user, which can help OpenAI to
|
|
30
|
+
* monitor and detect abuse.
|
|
31
|
+
*/
|
|
32
|
+
user: z.ZodOptional<z.ZodString>;
|
|
44
33
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Required by some open source inference engines which do not support the `tools` API. May also
|
|
48
|
-
provide a workaround for `parallelToolCalls` resulting in the provider buffering tool calls,
|
|
49
|
-
which causes `streamObject` to be non-streaming.
|
|
50
|
-
|
|
51
|
-
Prefer setting `parallelToolCalls: false` over this option.
|
|
52
|
-
|
|
53
|
-
@deprecated this API is supported but deprecated by OpenAI.
|
|
34
|
+
* Reasoning effort for reasoning models. Defaults to `medium`.
|
|
54
35
|
*/
|
|
55
|
-
|
|
36
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
56
37
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
38
|
+
* Maximum number of completion tokens to generate. Useful for reasoning models.
|
|
39
|
+
*/
|
|
40
|
+
maxCompletionTokens: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to enable persistence in responses API.
|
|
43
|
+
*/
|
|
44
|
+
store: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Metadata to associate with the request.
|
|
47
|
+
*/
|
|
48
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
49
|
+
/**
|
|
50
|
+
* Parameters for prediction mode.
|
|
51
|
+
*/
|
|
52
|
+
prediction: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
user?: string | undefined;
|
|
55
|
+
logitBias?: Record<number, number> | undefined;
|
|
56
|
+
logprobs?: number | boolean | undefined;
|
|
57
|
+
parallelToolCalls?: boolean | undefined;
|
|
58
|
+
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
59
|
+
maxCompletionTokens?: number | undefined;
|
|
60
|
+
store?: boolean | undefined;
|
|
61
|
+
metadata?: Record<string, string> | undefined;
|
|
62
|
+
prediction?: Record<string, any> | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
user?: string | undefined;
|
|
65
|
+
logitBias?: Record<number, number> | undefined;
|
|
66
|
+
logprobs?: number | boolean | undefined;
|
|
67
|
+
parallelToolCalls?: boolean | undefined;
|
|
68
|
+
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
69
|
+
maxCompletionTokens?: number | undefined;
|
|
70
|
+
store?: boolean | undefined;
|
|
71
|
+
metadata?: Record<string, string> | undefined;
|
|
72
|
+
prediction?: Record<string, any> | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
type OpenAIProviderOptions = z.infer<typeof openaiProviderOptions>;
|
|
75
|
+
interface OpenAIChatSettings {
|
|
76
|
+
/**
|
|
77
|
+
Whether to use structured outputs. Defaults to false.
|
|
78
|
+
|
|
79
|
+
When enabled, tool calls and object generation will be strict and follow the provided schema.
|
|
59
80
|
*/
|
|
60
|
-
|
|
81
|
+
structuredOutputs?: boolean;
|
|
61
82
|
/**
|
|
62
83
|
Automatically download images and pass the image as data to the model.
|
|
63
84
|
OpenAI supports image URLs for public models, so this is only needed for
|
|
@@ -66,19 +87,6 @@ interface OpenAIChatSettings {
|
|
|
66
87
|
Defaults to `false`.
|
|
67
88
|
*/
|
|
68
89
|
downloadImages?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
Simulates streaming by using a normal generate call and returning it as a stream.
|
|
71
|
-
Enable this if the model that you are using does not support streaming.
|
|
72
|
-
|
|
73
|
-
Defaults to `false`.
|
|
74
|
-
|
|
75
|
-
@deprecated Use `simulateStreamingMiddleware` instead.
|
|
76
|
-
*/
|
|
77
|
-
simulateStreaming?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
Reasoning effort for reasoning models. Defaults to `medium`.
|
|
80
|
-
*/
|
|
81
|
-
reasoningEffort?: 'low' | 'medium' | 'high';
|
|
82
90
|
}
|
|
83
91
|
|
|
84
92
|
type OpenAIChatConfig = {
|
|
@@ -271,23 +279,23 @@ type OpenAITranscriptionModelOptions = {
|
|
|
271
279
|
};
|
|
272
280
|
|
|
273
281
|
declare const OpenAIProviderOptionsSchema: z.ZodObject<{
|
|
274
|
-
include: z.ZodOptional<z.ZodArray<z.ZodString, "many"
|
|
275
|
-
language: z.ZodOptional<z.ZodString
|
|
276
|
-
prompt: z.ZodOptional<z.ZodString
|
|
277
|
-
temperature: z.ZodDefault<z.ZodOptional<z.ZodNumber
|
|
278
|
-
timestampGranularities: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["word", "segment"]>, "many"
|
|
282
|
+
include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
283
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
285
|
+
temperature: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
286
|
+
timestampGranularities: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["word", "segment"]>, "many">>>>;
|
|
279
287
|
}, "strip", z.ZodTypeAny, {
|
|
280
|
-
temperature: number;
|
|
281
|
-
timestampGranularities: ("word" | "segment")[];
|
|
282
|
-
prompt?: string | undefined;
|
|
283
|
-
include?: string[] | undefined;
|
|
284
|
-
language?: string | undefined;
|
|
288
|
+
temperature: number | null;
|
|
289
|
+
timestampGranularities: ("word" | "segment")[] | null;
|
|
290
|
+
prompt?: string | null | undefined;
|
|
291
|
+
include?: string[] | null | undefined;
|
|
292
|
+
language?: string | null | undefined;
|
|
285
293
|
}, {
|
|
286
|
-
prompt?: string | undefined;
|
|
287
|
-
temperature?: number | undefined;
|
|
288
|
-
include?: string[] | undefined;
|
|
289
|
-
language?: string | undefined;
|
|
290
|
-
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
294
|
+
prompt?: string | null | undefined;
|
|
295
|
+
temperature?: number | null | undefined;
|
|
296
|
+
include?: string[] | null | undefined;
|
|
297
|
+
language?: string | null | undefined;
|
|
298
|
+
timestampGranularities?: ("word" | "segment")[] | null | undefined;
|
|
291
299
|
}>;
|
|
292
300
|
type OpenAITranscriptionCallOptions = Omit<TranscriptionModelV1CallOptions, 'providerOptions'> & {
|
|
293
301
|
providerOptions?: {
|
|
@@ -333,23 +341,23 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
333
341
|
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
334
342
|
}, "strip", z.ZodTypeAny, {
|
|
335
343
|
user?: string | null | undefined;
|
|
344
|
+
parallelToolCalls?: boolean | null | undefined;
|
|
345
|
+
reasoningEffort?: string | null | undefined;
|
|
336
346
|
store?: boolean | null | undefined;
|
|
337
347
|
metadata?: any;
|
|
338
|
-
reasoningEffort?: string | null | undefined;
|
|
339
|
-
parallelToolCalls?: boolean | null | undefined;
|
|
340
348
|
previousResponseId?: string | null | undefined;
|
|
341
349
|
strictSchemas?: boolean | null | undefined;
|
|
342
350
|
instructions?: string | null | undefined;
|
|
343
351
|
}, {
|
|
344
352
|
user?: string | null | undefined;
|
|
353
|
+
parallelToolCalls?: boolean | null | undefined;
|
|
354
|
+
reasoningEffort?: string | null | undefined;
|
|
345
355
|
store?: boolean | null | undefined;
|
|
346
356
|
metadata?: any;
|
|
347
|
-
reasoningEffort?: string | null | undefined;
|
|
348
|
-
parallelToolCalls?: boolean | null | undefined;
|
|
349
357
|
previousResponseId?: string | null | undefined;
|
|
350
358
|
strictSchemas?: boolean | null | undefined;
|
|
351
359
|
instructions?: string | null | undefined;
|
|
352
360
|
}>;
|
|
353
361
|
type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
|
|
354
362
|
|
|
355
|
-
export { OpenAIChatLanguageModel, type OpenAIChatModelId, type OpenAIChatSettings, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionSettings, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingSettings, OpenAIImageModel, type OpenAIImageModelId, type OpenAIImageSettings, OpenAIResponsesLanguageModel, type OpenAIResponsesProviderOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, modelMaxImagesPerCall };
|
|
363
|
+
export { OpenAIChatLanguageModel, type OpenAIChatModelId, type OpenAIChatSettings, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionSettings, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingSettings, OpenAIImageModel, type OpenAIImageModelId, type OpenAIImageSettings, type OpenAIProviderOptions, OpenAIResponsesLanguageModel, type OpenAIResponsesProviderOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, modelMaxImagesPerCall, openaiProviderOptions };
|