@core-ai/openai 0.6.0 → 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
  }
@@ -221,6 +221,20 @@ var DEFAULT_CAPABILITIES = {
221
221
  }
222
222
  };
223
223
  var MODEL_CAPABILITIES = {
224
+ "gpt-5.4": {
225
+ reasoning: {
226
+ supportsEffort: true,
227
+ supportedRange: ["low", "medium", "high", "max"],
228
+ restrictsSamplingParams: true
229
+ }
230
+ },
231
+ "gpt-5.4-pro": {
232
+ reasoning: {
233
+ supportsEffort: true,
234
+ supportedRange: ["low", "medium", "high", "max"],
235
+ restrictsSamplingParams: true
236
+ }
237
+ },
224
238
  "gpt-5.2": {
225
239
  reasoning: {
226
240
  supportsEffort: true,
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-7CU5JW63.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-7CU5JW63.js";
21
+ } from "./chunk-T4N4CRQS.js";
22
22
 
23
23
  // src/provider.ts
24
24
  import OpenAI from "openai";
@@ -242,9 +242,7 @@ function mapGenerateResponse(response) {
242
242
  continue;
243
243
  }
244
244
  if (isOutputMessage(item)) {
245
- for (const part of mapMessageTextParts(item)) {
246
- parts.push(part);
247
- }
245
+ parts.push(...mapMessageTextParts(item));
248
246
  continue;
249
247
  }
250
248
  if (isFunctionToolCall(item)) {
@@ -293,12 +291,16 @@ function mapMessageTextParts(message) {
293
291
  );
294
292
  }
295
293
  function getTextContent(parts) {
296
- const text = parts.flatMap((part) => part.type === "text" ? [part.text] : []).join("");
297
- return text.length > 0 ? text : null;
294
+ return getJoinedPartText(parts, "text");
298
295
  }
299
296
  function getReasoningText(parts) {
300
- const reasoning = parts.flatMap((part) => part.type === "reasoning" ? [part.text] : []).join("");
301
- return reasoning.length > 0 ? reasoning : null;
297
+ return getJoinedPartText(parts, "reasoning");
298
+ }
299
+ function getJoinedPartText(parts, type) {
300
+ const text = parts.flatMap(
301
+ (part) => part.type === type && "text" in part ? [part.text] : []
302
+ ).join("");
303
+ return text.length > 0 ? text : null;
302
304
  }
303
305
  function getToolCalls(parts) {
304
306
  return parts.flatMap(
@@ -335,6 +337,33 @@ function mapUsage(usage) {
335
337
  }
336
338
  };
337
339
  }
340
+ function getReasoningStartTransition(reasoningStarted) {
341
+ if (reasoningStarted) {
342
+ return {
343
+ nextReasoningStarted: true,
344
+ event: null
345
+ };
346
+ }
347
+ return {
348
+ nextReasoningStarted: true,
349
+ event: { type: "reasoning-start" }
350
+ };
351
+ }
352
+ function getReasoningEndTransition(reasoningStarted, providerMetadata) {
353
+ if (!reasoningStarted) {
354
+ return {
355
+ nextReasoningStarted: false,
356
+ event: null
357
+ };
358
+ }
359
+ return {
360
+ nextReasoningStarted: false,
361
+ event: {
362
+ type: "reasoning-end",
363
+ providerMetadata
364
+ }
365
+ };
366
+ }
338
367
  async function* transformStream(stream) {
339
368
  const bufferedToolCalls = /* @__PURE__ */ new Map();
340
369
  const emittedToolCalls = /* @__PURE__ */ new Set();
@@ -343,13 +372,19 @@ async function* transformStream(stream) {
343
372
  const emittedReasoningItems = /* @__PURE__ */ new Set();
344
373
  let latestResponse;
345
374
  let reasoningStarted = false;
375
+ const upsertBufferedToolCall = (outputIndex, getNextToolCall) => {
376
+ const nextToolCall = getNextToolCall(bufferedToolCalls.get(outputIndex));
377
+ bufferedToolCalls.set(outputIndex, nextToolCall);
378
+ return nextToolCall;
379
+ };
346
380
  for await (const event of stream) {
347
381
  if (event.type === "response.reasoning_summary_text.delta") {
348
382
  seenSummaryDeltas.add(`${event.item_id}:${event.summary_index}`);
349
383
  emittedReasoningItems.add(event.item_id);
350
- if (!reasoningStarted) {
351
- reasoningStarted = true;
352
- yield { type: "reasoning-start" };
384
+ const reasoningStartTransition = getReasoningStartTransition(reasoningStarted);
385
+ reasoningStarted = reasoningStartTransition.nextReasoningStarted;
386
+ if (reasoningStartTransition.event) {
387
+ yield reasoningStartTransition.event;
353
388
  }
354
389
  yield {
355
390
  type: "reasoning-delta",
@@ -361,9 +396,10 @@ async function* transformStream(stream) {
361
396
  const key = `${event.item_id}:${event.summary_index}`;
362
397
  if (!seenSummaryDeltas.has(key) && event.text.length > 0) {
363
398
  emittedReasoningItems.add(event.item_id);
364
- if (!reasoningStarted) {
365
- reasoningStarted = true;
366
- yield { type: "reasoning-start" };
399
+ const reasoningStartTransition = getReasoningStartTransition(reasoningStarted);
400
+ reasoningStarted = reasoningStartTransition.nextReasoningStarted;
401
+ if (reasoningStartTransition.event) {
402
+ yield reasoningStartTransition.event;
367
403
  }
368
404
  yield {
369
405
  type: "reasoning-delta",
@@ -384,32 +420,38 @@ async function* transformStream(stream) {
384
420
  continue;
385
421
  }
386
422
  const toolCallId = event.item.call_id;
387
- bufferedToolCalls.set(event.output_index, {
388
- id: toolCallId,
389
- name: event.item.name,
390
- arguments: event.item.arguments
391
- });
392
- if (!startedToolCalls.has(toolCallId)) {
423
+ const toolCallName = event.item.name;
424
+ const toolCallArguments = event.item.arguments;
425
+ upsertBufferedToolCall(
426
+ event.output_index,
427
+ () => ({
428
+ id: toolCallId,
429
+ name: toolCallName,
430
+ arguments: toolCallArguments
431
+ })
432
+ );
433
+ const shouldStartToolCall = !startedToolCalls.has(toolCallId);
434
+ if (shouldStartToolCall) {
393
435
  startedToolCalls.add(toolCallId);
394
436
  yield {
395
437
  type: "tool-call-start",
396
438
  toolCallId,
397
- toolName: event.item.name
439
+ toolName: toolCallName
398
440
  };
399
441
  }
400
442
  continue;
401
443
  }
402
444
  if (event.type === "response.function_call_arguments.delta") {
403
- const currentToolCall = bufferedToolCalls.get(
404
- event.output_index
405
- ) ?? {
406
- id: event.item_id,
407
- name: "",
408
- arguments: ""
409
- };
410
- currentToolCall.arguments += event.delta;
411
- bufferedToolCalls.set(event.output_index, currentToolCall);
412
- if (!startedToolCalls.has(currentToolCall.id)) {
445
+ const currentToolCall = upsertBufferedToolCall(
446
+ event.output_index,
447
+ (bufferedToolCall) => ({
448
+ id: bufferedToolCall?.id ?? event.item_id,
449
+ name: bufferedToolCall?.name ?? "",
450
+ arguments: `${bufferedToolCall?.arguments ?? ""}${event.delta}`
451
+ })
452
+ );
453
+ const shouldStartToolCall = !startedToolCalls.has(currentToolCall.id);
454
+ if (shouldStartToolCall) {
413
455
  startedToolCalls.add(currentToolCall.id);
414
456
  yield {
415
457
  type: "tool-call-start",
@@ -431,9 +473,10 @@ async function* transformStream(stream) {
431
473
  event.item.summary
432
474
  );
433
475
  if (summaryText.length > 0) {
434
- if (!reasoningStarted) {
435
- reasoningStarted = true;
436
- yield { type: "reasoning-start" };
476
+ const reasoningStartTransition = getReasoningStartTransition(reasoningStarted);
477
+ reasoningStarted = reasoningStartTransition.nextReasoningStarted;
478
+ if (reasoningStartTransition.event) {
479
+ yield reasoningStartTransition.event;
437
480
  }
438
481
  yield {
439
482
  type: "reasoning-delta",
@@ -442,36 +485,41 @@ async function* transformStream(stream) {
442
485
  }
443
486
  }
444
487
  const encryptedContent = typeof event.item.encrypted_content === "string" && event.item.encrypted_content.length > 0 ? event.item.encrypted_content : void 0;
445
- if (!reasoningStarted && encryptedContent) {
446
- reasoningStarted = true;
447
- yield { type: "reasoning-start" };
488
+ if (encryptedContent) {
489
+ const reasoningStartTransition = getReasoningStartTransition(reasoningStarted);
490
+ reasoningStarted = reasoningStartTransition.nextReasoningStarted;
491
+ if (reasoningStartTransition.event) {
492
+ yield reasoningStartTransition.event;
493
+ }
448
494
  }
449
- if (reasoningStarted) {
450
- reasoningStarted = false;
451
- yield {
452
- type: "reasoning-end",
453
- providerMetadata: {
454
- openai: {
455
- ...encryptedContent ? { encryptedContent } : {}
456
- }
495
+ const reasoningEndTransition2 = getReasoningEndTransition(
496
+ reasoningStarted,
497
+ {
498
+ openai: {
499
+ ...encryptedContent ? { encryptedContent } : {}
457
500
  }
458
- };
501
+ }
502
+ );
503
+ reasoningStarted = reasoningEndTransition2.nextReasoningStarted;
504
+ if (reasoningEndTransition2.event) {
505
+ yield reasoningEndTransition2.event;
459
506
  }
460
507
  continue;
461
508
  }
462
509
  if (!isFunctionToolCall(event.item)) {
463
510
  continue;
464
511
  }
465
- const currentToolCall = bufferedToolCalls.get(
466
- event.output_index
467
- ) ?? {
468
- id: event.item.call_id,
469
- name: event.item.name,
470
- arguments: ""
471
- };
472
- currentToolCall.id = event.item.call_id;
473
- currentToolCall.name = event.item.name;
474
- currentToolCall.arguments = event.item.arguments || currentToolCall.arguments;
512
+ const toolCallId = event.item.call_id;
513
+ const toolCallName = event.item.name;
514
+ const toolCallArguments = event.item.arguments;
515
+ const currentToolCall = upsertBufferedToolCall(
516
+ event.output_index,
517
+ (bufferedToolCall) => ({
518
+ id: toolCallId,
519
+ name: toolCallName,
520
+ arguments: toolCallArguments || bufferedToolCall?.arguments || ""
521
+ })
522
+ );
475
523
  if (!emittedToolCalls.has(currentToolCall.id)) {
476
524
  emittedToolCalls.add(currentToolCall.id);
477
525
  yield {
@@ -489,12 +537,13 @@ async function* transformStream(stream) {
489
537
  }
490
538
  if (event.type === "response.completed") {
491
539
  latestResponse = event.response;
492
- if (reasoningStarted) {
493
- reasoningStarted = false;
494
- yield {
495
- type: "reasoning-end",
496
- providerMetadata: { openai: {} }
497
- };
540
+ const reasoningEndTransition2 = getReasoningEndTransition(
541
+ reasoningStarted,
542
+ { openai: {} }
543
+ );
544
+ reasoningStarted = reasoningEndTransition2.nextReasoningStarted;
545
+ if (reasoningEndTransition2.event) {
546
+ yield reasoningEndTransition2.event;
498
547
  }
499
548
  for (const bufferedToolCall of bufferedToolCalls.values()) {
500
549
  if (emittedToolCalls.has(bufferedToolCall.id)) {
@@ -521,8 +570,12 @@ async function* transformStream(stream) {
521
570
  return;
522
571
  }
523
572
  }
524
- if (reasoningStarted) {
525
- yield { type: "reasoning-end", providerMetadata: { openai: {} } };
573
+ const reasoningEndTransition = getReasoningEndTransition(reasoningStarted, {
574
+ openai: {}
575
+ });
576
+ reasoningStarted = reasoningEndTransition.nextReasoningStarted;
577
+ if (reasoningEndTransition.event) {
578
+ yield reasoningEndTransition.event;
526
579
  }
527
580
  const hasToolCalls = bufferedToolCalls.size > 0;
528
581
  const usage = latestResponse ? mapUsage(latestResponse.usage) : mapUsage(void 0);
@@ -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.0",
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.0",
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 };