@core-ai/openai 0.6.1 → 0.7.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.
@@ -161,7 +161,7 @@ function mapOpenAIImageProviderOptionsToRequestFields(options) {
161
161
  }
162
162
 
163
163
  // src/shared/tools.ts
164
- import { zodToJsonSchema } from "zod-to-json-schema";
164
+ import { zodSchemaToJsonSchema } from "@core-ai/core-ai";
165
165
  var DEFAULT_STRUCTURED_OUTPUT_TOOL_NAME = "core_ai_generate_object";
166
166
  var DEFAULT_STRUCTURED_OUTPUT_TOOL_DESCRIPTION = "Return a JSON object that matches the requested schema.";
167
167
  function convertTools(tools) {
@@ -170,7 +170,7 @@ function convertTools(tools) {
170
170
  function: {
171
171
  name: tool.name,
172
172
  description: tool.description,
173
- parameters: zodToJsonSchema(tool.parameters)
173
+ parameters: zodSchemaToJsonSchema(tool.parameters)
174
174
  }
175
175
  }));
176
176
  }
package/dist/compat.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import OpenAI from 'openai';
2
2
  import { ChatModel, EmbeddingModel, ImageModel } from '@core-ai/core-ai';
3
- export { O as OpenAICompatGenerateProviderOptions, a as OpenAICompatRequestOptions, o as openaiCompatGenerateProviderOptionsSchema, b as openaiCompatProviderOptionsSchema } from './provider-options-DK-Tz0pz.js';
3
+ export { O as OpenAICompatGenerateProviderOptions, a as OpenAICompatRequestOptions, o as openaiCompatGenerateProviderOptionsSchema, b as openaiCompatProviderOptionsSchema } from './provider-options-l7CmAA94.js';
4
4
  import 'zod';
5
5
 
6
6
  type OpenAICompatProviderOptions = {
package/dist/compat.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  toOpenAIReasoningEffort,
15
15
  validateOpenAIReasoningConfig,
16
16
  wrapOpenAIError
17
- } from "./chunk-ZHHJ76M7.js";
17
+ } from "./chunk-T4N4CRQS.js";
18
18
 
19
19
  // src/compat/provider.ts
20
20
  import OpenAI from "openai";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import OpenAI from 'openai';
2
2
  import { ChatModel, EmbeddingModel, ImageModel } from '@core-ai/core-ai';
3
- export { O as OpenAICompatGenerateProviderOptions, a as OpenAICompatRequestOptions, c as OpenAIEmbedProviderOptions, d as OpenAIImageProviderOptions, e as OpenAIResponsesGenerateProviderOptions, f as OpenAIResponsesProviderOptions, o as openaiCompatGenerateProviderOptionsSchema, b as openaiCompatProviderOptionsSchema, g as openaiEmbedProviderOptionsSchema, h as openaiImageProviderOptionsSchema, i as openaiResponsesGenerateProviderOptionsSchema, j as openaiResponsesProviderOptionsSchema } from './provider-options-DK-Tz0pz.js';
3
+ export { O as OpenAICompatGenerateProviderOptions, a as OpenAICompatRequestOptions, c as OpenAIEmbedProviderOptions, d as OpenAIImageProviderOptions, e as OpenAIResponsesGenerateProviderOptions, f as OpenAIResponsesProviderOptions, o as openaiCompatGenerateProviderOptionsSchema, b as openaiCompatProviderOptionsSchema, g as openaiEmbedProviderOptionsSchema, h as openaiImageProviderOptionsSchema, i as openaiResponsesGenerateProviderOptionsSchema, j as openaiResponsesProviderOptionsSchema } from './provider-options-l7CmAA94.js';
4
4
  import 'zod';
5
5
 
6
6
  type OpenAIProviderOptions = {
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  toOpenAIReasoningEffort,
19
19
  validateOpenAIReasoningConfig,
20
20
  wrapOpenAIError
21
- } from "./chunk-ZHHJ76M7.js";
21
+ } from "./chunk-T4N4CRQS.js";
22
22
 
23
23
  // src/provider.ts
24
24
  import OpenAI from "openai";
