@ai-sdk/openai-compatible 1.0.20 → 1.0.22
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 +13 -0
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +107 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/openai-compatible
|
|
2
2
|
|
|
3
|
+
## 1.0.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f02b7ab: Add textVerbosity provider option support
|
|
8
|
+
|
|
9
|
+
## 1.0.21
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [17f9872]
|
|
14
|
+
- @ai-sdk/provider-utils@3.0.12
|
|
15
|
+
|
|
3
16
|
## 1.0.20
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { SharedV2ProviderMetadata, LanguageModelV2, EmbeddingModelV2, ImageModelV2, ProviderV2 } from '@ai-sdk/provider';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
-
import
|
|
4
|
-
import { ZodType, z as z$1 } from 'zod/v4';
|
|
3
|
+
import { z, ZodType } from 'zod/v4';
|
|
5
4
|
|
|
6
5
|
type OpenAICompatibleChatModelId = string;
|
|
7
6
|
declare const openaiCompatibleProviderOptions: z.ZodObject<{
|
|
8
7
|
user: z.ZodOptional<z.ZodString>;
|
|
9
8
|
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
9
|
+
textVerbosity: z.ZodOptional<z.ZodString>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
type OpenAICompatibleProviderOptions = z.infer<typeof openaiCompatibleProviderOptions>;
|
|
12
12
|
|
|
13
|
-
declare const openaiCompatibleErrorDataSchema: z
|
|
14
|
-
error: z
|
|
15
|
-
message: z
|
|
16
|
-
type: z
|
|
17
|
-
param: z
|
|
18
|
-
code: z
|
|
19
|
-
}, z
|
|
20
|
-
}, z
|
|
21
|
-
type OpenAICompatibleErrorData = z
|
|
13
|
+
declare const openaiCompatibleErrorDataSchema: z.ZodObject<{
|
|
14
|
+
error: z.ZodObject<{
|
|
15
|
+
message: z.ZodString;
|
|
16
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
param: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
18
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
type OpenAICompatibleErrorData = z.infer<typeof openaiCompatibleErrorDataSchema>;
|
|
22
22
|
type ProviderErrorStructure<T> = {
|
|
23
23
|
errorSchema: ZodType<T>;
|
|
24
24
|
errorToMessage: (error: T) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { SharedV2ProviderMetadata, LanguageModelV2, EmbeddingModelV2, ImageModelV2, ProviderV2 } from '@ai-sdk/provider';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
-
import
|
|
4
|
-
import { ZodType, z as z$1 } from 'zod/v4';
|
|
3
|
+
import { z, ZodType } from 'zod/v4';
|
|
5
4
|
|
|
6
5
|
type OpenAICompatibleChatModelId = string;
|
|
7
6
|
declare const openaiCompatibleProviderOptions: z.ZodObject<{
|
|
8
7
|
user: z.ZodOptional<z.ZodString>;
|
|
9
8
|
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
9
|
+
textVerbosity: z.ZodOptional<z.ZodString>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
type OpenAICompatibleProviderOptions = z.infer<typeof openaiCompatibleProviderOptions>;
|
|
12
12
|
|
|
13
|
-
declare const openaiCompatibleErrorDataSchema: z
|
|
14
|
-
error: z
|
|
15
|
-
message: z
|
|
16
|
-
type: z
|
|
17
|
-
param: z
|
|
18
|
-
code: z
|
|
19
|
-
}, z
|
|
20
|
-
}, z
|
|
21
|
-
type OpenAICompatibleErrorData = z
|
|
13
|
+
declare const openaiCompatibleErrorDataSchema: z.ZodObject<{
|
|
14
|
+
error: z.ZodObject<{
|
|
15
|
+
message: z.ZodString;
|
|
16
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
param: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
18
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
type OpenAICompatibleErrorData = z.infer<typeof openaiCompatibleErrorDataSchema>;
|
|
22
22
|
type ProviderErrorStructure<T> = {
|
|
23
23
|
errorSchema: ZodType<T>;
|
|
24
24
|
errorToMessage: (error: T) => string;
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
@@ -42,7 +32,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
42
32
|
// src/chat/openai-compatible-chat-language-model.ts
|
|
43
33
|
var import_provider3 = require("@ai-sdk/provider");
|
|
44
34
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
45
|
-
var
|
|
35
|
+
var import_v43 = require("zod/v4");
|
|
46
36
|
|
|
47
37
|
// src/chat/convert-to-openai-compatible-chat-messages.ts
|
|
48
38
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -196,30 +186,34 @@ function mapOpenAICompatibleFinishReason(finishReason) {
|
|
|
196
186
|
}
|
|
197
187
|
|
|
198
188
|
// src/chat/openai-compatible-chat-options.ts
|
|
199
|
-
var
|
|
200
|
-
var openaiCompatibleProviderOptions = z.object({
|
|
189
|
+
var import_v4 = require("zod/v4");
|
|
190
|
+
var openaiCompatibleProviderOptions = import_v4.z.object({
|
|
201
191
|
/**
|
|
202
192
|
* A unique identifier representing your end-user, which can help the provider to
|
|
203
193
|
* monitor and detect abuse.
|
|
204
194
|
*/
|
|
205
|
-
user: z.string().optional(),
|
|
195
|
+
user: import_v4.z.string().optional(),
|
|
206
196
|
/**
|
|
207
197
|
* Reasoning effort for reasoning models. Defaults to `medium`.
|
|
208
198
|
*/
|
|
209
|
-
reasoningEffort: z.string().optional()
|
|
199
|
+
reasoningEffort: import_v4.z.string().optional(),
|
|
200
|
+
/**
|
|
201
|
+
* Controls the verbosity of the generated text. Defaults to `medium`.
|
|
202
|
+
*/
|
|
203
|
+
textVerbosity: import_v4.z.string().optional()
|
|
210
204
|
});
|
|
211
205
|
|
|
212
206
|
// src/openai-compatible-error.ts
|
|
213
|
-
var
|
|
214
|
-
var openaiCompatibleErrorDataSchema =
|
|
215
|
-
error:
|
|
216
|
-
message:
|
|
207
|
+
var import_v42 = require("zod/v4");
|
|
208
|
+
var openaiCompatibleErrorDataSchema = import_v42.z.object({
|
|
209
|
+
error: import_v42.z.object({
|
|
210
|
+
message: import_v42.z.string(),
|
|
217
211
|
// The additional information below is handled loosely to support
|
|
218
212
|
// OpenAI-compatible providers that have slightly different error
|
|
219
213
|
// responses:
|
|
220
|
-
type:
|
|
221
|
-
param:
|
|
222
|
-
code:
|
|
214
|
+
type: import_v42.z.string().nullish(),
|
|
215
|
+
param: import_v42.z.any().nullish(),
|
|
216
|
+
code: import_v42.z.union([import_v42.z.string(), import_v42.z.number()]).nullish()
|
|
223
217
|
})
|
|
224
218
|
});
|
|
225
219
|
var defaultOpenAICompatibleErrorStructure = {
|
|
@@ -382,6 +376,7 @@ var OpenAICompatibleChatLanguageModel = class {
|
|
|
382
376
|
)
|
|
383
377
|
),
|
|
384
378
|
reasoning_effort: compatibleOptions.reasoningEffort,
|
|
379
|
+
verbosity: compatibleOptions.textVerbosity,
|
|
385
380
|
// messages:
|
|
386
381
|
messages: convertToOpenAICompatibleChatMessages(prompt),
|
|
387
382
|
// tools:
|
|
@@ -738,71 +733,71 @@ var OpenAICompatibleChatLanguageModel = class {
|
|
|
738
733
|
};
|
|
739
734
|
}
|
|
740
735
|
};
|
|
741
|
-
var openaiCompatibleTokenUsageSchema =
|
|
742
|
-
prompt_tokens:
|
|
743
|
-
completion_tokens:
|
|
744
|
-
total_tokens:
|
|
745
|
-
prompt_tokens_details:
|
|
746
|
-
cached_tokens:
|
|
736
|
+
var openaiCompatibleTokenUsageSchema = import_v43.z.object({
|
|
737
|
+
prompt_tokens: import_v43.z.number().nullish(),
|
|
738
|
+
completion_tokens: import_v43.z.number().nullish(),
|
|
739
|
+
total_tokens: import_v43.z.number().nullish(),
|
|
740
|
+
prompt_tokens_details: import_v43.z.object({
|
|
741
|
+
cached_tokens: import_v43.z.number().nullish()
|
|
747
742
|
}).nullish(),
|
|
748
|
-
completion_tokens_details:
|
|
749
|
-
reasoning_tokens:
|
|
750
|
-
accepted_prediction_tokens:
|
|
751
|
-
rejected_prediction_tokens:
|
|
743
|
+
completion_tokens_details: import_v43.z.object({
|
|
744
|
+
reasoning_tokens: import_v43.z.number().nullish(),
|
|
745
|
+
accepted_prediction_tokens: import_v43.z.number().nullish(),
|
|
746
|
+
rejected_prediction_tokens: import_v43.z.number().nullish()
|
|
752
747
|
}).nullish()
|
|
753
748
|
}).nullish();
|
|
754
|
-
var OpenAICompatibleChatResponseSchema =
|
|
755
|
-
id:
|
|
756
|
-
created:
|
|
757
|
-
model:
|
|
758
|
-
choices:
|
|
759
|
-
|
|
760
|
-
message:
|
|
761
|
-
role:
|
|
762
|
-
content:
|
|
763
|
-
reasoning_content:
|
|
764
|
-
reasoning:
|
|
765
|
-
tool_calls:
|
|
766
|
-
|
|
767
|
-
id:
|
|
768
|
-
function:
|
|
769
|
-
name:
|
|
770
|
-
arguments:
|
|
749
|
+
var OpenAICompatibleChatResponseSchema = import_v43.z.object({
|
|
750
|
+
id: import_v43.z.string().nullish(),
|
|
751
|
+
created: import_v43.z.number().nullish(),
|
|
752
|
+
model: import_v43.z.string().nullish(),
|
|
753
|
+
choices: import_v43.z.array(
|
|
754
|
+
import_v43.z.object({
|
|
755
|
+
message: import_v43.z.object({
|
|
756
|
+
role: import_v43.z.literal("assistant").nullish(),
|
|
757
|
+
content: import_v43.z.string().nullish(),
|
|
758
|
+
reasoning_content: import_v43.z.string().nullish(),
|
|
759
|
+
reasoning: import_v43.z.string().nullish(),
|
|
760
|
+
tool_calls: import_v43.z.array(
|
|
761
|
+
import_v43.z.object({
|
|
762
|
+
id: import_v43.z.string().nullish(),
|
|
763
|
+
function: import_v43.z.object({
|
|
764
|
+
name: import_v43.z.string(),
|
|
765
|
+
arguments: import_v43.z.string()
|
|
771
766
|
})
|
|
772
767
|
})
|
|
773
768
|
).nullish()
|
|
774
769
|
}),
|
|
775
|
-
finish_reason:
|
|
770
|
+
finish_reason: import_v43.z.string().nullish()
|
|
776
771
|
})
|
|
777
772
|
),
|
|
778
773
|
usage: openaiCompatibleTokenUsageSchema
|
|
779
774
|
});
|
|
780
|
-
var createOpenAICompatibleChatChunkSchema = (errorSchema) =>
|
|
781
|
-
|
|
782
|
-
id:
|
|
783
|
-
created:
|
|
784
|
-
model:
|
|
785
|
-
choices:
|
|
786
|
-
|
|
787
|
-
delta:
|
|
788
|
-
role:
|
|
789
|
-
content:
|
|
775
|
+
var createOpenAICompatibleChatChunkSchema = (errorSchema) => import_v43.z.union([
|
|
776
|
+
import_v43.z.object({
|
|
777
|
+
id: import_v43.z.string().nullish(),
|
|
778
|
+
created: import_v43.z.number().nullish(),
|
|
779
|
+
model: import_v43.z.string().nullish(),
|
|
780
|
+
choices: import_v43.z.array(
|
|
781
|
+
import_v43.z.object({
|
|
782
|
+
delta: import_v43.z.object({
|
|
783
|
+
role: import_v43.z.enum(["assistant"]).nullish(),
|
|
784
|
+
content: import_v43.z.string().nullish(),
|
|
790
785
|
// Most openai-compatible models set `reasoning_content`, but some
|
|
791
786
|
// providers serving `gpt-oss` set `reasoning`. See #7866
|
|
792
|
-
reasoning_content:
|
|
793
|
-
reasoning:
|
|
794
|
-
tool_calls:
|
|
795
|
-
|
|
796
|
-
index:
|
|
797
|
-
id:
|
|
798
|
-
function:
|
|
799
|
-
name:
|
|
800
|
-
arguments:
|
|
787
|
+
reasoning_content: import_v43.z.string().nullish(),
|
|
788
|
+
reasoning: import_v43.z.string().nullish(),
|
|
789
|
+
tool_calls: import_v43.z.array(
|
|
790
|
+
import_v43.z.object({
|
|
791
|
+
index: import_v43.z.number(),
|
|
792
|
+
id: import_v43.z.string().nullish(),
|
|
793
|
+
function: import_v43.z.object({
|
|
794
|
+
name: import_v43.z.string().nullish(),
|
|
795
|
+
arguments: import_v43.z.string().nullish()
|
|
801
796
|
})
|
|
802
797
|
})
|
|
803
798
|
).nullish()
|
|
804
799
|
}).nullish(),
|
|
805
|
-
finish_reason:
|
|
800
|
+
finish_reason: import_v43.z.string().nullish()
|
|
806
801
|
})
|
|
807
802
|
),
|
|
808
803
|
usage: openaiCompatibleTokenUsageSchema
|
|
@@ -812,7 +807,7 @@ var createOpenAICompatibleChatChunkSchema = (errorSchema) => z3.union([
|
|
|
812
807
|
|
|
813
808
|
// src/completion/openai-compatible-completion-language-model.ts
|
|
814
809
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
815
|
-
var
|
|
810
|
+
var import_v45 = require("zod/v4");
|
|
816
811
|
|
|
817
812
|
// src/completion/convert-to-openai-compatible-completion-prompt.ts
|
|
818
813
|
var import_provider4 = require("@ai-sdk/provider");
|
|
@@ -920,28 +915,28 @@ function mapOpenAICompatibleFinishReason2(finishReason) {
|
|
|
920
915
|
}
|
|
921
916
|
|
|
922
917
|
// src/completion/openai-compatible-completion-options.ts
|
|
923
|
-
var
|
|
924
|
-
var openaiCompatibleCompletionProviderOptions =
|
|
918
|
+
var import_v44 = require("zod/v4");
|
|
919
|
+
var openaiCompatibleCompletionProviderOptions = import_v44.z.object({
|
|
925
920
|
/**
|
|
926
921
|
* Echo back the prompt in addition to the completion.
|
|
927
922
|
*/
|
|
928
|
-
echo:
|
|
923
|
+
echo: import_v44.z.boolean().optional(),
|
|
929
924
|
/**
|
|
930
925
|
* Modify the likelihood of specified tokens appearing in the completion.
|
|
931
926
|
*
|
|
932
927
|
* Accepts a JSON object that maps tokens (specified by their token ID in
|
|
933
928
|
* the GPT tokenizer) to an associated bias value from -100 to 100.
|
|
934
929
|
*/
|
|
935
|
-
logitBias:
|
|
930
|
+
logitBias: import_v44.z.record(import_v44.z.string(), import_v44.z.number()).optional(),
|
|
936
931
|
/**
|
|
937
932
|
* The suffix that comes after a completion of inserted text.
|
|
938
933
|
*/
|
|
939
|
-
suffix:
|
|
934
|
+
suffix: import_v44.z.string().optional(),
|
|
940
935
|
/**
|
|
941
936
|
* A unique identifier representing your end-user, which can help providers to
|
|
942
937
|
* monitor and detect abuse.
|
|
943
938
|
*/
|
|
944
|
-
user:
|
|
939
|
+
user: import_v44.z.string().optional()
|
|
945
940
|
});
|
|
946
941
|
|
|
947
942
|
// src/completion/openai-compatible-completion-language-model.ts
|
|
@@ -1174,33 +1169,33 @@ var OpenAICompatibleCompletionLanguageModel = class {
|
|
|
1174
1169
|
};
|
|
1175
1170
|
}
|
|
1176
1171
|
};
|
|
1177
|
-
var usageSchema =
|
|
1178
|
-
prompt_tokens:
|
|
1179
|
-
completion_tokens:
|
|
1180
|
-
total_tokens:
|
|
1172
|
+
var usageSchema = import_v45.z.object({
|
|
1173
|
+
prompt_tokens: import_v45.z.number(),
|
|
1174
|
+
completion_tokens: import_v45.z.number(),
|
|
1175
|
+
total_tokens: import_v45.z.number()
|
|
1181
1176
|
});
|
|
1182
|
-
var openaiCompatibleCompletionResponseSchema =
|
|
1183
|
-
id:
|
|
1184
|
-
created:
|
|
1185
|
-
model:
|
|
1186
|
-
choices:
|
|
1187
|
-
|
|
1188
|
-
text:
|
|
1189
|
-
finish_reason:
|
|
1177
|
+
var openaiCompatibleCompletionResponseSchema = import_v45.z.object({
|
|
1178
|
+
id: import_v45.z.string().nullish(),
|
|
1179
|
+
created: import_v45.z.number().nullish(),
|
|
1180
|
+
model: import_v45.z.string().nullish(),
|
|
1181
|
+
choices: import_v45.z.array(
|
|
1182
|
+
import_v45.z.object({
|
|
1183
|
+
text: import_v45.z.string(),
|
|
1184
|
+
finish_reason: import_v45.z.string()
|
|
1190
1185
|
})
|
|
1191
1186
|
),
|
|
1192
1187
|
usage: usageSchema.nullish()
|
|
1193
1188
|
});
|
|
1194
|
-
var createOpenAICompatibleCompletionChunkSchema = (errorSchema) =>
|
|
1195
|
-
|
|
1196
|
-
id:
|
|
1197
|
-
created:
|
|
1198
|
-
model:
|
|
1199
|
-
choices:
|
|
1200
|
-
|
|
1201
|
-
text:
|
|
1202
|
-
finish_reason:
|
|
1203
|
-
index:
|
|
1189
|
+
var createOpenAICompatibleCompletionChunkSchema = (errorSchema) => import_v45.z.union([
|
|
1190
|
+
import_v45.z.object({
|
|
1191
|
+
id: import_v45.z.string().nullish(),
|
|
1192
|
+
created: import_v45.z.number().nullish(),
|
|
1193
|
+
model: import_v45.z.string().nullish(),
|
|
1194
|
+
choices: import_v45.z.array(
|
|
1195
|
+
import_v45.z.object({
|
|
1196
|
+
text: import_v45.z.string(),
|
|
1197
|
+
finish_reason: import_v45.z.string().nullish(),
|
|
1198
|
+
index: import_v45.z.number()
|
|
1204
1199
|
})
|
|
1205
1200
|
),
|
|
1206
1201
|
usage: usageSchema.nullish()
|
|
@@ -1211,21 +1206,21 @@ var createOpenAICompatibleCompletionChunkSchema = (errorSchema) => z5.union([
|
|
|
1211
1206
|
// src/embedding/openai-compatible-embedding-model.ts
|
|
1212
1207
|
var import_provider5 = require("@ai-sdk/provider");
|
|
1213
1208
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
1214
|
-
var
|
|
1209
|
+
var import_v47 = require("zod/v4");
|
|
1215
1210
|
|
|
1216
1211
|
// src/embedding/openai-compatible-embedding-options.ts
|
|
1217
|
-
var
|
|
1218
|
-
var openaiCompatibleEmbeddingProviderOptions =
|
|
1212
|
+
var import_v46 = require("zod/v4");
|
|
1213
|
+
var openaiCompatibleEmbeddingProviderOptions = import_v46.z.object({
|
|
1219
1214
|
/**
|
|
1220
1215
|
* The number of dimensions the resulting output embeddings should have.
|
|
1221
1216
|
* Only supported in text-embedding-3 and later models.
|
|
1222
1217
|
*/
|
|
1223
|
-
dimensions:
|
|
1218
|
+
dimensions: import_v46.z.number().optional(),
|
|
1224
1219
|
/**
|
|
1225
1220
|
* A unique identifier representing your end-user, which can help providers to
|
|
1226
1221
|
* monitor and detect abuse.
|
|
1227
1222
|
*/
|
|
1228
|
-
user:
|
|
1223
|
+
user: import_v46.z.string().optional()
|
|
1229
1224
|
});
|
|
1230
1225
|
|
|
1231
1226
|
// src/embedding/openai-compatible-embedding-model.ts
|
|
@@ -1310,15 +1305,15 @@ var OpenAICompatibleEmbeddingModel = class {
|
|
|
1310
1305
|
};
|
|
1311
1306
|
}
|
|
1312
1307
|
};
|
|
1313
|
-
var openaiTextEmbeddingResponseSchema =
|
|
1314
|
-
data:
|
|
1315
|
-
usage:
|
|
1316
|
-
providerMetadata:
|
|
1308
|
+
var openaiTextEmbeddingResponseSchema = import_v47.z.object({
|
|
1309
|
+
data: import_v47.z.array(import_v47.z.object({ embedding: import_v47.z.array(import_v47.z.number()) })),
|
|
1310
|
+
usage: import_v47.z.object({ prompt_tokens: import_v47.z.number() }).nullish(),
|
|
1311
|
+
providerMetadata: import_v47.z.record(import_v47.z.string(), import_v47.z.record(import_v47.z.string(), import_v47.z.any())).optional()
|
|
1317
1312
|
});
|
|
1318
1313
|
|
|
1319
1314
|
// src/image/openai-compatible-image-model.ts
|
|
1320
1315
|
var import_provider_utils5 = require("@ai-sdk/provider-utils");
|
|
1321
|
-
var
|
|
1316
|
+
var import_v48 = require("zod/v4");
|
|
1322
1317
|
var OpenAICompatibleImageModel = class {
|
|
1323
1318
|
constructor(modelId, config) {
|
|
1324
1319
|
this.modelId = modelId;
|
|
@@ -1386,15 +1381,15 @@ var OpenAICompatibleImageModel = class {
|
|
|
1386
1381
|
};
|
|
1387
1382
|
}
|
|
1388
1383
|
};
|
|
1389
|
-
var openaiCompatibleImageResponseSchema =
|
|
1390
|
-
data:
|
|
1384
|
+
var openaiCompatibleImageResponseSchema = import_v48.z.object({
|
|
1385
|
+
data: import_v48.z.array(import_v48.z.object({ b64_json: import_v48.z.string() }))
|
|
1391
1386
|
});
|
|
1392
1387
|
|
|
1393
1388
|
// src/openai-compatible-provider.ts
|
|
1394
1389
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
1395
1390
|
|
|
1396
1391
|
// src/version.ts
|
|
1397
|
-
var VERSION = true ? "1.0.
|
|
1392
|
+
var VERSION = true ? "1.0.22" : "0.0.0-test";
|
|
1398
1393
|
|
|
1399
1394
|
// src/openai-compatible-provider.ts
|
|
1400
1395
|
function createOpenAICompatible(options) {
|