@ai-sdk/openai 3.0.0-beta.23 → 3.0.0-beta.25
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 +14 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +669 -679
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +68 -95
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +11 -11
- package/dist/internal/index.d.ts +11 -11
- package/dist/internal/index.js +668 -678
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +67 -94
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3CallOptions, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
|
|
5
5
|
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | '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' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | (string & {});
|
|
6
|
-
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.
|
|
6
|
+
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
7
7
|
logitBias?: Record<number, number> | undefined;
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
9
9
|
parallelToolCalls?: boolean | undefined;
|
|
@@ -20,7 +20,7 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidat
|
|
|
20
20
|
promptCacheKey?: string | undefined;
|
|
21
21
|
safetyIdentifier?: string | undefined;
|
|
22
22
|
}>;
|
|
23
|
-
type OpenAIChatLanguageModelOptions =
|
|
23
|
+
type OpenAIChatLanguageModelOptions = InferSchema<typeof openaiChatLanguageModelOptions>;
|
|
24
24
|
|
|
25
25
|
type OpenAIChatConfig = {
|
|
26
26
|
provider: string;
|
|
@@ -46,14 +46,14 @@ declare class OpenAIChatLanguageModel implements LanguageModelV3 {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
|
|
49
|
-
declare const openaiCompletionProviderOptions: _ai_sdk_provider_utils.
|
|
49
|
+
declare const openaiCompletionProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
50
50
|
echo?: boolean | undefined;
|
|
51
51
|
logitBias?: Record<string, number> | undefined;
|
|
52
52
|
suffix?: string | undefined;
|
|
53
53
|
user?: string | undefined;
|
|
54
54
|
logprobs?: number | boolean | undefined;
|
|
55
55
|
}>;
|
|
56
|
-
type OpenAICompletionProviderOptions =
|
|
56
|
+
type OpenAICompletionProviderOptions = InferSchema<typeof openaiCompletionProviderOptions>;
|
|
57
57
|
|
|
58
58
|
type OpenAICompletionConfig = {
|
|
59
59
|
provider: string;
|
|
@@ -98,11 +98,11 @@ type OpenAIConfig = {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002' | (string & {});
|
|
101
|
-
declare const openaiEmbeddingProviderOptions: _ai_sdk_provider_utils.
|
|
101
|
+
declare const openaiEmbeddingProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
102
102
|
dimensions?: number | undefined;
|
|
103
103
|
user?: string | undefined;
|
|
104
104
|
}>;
|
|
105
|
-
type OpenAIEmbeddingProviderOptions =
|
|
105
|
+
type OpenAIEmbeddingProviderOptions = InferSchema<typeof openaiEmbeddingProviderOptions>;
|
|
106
106
|
|
|
107
107
|
declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
|
|
108
108
|
readonly specificationVersion = "v3";
|
|
@@ -135,14 +135,14 @@ declare class OpenAIImageModel implements ImageModelV3 {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
|
|
138
|
-
declare const openAITranscriptionProviderOptions: _ai_sdk_provider_utils.
|
|
138
|
+
declare const openAITranscriptionProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
139
139
|
include?: string[] | undefined;
|
|
140
140
|
language?: string | undefined;
|
|
141
141
|
prompt?: string | undefined;
|
|
142
142
|
temperature?: number | undefined;
|
|
143
143
|
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
144
144
|
}>;
|
|
145
|
-
type OpenAITranscriptionProviderOptions =
|
|
145
|
+
type OpenAITranscriptionProviderOptions = InferSchema<typeof openAITranscriptionProviderOptions>;
|
|
146
146
|
|
|
147
147
|
type OpenAITranscriptionCallOptions = Omit<TranscriptionModelV3CallOptions, 'providerOptions'> & {
|
|
148
148
|
providerOptions?: {
|
|
@@ -165,11 +165,11 @@ declare class OpenAITranscriptionModel implements TranscriptionModelV3 {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
|
|
168
|
-
declare const openaiSpeechProviderOptionsSchema: _ai_sdk_provider_utils.
|
|
168
|
+
declare const openaiSpeechProviderOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
169
169
|
instructions?: string | null | undefined;
|
|
170
170
|
speed?: number | null | undefined;
|
|
171
171
|
}>;
|
|
172
|
-
type OpenAISpeechCallOptions =
|
|
172
|
+
type OpenAISpeechCallOptions = InferSchema<typeof openaiSpeechProviderOptionsSchema>;
|
|
173
173
|
|
|
174
174
|
interface OpenAISpeechModelConfig extends OpenAIConfig {
|
|
175
175
|
_internal?: {
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3CallOptions, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
|
|
5
5
|
type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | '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' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | (string & {});
|
|
6
|
-
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.
|
|
6
|
+
declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
7
7
|
logitBias?: Record<number, number> | undefined;
|
|
8
8
|
logprobs?: number | boolean | undefined;
|
|
9
9
|
parallelToolCalls?: boolean | undefined;
|
|
@@ -20,7 +20,7 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidat
|
|
|
20
20
|
promptCacheKey?: string | undefined;
|
|
21
21
|
safetyIdentifier?: string | undefined;
|
|
22
22
|
}>;
|
|
23
|
-
type OpenAIChatLanguageModelOptions =
|
|
23
|
+
type OpenAIChatLanguageModelOptions = InferSchema<typeof openaiChatLanguageModelOptions>;
|
|
24
24
|
|
|
25
25
|
type OpenAIChatConfig = {
|
|
26
26
|
provider: string;
|
|
@@ -46,14 +46,14 @@ declare class OpenAIChatLanguageModel implements LanguageModelV3 {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
|
|
49
|
-
declare const openaiCompletionProviderOptions: _ai_sdk_provider_utils.
|
|
49
|
+
declare const openaiCompletionProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
50
50
|
echo?: boolean | undefined;
|
|
51
51
|
logitBias?: Record<string, number> | undefined;
|
|
52
52
|
suffix?: string | undefined;
|
|
53
53
|
user?: string | undefined;
|
|
54
54
|
logprobs?: number | boolean | undefined;
|
|
55
55
|
}>;
|
|
56
|
-
type OpenAICompletionProviderOptions =
|
|
56
|
+
type OpenAICompletionProviderOptions = InferSchema<typeof openaiCompletionProviderOptions>;
|
|
57
57
|
|
|
58
58
|
type OpenAICompletionConfig = {
|
|
59
59
|
provider: string;
|
|
@@ -98,11 +98,11 @@ type OpenAIConfig = {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002' | (string & {});
|
|
101
|
-
declare const openaiEmbeddingProviderOptions: _ai_sdk_provider_utils.
|
|
101
|
+
declare const openaiEmbeddingProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
102
102
|
dimensions?: number | undefined;
|
|
103
103
|
user?: string | undefined;
|
|
104
104
|
}>;
|
|
105
|
-
type OpenAIEmbeddingProviderOptions =
|
|
105
|
+
type OpenAIEmbeddingProviderOptions = InferSchema<typeof openaiEmbeddingProviderOptions>;
|
|
106
106
|
|
|
107
107
|
declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
|
|
108
108
|
readonly specificationVersion = "v3";
|
|
@@ -135,14 +135,14 @@ declare class OpenAIImageModel implements ImageModelV3 {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
|
|
138
|
-
declare const openAITranscriptionProviderOptions: _ai_sdk_provider_utils.
|
|
138
|
+
declare const openAITranscriptionProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
139
139
|
include?: string[] | undefined;
|
|
140
140
|
language?: string | undefined;
|
|
141
141
|
prompt?: string | undefined;
|
|
142
142
|
temperature?: number | undefined;
|
|
143
143
|
timestampGranularities?: ("word" | "segment")[] | undefined;
|
|
144
144
|
}>;
|
|
145
|
-
type OpenAITranscriptionProviderOptions =
|
|
145
|
+
type OpenAITranscriptionProviderOptions = InferSchema<typeof openAITranscriptionProviderOptions>;
|
|
146
146
|
|
|
147
147
|
type OpenAITranscriptionCallOptions = Omit<TranscriptionModelV3CallOptions, 'providerOptions'> & {
|
|
148
148
|
providerOptions?: {
|
|
@@ -165,11 +165,11 @@ declare class OpenAITranscriptionModel implements TranscriptionModelV3 {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
|
|
168
|
-
declare const openaiSpeechProviderOptionsSchema: _ai_sdk_provider_utils.
|
|
168
|
+
declare const openaiSpeechProviderOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
169
169
|
instructions?: string | null | undefined;
|
|
170
170
|
speed?: number | null | undefined;
|
|
171
171
|
}>;
|
|
172
|
-
type OpenAISpeechCallOptions =
|
|
172
|
+
type OpenAISpeechCallOptions = InferSchema<typeof openaiSpeechProviderOptionsSchema>;
|
|
173
173
|
|
|
174
174
|
interface OpenAISpeechModelConfig extends OpenAIConfig {
|
|
175
175
|
_internal?: {
|