@@ -0,0 +1,120 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const openaiResponsesGenerateProviderOptionsSchema: z.ZodObject<{
4
+ store: z.ZodOptional<z.ZodBoolean>;
5
+ serviceTier: z.ZodOptional<z.ZodEnum<{
6
+ auto: "auto";
7
+ default: "default";
8
+ flex: "flex";
9
+ scale: "scale";
10
+ priority: "priority";
11
+ }>>;
12
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
+ parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
14
+ user: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strict>;
16
+ type OpenAIResponsesGenerateProviderOptions = z.infer<typeof openaiResponsesGenerateProviderOptionsSchema>;
17
+ declare const openaiCompatGenerateProviderOptionsSchema: z.ZodObject<{
18
+ store: z.ZodOptional<z.ZodBoolean>;
19
+ serviceTier: z.ZodOptional<z.ZodEnum<{
20
+ auto: "auto";
21
+ default: "default";
22
+ flex: "flex";
23
+ scale: "scale";
24
+ priority: "priority";
25
+ }>>;
26
+ parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
27
+ user: z.ZodOptional<z.ZodString>;
28
+ stopSequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
30
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
31
+ seed: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strict>;
33
+ type OpenAICompatGenerateProviderOptions = z.infer<typeof openaiCompatGenerateProviderOptionsSchema>;
34
+ declare const openaiEmbedProviderOptionsSchema: z.ZodObject<{
35
+ encodingFormat: z.ZodOptional<z.ZodEnum<{
36
+ float: "float";
37
+ base64: "base64";
38
+ }>>;
39
+ user: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strict>;
41
+ type OpenAIEmbedProviderOptions = z.infer<typeof openaiEmbedProviderOptionsSchema>;
42
+ declare const openaiImageProviderOptionsSchema: z.ZodObject<{
43
+ background: z.ZodOptional<z.ZodEnum<{
44
+ auto: "auto";
45
+ transparent: "transparent";
46
+ opaque: "opaque";
47
+ }>>;
48
+ moderation: z.ZodOptional<z.ZodEnum<{
49
+ low: "low";
50
+ auto: "auto";
51
+ }>>;
52
+ outputCompression: z.ZodOptional<z.ZodNumber>;
53
+ outputFormat: z.ZodOptional<z.ZodEnum<{
54
+ png: "png";
55
+ jpeg: "jpeg";
56
+ webp: "webp";
57
+ }>>;
58
+ quality: z.ZodOptional<z.ZodEnum<{
59
+ low: "low";
60
+ medium: "medium";
61
+ high: "high";
62
+ auto: "auto";
63
+ standard: "standard";
64
+ hd: "hd";
65
+ }>>;
66
+ responseFormat: z.ZodOptional<z.ZodEnum<{
67
+ url: "url";
68
+ b64_json: "b64_json";
69
+ }>>;
70
+ style: z.ZodOptional<z.ZodEnum<{
71
+ vivid: "vivid";
72
+ natural: "natural";
73
+ }>>;
74
+ user: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strict>;
76
+ type OpenAIImageProviderOptions = z.infer<typeof openaiImageProviderOptionsSchema>;
77
+ declare module '@core-ai/core-ai' {
78
+ interface GenerateProviderOptions {
79
+ openai?: OpenAIResponsesGenerateProviderOptions | OpenAICompatGenerateProviderOptions;
80
+ }
81
+ interface EmbedProviderOptions {
82
+ openai?: OpenAIEmbedProviderOptions;
83
+ }
84
+ interface ImageProviderOptions {
85
+ openai?: OpenAIImageProviderOptions;
86
+ }
87
+ }
88
+ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
89
+ store: z.ZodOptional<z.ZodBoolean>;
90
+ serviceTier: z.ZodOptional<z.ZodEnum<{
91
+ auto: "auto";
92
+ default: "default";
93
+ flex: "flex";
94
+ scale: "scale";
95
+ priority: "priority";
96
+ }>>;
97
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
99
+ user: z.ZodOptional<z.ZodString>;
100
+ }, z.core.$strict>;
101
+ type OpenAIResponsesProviderOptions = OpenAIResponsesGenerateProviderOptions;
102
+ declare const openaiCompatProviderOptionsSchema: z.ZodObject<{
103
+ store: z.ZodOptional<z.ZodBoolean>;
104
+ serviceTier: z.ZodOptional<z.ZodEnum<{
105
+ auto: "auto";
106
+ default: "default";
107
+ flex: "flex";
108
+ scale: "scale";
109
+ priority: "priority";
110
+ }>>;
111
+ parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
112
+ user: z.ZodOptional<z.ZodString>;
113
+ stopSequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
115
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
116
+ seed: z.ZodOptional<z.ZodNumber>;
117
+ }, z.core.$strict>;
118
+ type OpenAICompatRequestOptions = OpenAICompatGenerateProviderOptions;
119
+
120
+ 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.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "OpenAI provider package for @core-ai/core-ai",
5
5
  "license": "MIT",
6
6
  "author": "Omnifact (https://omnifact.ai)",
@@ -46,12 +46,11 @@
46
46
  "test:watch": "vitest"
47
47
  },
48
48
  "dependencies": {
49
- "@core-ai/core-ai": "^0.6.1",
50
- "openai": "^6.1.0",
51
- "zod-to-json-schema": "^3.25.1"
49
+ "@core-ai/core-ai": "^0.7.0",
50
+ "openai": "^6.1.0"
52
51
  },
53
52
  "peerDependencies": {
54
- "zod": "^3.25.0 || ^4.0.0"
53
+ "zod": "^4.0.0"
55
54
  },
56
55
  "devDependencies": {
57
56
  "@core-ai/eslint-config": "*",
@@ -1,157 +0,0 @@
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 };