@core-ai/openai 0.5.1 → 0.6.0
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/README.md +21 -0
- package/dist/chunk-7CU5JW63.js +402 -0
- package/dist/compat.d.ts +18 -0
- package/dist/compat.js +612 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +474 -520
- package/dist/provider-options-DK-Tz0pz.d.ts +157 -0
- package/package.json +9 -4
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const openaiResponsesGenerateProviderOptionsSchema: z.ZodObject<{
|
|
4
|
+
store: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
serviceTier: z.ZodOptional<z.ZodEnum<["auto", "default", "flex", "scale", "priority"]>>;
|
|
6
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
user: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strict", z.ZodTypeAny, {
|
|
10
|
+
store?: boolean | undefined;
|
|
11
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
12
|
+
include?: string[] | undefined;
|
|
13
|
+
parallelToolCalls?: boolean | undefined;
|
|
14
|
+
user?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
store?: boolean | undefined;
|
|
17
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
18
|
+
include?: string[] | undefined;
|
|
19
|
+
parallelToolCalls?: boolean | undefined;
|
|
20
|
+
user?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
type OpenAIResponsesGenerateProviderOptions = z.infer<typeof openaiResponsesGenerateProviderOptionsSchema>;
|
|
23
|
+
declare const openaiCompatGenerateProviderOptionsSchema: z.ZodObject<Omit<{
|
|
24
|
+
store: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
serviceTier: z.ZodOptional<z.ZodEnum<["auto", "default", "flex", "scale", "priority"]>>;
|
|
26
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
27
|
+
parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
user: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, "include"> & {
|
|
30
|
+
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, "strict", z.ZodTypeAny, {
|
|
35
|
+
store?: boolean | undefined;
|
|
36
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
37
|
+
parallelToolCalls?: boolean | undefined;
|
|
38
|
+
user?: string | undefined;
|
|
39
|
+
stopSequences?: string[] | undefined;
|
|
40
|
+
frequencyPenalty?: number | undefined;
|
|
41
|
+
presencePenalty?: number | undefined;
|
|
42
|
+
seed?: number | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
store?: boolean | undefined;
|
|
45
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
46
|
+
parallelToolCalls?: boolean | undefined;
|
|
47
|
+
user?: string | undefined;
|
|
48
|
+
stopSequences?: string[] | undefined;
|
|
49
|
+
frequencyPenalty?: number | undefined;
|
|
50
|
+
presencePenalty?: number | undefined;
|
|
51
|
+
seed?: number | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
type OpenAICompatGenerateProviderOptions = z.infer<typeof openaiCompatGenerateProviderOptionsSchema>;
|
|
54
|
+
declare const openaiEmbedProviderOptionsSchema: z.ZodObject<{
|
|
55
|
+
encodingFormat: z.ZodOptional<z.ZodEnum<["float", "base64"]>>;
|
|
56
|
+
user: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, "strict", z.ZodTypeAny, {
|
|
58
|
+
user?: string | undefined;
|
|
59
|
+
encodingFormat?: "float" | "base64" | undefined;
|
|
60
|
+
}, {
|
|
61
|
+
user?: string | undefined;
|
|
62
|
+
encodingFormat?: "float" | "base64" | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
type OpenAIEmbedProviderOptions = z.infer<typeof openaiEmbedProviderOptionsSchema>;
|
|
65
|
+
declare const openaiImageProviderOptionsSchema: z.ZodObject<{
|
|
66
|
+
background: z.ZodOptional<z.ZodEnum<["transparent", "opaque", "auto"]>>;
|
|
67
|
+
moderation: z.ZodOptional<z.ZodEnum<["low", "auto"]>>;
|
|
68
|
+
outputCompression: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
outputFormat: z.ZodOptional<z.ZodEnum<["png", "jpeg", "webp"]>>;
|
|
70
|
+
quality: z.ZodOptional<z.ZodEnum<["standard", "hd", "low", "medium", "high", "auto"]>>;
|
|
71
|
+
responseFormat: z.ZodOptional<z.ZodEnum<["url", "b64_json"]>>;
|
|
72
|
+
style: z.ZodOptional<z.ZodEnum<["vivid", "natural"]>>;
|
|
73
|
+
user: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, "strict", z.ZodTypeAny, {
|
|
75
|
+
user?: string | undefined;
|
|
76
|
+
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
77
|
+
moderation?: "low" | "auto" | undefined;
|
|
78
|
+
outputCompression?: number | undefined;
|
|
79
|
+
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
80
|
+
quality?: "low" | "medium" | "high" | "auto" | "standard" | "hd" | undefined;
|
|
81
|
+
responseFormat?: "url" | "b64_json" | undefined;
|
|
82
|
+
style?: "vivid" | "natural" | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
user?: string | undefined;
|
|
85
|
+
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
86
|
+
moderation?: "low" | "auto" | undefined;
|
|
87
|
+
outputCompression?: number | undefined;
|
|
88
|
+
outputFormat?: "png" | "jpeg" | "webp" | undefined;
|
|
89
|
+
quality?: "low" | "medium" | "high" | "auto" | "standard" | "hd" | undefined;
|
|
90
|
+
responseFormat?: "url" | "b64_json" | undefined;
|
|
91
|
+
style?: "vivid" | "natural" | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
type OpenAIImageProviderOptions = z.infer<typeof openaiImageProviderOptionsSchema>;
|
|
94
|
+
declare module '@core-ai/core-ai' {
|
|
95
|
+
interface GenerateProviderOptions {
|
|
96
|
+
openai?: OpenAIResponsesGenerateProviderOptions | OpenAICompatGenerateProviderOptions;
|
|
97
|
+
}
|
|
98
|
+
interface EmbedProviderOptions {
|
|
99
|
+
openai?: OpenAIEmbedProviderOptions;
|
|
100
|
+
}
|
|
101
|
+
interface ImageProviderOptions {
|
|
102
|
+
openai?: OpenAIImageProviderOptions;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
106
|
+
store: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
serviceTier: z.ZodOptional<z.ZodEnum<["auto", "default", "flex", "scale", "priority"]>>;
|
|
108
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
109
|
+
parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
user: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, "strict", z.ZodTypeAny, {
|
|
112
|
+
store?: boolean | undefined;
|
|
113
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
114
|
+
include?: string[] | undefined;
|
|
115
|
+
parallelToolCalls?: boolean | undefined;
|
|
116
|
+
user?: string | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
store?: boolean | undefined;
|
|
119
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
120
|
+
include?: string[] | undefined;
|
|
121
|
+
parallelToolCalls?: boolean | undefined;
|
|
122
|
+
user?: string | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
type OpenAIResponsesProviderOptions = OpenAIResponsesGenerateProviderOptions;
|
|
125
|
+
declare const openaiCompatProviderOptionsSchema: z.ZodObject<Omit<{
|
|
126
|
+
store: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
serviceTier: z.ZodOptional<z.ZodEnum<["auto", "default", "flex", "scale", "priority"]>>;
|
|
128
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
129
|
+
parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
user: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, "include"> & {
|
|
132
|
+
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
133
|
+
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
}, "strict", z.ZodTypeAny, {
|
|
137
|
+
store?: boolean | undefined;
|
|
138
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
139
|
+
parallelToolCalls?: boolean | undefined;
|
|
140
|
+
user?: string | undefined;
|
|
141
|
+
stopSequences?: string[] | undefined;
|
|
142
|
+
frequencyPenalty?: number | undefined;
|
|
143
|
+
presencePenalty?: number | undefined;
|
|
144
|
+
seed?: number | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
store?: boolean | undefined;
|
|
147
|
+
serviceTier?: "auto" | "default" | "flex" | "scale" | "priority" | undefined;
|
|
148
|
+
parallelToolCalls?: boolean | undefined;
|
|
149
|
+
user?: string | undefined;
|
|
150
|
+
stopSequences?: string[] | undefined;
|
|
151
|
+
frequencyPenalty?: number | undefined;
|
|
152
|
+
presencePenalty?: number | undefined;
|
|
153
|
+
seed?: number | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
type OpenAICompatRequestOptions = OpenAICompatGenerateProviderOptions;
|
|
156
|
+
|
|
157
|
+
export { type OpenAICompatGenerateProviderOptions as O, type OpenAICompatRequestOptions as a, openaiCompatProviderOptionsSchema as b, type OpenAIEmbedProviderOptions as c, type OpenAIImageProviderOptions as d, type OpenAIResponsesGenerateProviderOptions as e, type OpenAIResponsesProviderOptions as f, openaiEmbedProviderOptionsSchema as g, openaiImageProviderOptionsSchema as h, openaiResponsesGenerateProviderOptionsSchema as i, openaiResponsesProviderOptionsSchema as j, openaiCompatGenerateProviderOptionsSchema as o };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@core-ai/openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "OpenAI provider package for @core-ai/core-ai",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Omnifact (https://omnifact.ai)",
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
25
|
"import": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./compat": {
|
|
28
|
+
"types": "./dist/compat.d.ts",
|
|
29
|
+
"import": "./dist/compat.js"
|
|
26
30
|
}
|
|
27
31
|
},
|
|
28
32
|
"files": [
|
|
@@ -42,7 +46,7 @@
|
|
|
42
46
|
"test:watch": "vitest"
|
|
43
47
|
},
|
|
44
48
|
"dependencies": {
|
|
45
|
-
"@core-ai/core-ai": "^0.
|
|
49
|
+
"@core-ai/core-ai": "^0.6.0",
|
|
46
50
|
"openai": "^6.1.0",
|
|
47
51
|
"zod-to-json-schema": "^3.25.1"
|
|
48
52
|
},
|
|
@@ -50,8 +54,9 @@
|
|
|
50
54
|
"zod": "^3.25.0 || ^4.0.0"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
53
|
-
"@core-ai/eslint-config": "
|
|
54
|
-
"@core-ai/
|
|
57
|
+
"@core-ai/eslint-config": "*",
|
|
58
|
+
"@core-ai/testing": "*",
|
|
59
|
+
"@core-ai/typescript-config": "*",
|
|
55
60
|
"typescript": "^5.7.3",
|
|
56
61
|
"vitest": "^3.2.4"
|
|
57
62
|
}
|