@ai-sdk/openai 2.0.0-canary.0 → 2.0.0-canary.10
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 +120 -0
- package/dist/index.d.mts +35 -102
- package/dist/index.d.ts +35 -102
- package/dist/index.js +987 -889
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1007 -899
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +390 -0
- package/dist/internal/index.d.ts +390 -0
- package/{internal/dist → dist/internal}/index.js +967 -877
- package/dist/internal/index.js.map +1 -0
- package/{internal/dist → dist/internal}/index.mjs +980 -884
- package/dist/internal/index.mjs.map +1 -0
- package/package.json +15 -15
- package/internal/dist/index.d.mts +0 -290
- package/internal/dist/index.d.ts +0 -290
- package/internal/dist/index.js.map +0 -1
- package/internal/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { LanguageModelV2, EmbeddingModelV2, ImageModelV1, TranscriptionModelV1CallOptions, TranscriptionModelV1, SpeechModelV1 } from '@ai-sdk/provider';
|
|
2
|
+
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
+
import { z } from 'zod';
|
|
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' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | '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-search-preview' | 'gpt-4o-mini-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
|
+
/**
|
|
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>>;
|
|
14
|
+
/**
|
|
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]>>;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to enable parallel function calling during tool use. Default to true.
|
|
26
|
+
*/
|
|
27
|
+
parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
/**
|
|
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>;
|
|
33
|
+
/**
|
|
34
|
+
* Reasoning effort for reasoning models. Defaults to `medium`.
|
|
35
|
+
*/
|
|
36
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
37
|
+
/**
|
|
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.
|
|
80
|
+
*/
|
|
81
|
+
structuredOutputs?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
type OpenAIChatConfig = {
|
|
85
|
+
provider: string;
|
|
86
|
+
compatibility: 'strict' | 'compatible';
|
|
87
|
+
headers: () => Record<string, string | undefined>;
|
|
88
|
+
url: (options: {
|
|
89
|
+
modelId: string;
|
|
90
|
+
path: string;
|
|
91
|
+
}) => string;
|
|
92
|
+
fetch?: FetchFunction;
|
|
93
|
+
};
|
|
94
|
+
declare class OpenAIChatLanguageModel implements LanguageModelV2 {
|
|
95
|
+
readonly specificationVersion = "v2";
|
|
96
|
+
readonly modelId: OpenAIChatModelId;
|
|
97
|
+
readonly settings: OpenAIChatSettings;
|
|
98
|
+
private readonly config;
|
|
99
|
+
constructor(modelId: OpenAIChatModelId, settings: OpenAIChatSettings, config: OpenAIChatConfig);
|
|
100
|
+
get provider(): string;
|
|
101
|
+
getSupportedUrls(): Promise<Record<string, RegExp[]>>;
|
|
102
|
+
private getArgs;
|
|
103
|
+
doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
|
|
104
|
+
doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
|
|
108
|
+
interface OpenAICompletionSettings {
|
|
109
|
+
/**
|
|
110
|
+
Echo back the prompt in addition to the completion.
|
|
111
|
+
*/
|
|
112
|
+
echo?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
Modify the likelihood of specified tokens appearing in the completion.
|
|
115
|
+
|
|
116
|
+
Accepts a JSON object that maps tokens (specified by their token ID in
|
|
117
|
+
the GPT tokenizer) to an associated bias value from -100 to 100. You
|
|
118
|
+
can use this tokenizer tool to convert text to token IDs. Mathematically,
|
|
119
|
+
the bias is added to the logits generated by the model prior to sampling.
|
|
120
|
+
The exact effect will vary per model, but values between -1 and 1 should
|
|
121
|
+
decrease or increase likelihood of selection; values like -100 or 100
|
|
122
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
123
|
+
|
|
124
|
+
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
125
|
+
token from being generated.
|
|
126
|
+
*/
|
|
127
|
+
logitBias?: Record<number, number>;
|
|
128
|
+
/**
|
|
129
|
+
Return the log probabilities of the tokens. Including logprobs will increase
|
|
130
|
+
the response size and can slow down response times. However, it can
|
|
131
|
+
be useful to better understand how the model is behaving.
|
|
132
|
+
|
|
133
|
+
Setting to true will return the log probabilities of the tokens that
|
|
134
|
+
were generated.
|
|
135
|
+
|
|
136
|
+
Setting to a number will return the log probabilities of the top n
|
|
137
|
+
tokens that were generated.
|
|
138
|
+
*/
|
|
139
|
+
logprobs?: boolean | number;
|
|
140
|
+
/**
|
|
141
|
+
The suffix that comes after a completion of inserted text.
|
|
142
|
+
*/
|
|
143
|
+
suffix?: string;
|
|
144
|
+
/**
|
|
145
|
+
A unique identifier representing your end-user, which can help OpenAI to
|
|
146
|
+
monitor and detect abuse. Learn more.
|
|
147
|
+
*/
|
|
148
|
+
user?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
type OpenAICompletionConfig = {
|
|
152
|
+
provider: string;
|
|
153
|
+
compatibility: 'strict' | 'compatible';
|
|
154
|
+
headers: () => Record<string, string | undefined>;
|
|
155
|
+
url: (options: {
|
|
156
|
+
modelId: string;
|
|
157
|
+
path: string;
|
|
158
|
+
}) => string;
|
|
159
|
+
fetch?: FetchFunction;
|
|
160
|
+
};
|
|
161
|
+
declare class OpenAICompletionLanguageModel implements LanguageModelV2 {
|
|
162
|
+
readonly specificationVersion = "v2";
|
|
163
|
+
readonly modelId: OpenAICompletionModelId;
|
|
164
|
+
readonly settings: OpenAICompletionSettings;
|
|
165
|
+
private readonly config;
|
|
166
|
+
constructor(modelId: OpenAICompletionModelId, settings: OpenAICompletionSettings, config: OpenAICompletionConfig);
|
|
167
|
+
get provider(): string;
|
|
168
|
+
getSupportedUrls(): Promise<Record<string, RegExp[]>>;
|
|
169
|
+
private getArgs;
|
|
170
|
+
doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
|
|
171
|
+
doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
type OpenAIConfig = {
|
|
175
|
+
provider: string;
|
|
176
|
+
url: (options: {
|
|
177
|
+
modelId: string;
|
|
178
|
+
path: string;
|
|
179
|
+
}) => string;
|
|
180
|
+
headers: () => Record<string, string | undefined>;
|
|
181
|
+
fetch?: FetchFunction;
|
|
182
|
+
generateId?: () => string;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002' | (string & {});
|
|
186
|
+
interface OpenAIEmbeddingSettings {
|
|
187
|
+
/**
|
|
188
|
+
Override the maximum number of embeddings per call.
|
|
189
|
+
*/
|
|
190
|
+
maxEmbeddingsPerCall?: number;
|
|
191
|
+
/**
|
|
192
|
+
Override the parallelism of embedding calls.
|
|
193
|
+
*/
|
|
194
|
+
supportsParallelCalls?: boolean;
|
|
195
|
+
}
|
|
196
|
+
declare const openaiEmbeddingProviderOptions: z.ZodObject<{
|
|
197
|
+
/**
|
|
198
|
+
The number of dimensions the resulting output embeddings should have.
|
|
199
|
+
Only supported in text-embedding-3 and later models.
|
|
200
|
+
*/
|
|
201
|
+
dimensions: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
/**
|
|
203
|
+
A unique identifier representing your end-user, which can help OpenAI to
|
|
204
|
+
monitor and detect abuse. Learn more.
|
|
205
|
+
*/
|
|
206
|
+
user: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
user?: string | undefined;
|
|
209
|
+
dimensions?: number | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
user?: string | undefined;
|
|
212
|
+
dimensions?: number | undefined;
|
|
213
|
+
}>;
|
|
214
|
+
type OpenAIEmbeddingProviderOptions = z.infer<typeof openaiEmbeddingProviderOptions>;
|
|
215
|
+
|
|
216
|
+
declare class OpenAIEmbeddingModel implements EmbeddingModelV2<string> {
|
|
217
|
+
readonly specificationVersion = "v2";
|
|
218
|
+
readonly modelId: OpenAIEmbeddingModelId;
|
|
219
|
+
private readonly config;
|
|
220
|
+
private readonly settings;
|
|
221
|
+
get provider(): string;
|
|
222
|
+
get maxEmbeddingsPerCall(): number;
|
|
223
|
+
get supportsParallelCalls(): boolean;
|
|
224
|
+
constructor(modelId: OpenAIEmbeddingModelId, settings: OpenAIEmbeddingSettings, config: OpenAIConfig);
|
|
225
|
+
doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV2<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV2<string>['doEmbed']>>>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | (string & {});
|
|
229
|
+
declare const modelMaxImagesPerCall: Record<OpenAIImageModelId, number>;
|
|
230
|
+
interface OpenAIImageSettings {
|
|
231
|
+
/**
|
|
232
|
+
Override the maximum number of images per call (default is dependent on the
|
|
233
|
+
model, or 1 for an unknown model).
|
|
234
|
+
*/
|
|
235
|
+
maxImagesPerCall?: number;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface OpenAIImageModelConfig extends OpenAIConfig {
|
|
239
|
+
_internal?: {
|
|
240
|
+
currentDate?: () => Date;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
declare class OpenAIImageModel implements ImageModelV1 {
|
|
244
|
+
readonly modelId: OpenAIImageModelId;
|
|
245
|
+
private readonly settings;
|
|
246
|
+
private readonly config;
|
|
247
|
+
readonly specificationVersion = "v1";
|
|
248
|
+
get maxImagesPerCall(): number;
|
|
249
|
+
get provider(): string;
|
|
250
|
+
constructor(modelId: OpenAIImageModelId, settings: OpenAIImageSettings, config: OpenAIImageModelConfig);
|
|
251
|
+
doGenerate({ prompt, n, size, aspectRatio, seed, providerOptions, headers, abortSignal, }: Parameters<ImageModelV1['doGenerate']>[0]): Promise<Awaited<ReturnType<ImageModelV1['doGenerate']>>>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
|
|
255
|
+
type OpenAITranscriptionModelOptions = {
|
|
256
|
+
/**
|
|
257
|
+
* Additional information to include in the transcription response.
|
|
258
|
+
*/
|
|
259
|
+
include?: string[];
|
|
260
|
+
/**
|
|
261
|
+
* The language of the input audio in ISO-639-1 format.
|
|
262
|
+
*/
|
|
263
|
+
language?: string;
|
|
264
|
+
/**
|
|
265
|
+
* An optional text to guide the model's style or continue a previous audio segment.
|
|
266
|
+
*/
|
|
267
|
+
prompt?: string;
|
|
268
|
+
/**
|
|
269
|
+
* The sampling temperature, between 0 and 1.
|
|
270
|
+
* @default 0
|
|
271
|
+
*/
|
|
272
|
+
temperature?: number;
|
|
273
|
+
/**
|
|
274
|
+
* The timestamp granularities to populate for this transcription.
|
|
275
|
+
* @default ['segment']
|
|
276
|
+
*/
|
|
277
|
+
timestamp_granularities?: Array<'word' | 'segment'>;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
declare const openAIProviderOptionsSchema: z.ZodObject<{
|
|
281
|
+
include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
282
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
283
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
+
temperature: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
285
|
+
timestampGranularities: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["word", "segment"]>, "many">>>>;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
temperature: number | null;
|
|
288
|
+
timestampGranularities: ("word" | "segment")[] | null;
|
|
289
|
+
prompt?: string | null | undefined;
|
|
290
|
+
include?: string[] | null | undefined;
|
|
291
|
+
language?: string | null | undefined;
|
|
292
|
+
}, {
|
|
293
|
+
prompt?: string | null | undefined;
|
|
294
|
+
temperature?: number | null | undefined;
|
|
295
|
+
include?: string[] | null | undefined;
|
|
296
|
+
language?: string | null | undefined;
|
|
297
|
+
timestampGranularities?: ("word" | "segment")[] | null | undefined;
|
|
298
|
+
}>;
|
|
299
|
+
type OpenAITranscriptionCallOptions = Omit<TranscriptionModelV1CallOptions, 'providerOptions'> & {
|
|
300
|
+
providerOptions?: {
|
|
301
|
+
openai?: z.infer<typeof openAIProviderOptionsSchema>;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
interface OpenAITranscriptionModelConfig extends OpenAIConfig {
|
|
305
|
+
_internal?: {
|
|
306
|
+
currentDate?: () => Date;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
declare class OpenAITranscriptionModel implements TranscriptionModelV1 {
|
|
310
|
+
readonly modelId: OpenAITranscriptionModelId;
|
|
311
|
+
private readonly config;
|
|
312
|
+
readonly specificationVersion = "v1";
|
|
313
|
+
get provider(): string;
|
|
314
|
+
constructor(modelId: OpenAITranscriptionModelId, config: OpenAITranscriptionModelConfig);
|
|
315
|
+
private getArgs;
|
|
316
|
+
doGenerate(options: OpenAITranscriptionCallOptions): Promise<Awaited<ReturnType<TranscriptionModelV1['doGenerate']>>>;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
|
|
320
|
+
|
|
321
|
+
declare const OpenAIProviderOptionsSchema: z.ZodObject<{
|
|
322
|
+
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
speed: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNumber>>>;
|
|
324
|
+
}, "strip", z.ZodTypeAny, {
|
|
325
|
+
instructions?: string | null | undefined;
|
|
326
|
+
speed?: number | null | undefined;
|
|
327
|
+
}, {
|
|
328
|
+
instructions?: string | null | undefined;
|
|
329
|
+
speed?: number | null | undefined;
|
|
330
|
+
}>;
|
|
331
|
+
type OpenAISpeechCallOptions = z.infer<typeof OpenAIProviderOptionsSchema>;
|
|
332
|
+
interface OpenAISpeechModelConfig extends OpenAIConfig {
|
|
333
|
+
_internal?: {
|
|
334
|
+
currentDate?: () => Date;
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
declare class OpenAISpeechModel implements SpeechModelV1 {
|
|
338
|
+
readonly modelId: OpenAISpeechModelId;
|
|
339
|
+
private readonly config;
|
|
340
|
+
readonly specificationVersion = "v1";
|
|
341
|
+
get provider(): string;
|
|
342
|
+
constructor(modelId: OpenAISpeechModelId, config: OpenAISpeechModelConfig);
|
|
343
|
+
private getArgs;
|
|
344
|
+
doGenerate(options: Parameters<SpeechModelV1['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV1['doGenerate']>>>;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
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' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | '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-search-preview' | 'gpt-4o-mini-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 & {});
|
|
348
|
+
|
|
349
|
+
declare class OpenAIResponsesLanguageModel implements LanguageModelV2 {
|
|
350
|
+
readonly specificationVersion = "v2";
|
|
351
|
+
readonly modelId: OpenAIResponsesModelId;
|
|
352
|
+
private readonly config;
|
|
353
|
+
constructor(modelId: OpenAIResponsesModelId, config: OpenAIConfig);
|
|
354
|
+
getSupportedUrls(): Promise<Record<string, RegExp[]>>;
|
|
355
|
+
get provider(): string;
|
|
356
|
+
private getArgs;
|
|
357
|
+
doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
|
|
358
|
+
doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
|
|
359
|
+
}
|
|
360
|
+
declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
361
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
362
|
+
parallelToolCalls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
363
|
+
previousResponseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
364
|
+
store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
365
|
+
user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
366
|
+
reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
367
|
+
strictSchemas: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
368
|
+
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
|
+
user?: string | null | undefined;
|
|
371
|
+
parallelToolCalls?: boolean | null | undefined;
|
|
372
|
+
reasoningEffort?: string | null | undefined;
|
|
373
|
+
store?: boolean | null | undefined;
|
|
374
|
+
metadata?: any;
|
|
375
|
+
instructions?: string | null | undefined;
|
|
376
|
+
previousResponseId?: string | null | undefined;
|
|
377
|
+
strictSchemas?: boolean | null | undefined;
|
|
378
|
+
}, {
|
|
379
|
+
user?: string | null | undefined;
|
|
380
|
+
parallelToolCalls?: boolean | null | undefined;
|
|
381
|
+
reasoningEffort?: string | null | undefined;
|
|
382
|
+
store?: boolean | null | undefined;
|
|
383
|
+
metadata?: any;
|
|
384
|
+
instructions?: string | null | undefined;
|
|
385
|
+
previousResponseId?: string | null | undefined;
|
|
386
|
+
strictSchemas?: boolean | null | undefined;
|
|
387
|
+
}>;
|
|
388
|
+
type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
|
|
389
|
+
|
|
390
|
+
export { OpenAIChatLanguageModel, type OpenAIChatModelId, type OpenAIChatSettings, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionSettings, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingProviderOptions, type OpenAIEmbeddingSettings, OpenAIImageModel, type OpenAIImageModelId, type OpenAIImageSettings, type OpenAIProviderOptions, OpenAIResponsesLanguageModel, type OpenAIResponsesProviderOptions, type OpenAISpeechCallOptions, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, modelMaxImagesPerCall, openaiEmbeddingProviderOptions, openaiProviderOptions };
|