@ai-sdk/openai 2.0.0-canary.14 → 2.0.0-canary.16
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 +44 -0
- package/README.md +2 -2
- package/dist/index.js +170 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +170 -79
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +39 -15
- package/dist/internal/index.d.ts +39 -15
- package/dist/internal/index.js +170 -79
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +170 -79
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -11,6 +11,16 @@ declare const openaiProviderOptions: z.ZodObject<{
|
|
|
11
11
|
* the GPT tokenizer) to an associated bias value from -100 to 100.
|
|
12
12
|
*/
|
|
13
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]>>;
|
|
14
24
|
/**
|
|
15
25
|
* Whether to enable parallel function calling during tool use. Default to true.
|
|
16
26
|
*/
|
|
@@ -49,6 +59,7 @@ declare const openaiProviderOptions: z.ZodObject<{
|
|
|
49
59
|
}, "strip", z.ZodTypeAny, {
|
|
50
60
|
user?: string | undefined;
|
|
51
61
|
logitBias?: Record<number, number> | undefined;
|
|
62
|
+
logprobs?: number | boolean | undefined;
|
|
52
63
|
parallelToolCalls?: boolean | undefined;
|
|
53
64
|
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
54
65
|
maxCompletionTokens?: number | undefined;
|
|
@@ -59,6 +70,7 @@ declare const openaiProviderOptions: z.ZodObject<{
|
|
|
59
70
|
}, {
|
|
60
71
|
user?: string | undefined;
|
|
61
72
|
logitBias?: Record<number, number> | undefined;
|
|
73
|
+
logprobs?: number | boolean | undefined;
|
|
62
74
|
parallelToolCalls?: boolean | undefined;
|
|
63
75
|
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
64
76
|
maxCompletionTokens?: number | undefined;
|
|
@@ -123,14 +135,26 @@ declare const openaiCompletionProviderOptions: z.ZodObject<{
|
|
|
123
135
|
monitor and detect abuse. Learn more.
|
|
124
136
|
*/
|
|
125
137
|
user: z.ZodOptional<z.ZodString>;
|
|
138
|
+
/**
|
|
139
|
+
Return the log probabilities of the tokens. Including logprobs will increase
|
|
140
|
+
the response size and can slow down response times. However, it can
|
|
141
|
+
be useful to better understand how the model is behaving.
|
|
142
|
+
Setting to true will return the log probabilities of the tokens that
|
|
143
|
+
were generated.
|
|
144
|
+
Setting to a number will return the log probabilities of the top n
|
|
145
|
+
tokens that were generated.
|
|
146
|
+
*/
|
|
147
|
+
logprobs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
126
148
|
}, "strip", z.ZodTypeAny, {
|
|
127
149
|
user?: string | undefined;
|
|
128
150
|
logitBias?: Record<string, number> | undefined;
|
|
151
|
+
logprobs?: number | boolean | undefined;
|
|
129
152
|
echo?: boolean | undefined;
|
|
130
153
|
suffix?: string | undefined;
|
|
131
154
|
}, {
|
|
132
155
|
user?: string | undefined;
|
|
133
156
|
logitBias?: Record<string, number> | undefined;
|
|
157
|
+
logprobs?: number | boolean | undefined;
|
|
134
158
|
echo?: boolean | undefined;
|
|
135
159
|
suffix?: string | undefined;
|
|
136
160
|
}>;
|
|
@@ -234,37 +258,37 @@ declare const openAITranscriptionProviderOptions: z.ZodObject<{
|
|
|
234
258
|
/**
|
|
235
259
|
* Additional information to include in the transcription response.
|
|
236
260
|
*/
|
|
237
|
-
include: z.ZodOptional<z.
|
|
261
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
238
262
|
/**
|
|
239
263
|
* The language of the input audio in ISO-639-1 format.
|
|
240
264
|
*/
|
|
241
|
-
language: z.ZodOptional<z.
|
|
265
|
+
language: z.ZodOptional<z.ZodString>;
|
|
242
266
|
/**
|
|
243
267
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
244
268
|
*/
|
|
245
|
-
prompt: z.ZodOptional<z.
|
|
269
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
246
270
|
/**
|
|
247
271
|
* The sampling temperature, between 0 and 1.
|
|
248
272
|
* @default 0
|
|
249
273
|
*/
|
|
250
|
-
temperature: z.ZodOptional<z.
|
|
274
|
+
temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
251
275
|
/**
|
|
252
276
|
* The timestamp granularities to populate for this transcription.
|
|
253
277
|
* @default ['segment']
|
|
254
278
|
*/
|
|
255
|
-
timestampGranularities: z.ZodOptional<z.
|
|
279
|
+
timestampGranularities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["word", "segment"]>, "many">>>;
|
|
256
280
|
}, "strip", z.ZodTypeAny, {
|
|
257
|
-
prompt?: string |
|
|
258
|
-
temperature?: number |
|
|
259
|
-
include?: string[] |
|
|
260
|
-
language?: string |
|
|
261
|
-
timestampGranularities?: ("word" | "segment")[] |
|
|
281
|
+
prompt?: string | undefined;
|
|
282
|
+
temperature?: number | undefined;
|
|
283
|
+
include?: string[] | undefined;
|
|
284
|
+
language?: string | undefined;
|
|
285
|
+
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
262
286
|
}, {
|
|
263
|
-
prompt?: string |
|
|
264
|
-
temperature?: number |
|
|
265
|
-
include?: string[] |
|
|
266
|
-
language?: string |
|
|
267
|
-
timestampGranularities?: ("word" | "segment")[] |
|
|
287
|
+
prompt?: string | undefined;
|
|
288
|
+
temperature?: number | undefined;
|
|
289
|
+
include?: string[] | undefined;
|
|
290
|
+
language?: string | undefined;
|
|
291
|
+
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
268
292
|
}>;
|
|
269
293
|
type OpenAITranscriptionProviderOptions = z.infer<typeof openAITranscriptionProviderOptions>;
|
|
270
294
|
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -11,6 +11,16 @@ declare const openaiProviderOptions: z.ZodObject<{
|
|
|
11
11
|
* the GPT tokenizer) to an associated bias value from -100 to 100.
|
|
12
12
|
*/
|
|
13
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]>>;
|
|
14
24
|
/**
|
|
15
25
|
* Whether to enable parallel function calling during tool use. Default to true.
|
|
16
26
|
*/
|
|
@@ -49,6 +59,7 @@ declare const openaiProviderOptions: z.ZodObject<{
|
|
|
49
59
|
}, "strip", z.ZodTypeAny, {
|
|
50
60
|
user?: string | undefined;
|
|
51
61
|
logitBias?: Record<number, number> | undefined;
|
|
62
|
+
logprobs?: number | boolean | undefined;
|
|
52
63
|
parallelToolCalls?: boolean | undefined;
|
|
53
64
|
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
54
65
|
maxCompletionTokens?: number | undefined;
|
|
@@ -59,6 +70,7 @@ declare const openaiProviderOptions: z.ZodObject<{
|
|
|
59
70
|
}, {
|
|
60
71
|
user?: string | undefined;
|
|
61
72
|
logitBias?: Record<number, number> | undefined;
|
|
73
|
+
logprobs?: number | boolean | undefined;
|
|
62
74
|
parallelToolCalls?: boolean | undefined;
|
|
63
75
|
reasoningEffort?: "low" | "medium" | "high" | undefined;
|
|
64
76
|
maxCompletionTokens?: number | undefined;
|
|
@@ -123,14 +135,26 @@ declare const openaiCompletionProviderOptions: z.ZodObject<{
|
|
|
123
135
|
monitor and detect abuse. Learn more.
|
|
124
136
|
*/
|
|
125
137
|
user: z.ZodOptional<z.ZodString>;
|
|
138
|
+
/**
|
|
139
|
+
Return the log probabilities of the tokens. Including logprobs will increase
|
|
140
|
+
the response size and can slow down response times. However, it can
|
|
141
|
+
be useful to better understand how the model is behaving.
|
|
142
|
+
Setting to true will return the log probabilities of the tokens that
|
|
143
|
+
were generated.
|
|
144
|
+
Setting to a number will return the log probabilities of the top n
|
|
145
|
+
tokens that were generated.
|
|
146
|
+
*/
|
|
147
|
+
logprobs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
126
148
|
}, "strip", z.ZodTypeAny, {
|
|
127
149
|
user?: string | undefined;
|
|
128
150
|
logitBias?: Record<string, number> | undefined;
|
|
151
|
+
logprobs?: number | boolean | undefined;
|
|
129
152
|
echo?: boolean | undefined;
|
|
130
153
|
suffix?: string | undefined;
|
|
131
154
|
}, {
|
|
132
155
|
user?: string | undefined;
|
|
133
156
|
logitBias?: Record<string, number> | undefined;
|
|
157
|
+
logprobs?: number | boolean | undefined;
|
|
134
158
|
echo?: boolean | undefined;
|
|
135
159
|
suffix?: string | undefined;
|
|
136
160
|
}>;
|
|
@@ -234,37 +258,37 @@ declare const openAITranscriptionProviderOptions: z.ZodObject<{
|
|
|
234
258
|
/**
|
|
235
259
|
* Additional information to include in the transcription response.
|
|
236
260
|
*/
|
|
237
|
-
include: z.ZodOptional<z.
|
|
261
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
238
262
|
/**
|
|
239
263
|
* The language of the input audio in ISO-639-1 format.
|
|
240
264
|
*/
|
|
241
|
-
language: z.ZodOptional<z.
|
|
265
|
+
language: z.ZodOptional<z.ZodString>;
|
|
242
266
|
/**
|
|
243
267
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
244
268
|
*/
|
|
245
|
-
prompt: z.ZodOptional<z.
|
|
269
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
246
270
|
/**
|
|
247
271
|
* The sampling temperature, between 0 and 1.
|
|
248
272
|
* @default 0
|
|
249
273
|
*/
|
|
250
|
-
temperature: z.ZodOptional<z.
|
|
274
|
+
temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
251
275
|
/**
|
|
252
276
|
* The timestamp granularities to populate for this transcription.
|
|
253
277
|
* @default ['segment']
|
|
254
278
|
*/
|
|
255
|
-
timestampGranularities: z.ZodOptional<z.
|
|
279
|
+
timestampGranularities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["word", "segment"]>, "many">>>;
|
|
256
280
|
}, "strip", z.ZodTypeAny, {
|
|
257
|
-
prompt?: string |
|
|
258
|
-
temperature?: number |
|
|
259
|
-
include?: string[] |
|
|
260
|
-
language?: string |
|
|
261
|
-
timestampGranularities?: ("word" | "segment")[] |
|
|
281
|
+
prompt?: string | undefined;
|
|
282
|
+
temperature?: number | undefined;
|
|
283
|
+
include?: string[] | undefined;
|
|
284
|
+
language?: string | undefined;
|
|
285
|
+
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
262
286
|
}, {
|
|
263
|
-
prompt?: string |
|
|
264
|
-
temperature?: number |
|
|
265
|
-
include?: string[] |
|
|
266
|
-
language?: string |
|
|
267
|
-
timestampGranularities?: ("word" | "segment")[] |
|
|
287
|
+
prompt?: string | undefined;
|
|
288
|
+
temperature?: number | undefined;
|
|
289
|
+
include?: string[] | undefined;
|
|
290
|
+
language?: string | undefined;
|
|
291
|
+
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
268
292
|
}>;
|
|
269
293
|
type OpenAITranscriptionProviderOptions = z.infer<typeof openAITranscriptionProviderOptions>;
|
|
270
294
|
|