@core-ai/openai 0.13.1 → 0.15.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/dist/index.js CHANGED
@@ -1,729 +1,26 @@
1
1
  import {
2
- convertToolChoice,
3
- convertTools,
2
+ createOpenAIChatCompletionsModel,
4
3
  createOpenAIProvider,
5
- createStructuredOutputOptions,
6
- extractStructuredObject,
7
4
  getOpenAIModelCapabilities,
8
- getStructuredOutputToolName,
5
+ openaiChatGenerateProviderOptionsSchema,
9
6
  openaiCompatGenerateProviderOptionsSchema,
10
7
  openaiCompatProviderOptionsSchema,
11
8
  openaiEmbedProviderOptionsSchema,
12
9
  openaiImageProviderOptionsSchema,
13
10
  openaiResponsesGenerateProviderOptionsSchema,
14
- openaiResponsesProviderOptionsSchema,
15
- parseOpenAIResponsesGenerateProviderOptions,
16
- safeParseJsonObject,
17
- toOpenAIReasoningEffort,
18
- transformStructuredOutputStream,
19
- validateOpenAIReasoningConfig,
20
- wrapOpenAIError
21
- } from "./chunk-7MAEB5C7.js";
22
-
23
- // src/chat-model.ts
24
- import { createObjectStream, createChatStream } from "@core-ai/core-ai";
25
-
26
- // src/chat-adapter.ts
27
- import { getProviderMetadata, clampReasoningEffort } from "@core-ai/core-ai";
28
- var ENCRYPTED_REASONING_INCLUDE = "reasoning.encrypted_content";
29
- var REASONING_SUMMARY_SEPARATOR = "\n\n";
30
- function convertMessages(messages) {
31
- return messages.flatMap(convertMessage);
32
- }
33
- function convertMessage(message) {
34
- if (message.role === "system") {
35
- return [
36
- {
37
- role: "developer",
38
- content: message.content
39
- }
40
- ];
41
- }
42
- if (message.role === "user") {
43
- return [
44
- {
45
- role: "user",
46
- content: typeof message.content === "string" ? message.content : message.content.map(convertUserContentPart)
47
- }
48
- ];
49
- }
50
- if (message.role === "assistant") {
51
- return convertAssistantMessage(message.parts);
52
- }
53
- return [
54
- {
55
- type: "function_call_output",
56
- call_id: message.toolCallId,
57
- output: message.content
58
- }
59
- ];
60
- }
61
- function convertAssistantMessage(parts) {
62
- const items = [];
63
- const textParts = [];
64
- const flushTextBuffer = () => {
65
- if (textParts.length === 0) {
66
- return;
67
- }
68
- items.push({
69
- role: "assistant",
70
- content: textParts.join("\n\n")
71
- });
72
- textParts.length = 0;
73
- };
74
- for (const part of parts) {
75
- if (part.type === "text") {
76
- textParts.push(part.text);
77
- continue;
78
- }
79
- if (part.type === "reasoning") {
80
- if (getProviderMetadata(
81
- part.providerMetadata,
82
- "openai"
83
- ) == null) {
84
- if (part.text.length > 0) {
85
- textParts.push(`<thinking>${part.text}</thinking>`);
86
- }
87
- continue;
88
- }
89
- flushTextBuffer();
90
- const encryptedContent = getEncryptedReasoningContent(part);
91
- items.push({
92
- type: "reasoning",
93
- summary: [
94
- {
95
- type: "summary_text",
96
- text: part.text
97
- }
98
- ],
99
- ...encryptedContent ? { encrypted_content: encryptedContent } : {}
100
- });
101
- continue;
102
- }
103
- flushTextBuffer();
104
- items.push({
105
- type: "function_call",
106
- call_id: part.toolCall.id,
107
- name: part.toolCall.name,
108
- arguments: JSON.stringify(part.toolCall.arguments)
109
- });
110
- }
111
- flushTextBuffer();
112
- return items;
113
- }
114
- function getEncryptedReasoningContent(part) {
115
- const { encryptedContent } = getProviderMetadata(
116
- part.providerMetadata,
117
- "openai"
118
- ) ?? {};
119
- return typeof encryptedContent === "string" && encryptedContent.length > 0 ? encryptedContent : void 0;
120
- }
121
- function convertUserContentPart(part) {
122
- if (part.type === "text") {
123
- return {
124
- type: "input_text",
125
- text: part.text
126
- };
127
- }
128
- if (part.type === "image") {
129
- const imageUrl = part.source.type === "url" ? part.source.url : `data:${part.source.mediaType};base64,${part.source.data}`;
130
- return {
131
- type: "input_image",
132
- image_url: imageUrl
133
- };
134
- }
135
- return {
136
- type: "input_file",
137
- file_data: part.data,
138
- ...part.filename ? { filename: part.filename } : {}
139
- };
140
- }
141
- function createGenerateRequest(modelId, options) {
142
- return createRequest(
143
- modelId,
144
- options,
145
- false
146
- );
147
- }
148
- function createStreamRequest(modelId, options) {
149
- return createRequest(
150
- modelId,
151
- options,
152
- true
153
- );
154
- }
155
- function createRequest(modelId, options, stream) {
156
- const openaiOptions = parseOpenAIResponsesGenerateProviderOptions(
157
- options.providerOptions
158
- );
159
- const request = {
160
- ...createRequestBase(modelId, options),
161
- ...stream ? { stream: true } : {},
162
- ...mapOpenAIProviderOptionsToRequestFields(openaiOptions)
163
- };
164
- if (options.reasoning && getOpenAIModelCapabilities(modelId).reasoning.supported) {
165
- request.include = mergeInclude(request.include, [
166
- ENCRYPTED_REASONING_INCLUDE
167
- ]);
168
- }
169
- return request;
170
- }
171
- function createRequestBase(modelId, options) {
172
- validateOpenAIReasoningConfig(modelId, options);
173
- return {
174
- model: modelId,
175
- store: false,
176
- input: convertMessages(options.messages),
177
- ...options.tools && Object.keys(options.tools).length > 0 ? { tools: convertResponseTools(options.tools) } : {},
178
- ...options.toolChoice ? { tool_choice: convertResponseToolChoice(options.toolChoice) } : {},
179
- ...mapReasoningToRequestFields(modelId, options),
180
- ...mapSamplingToRequestFields(options)
181
- };
182
- }
183
- function convertResponseTools(tools) {
184
- return convertTools(tools).map((tool) => ({
185
- type: "function",
186
- name: tool.function.name,
187
- description: tool.function.description,
188
- parameters: tool.function.parameters
189
- }));
190
- }
191
- function convertResponseToolChoice(choice) {
192
- const converted = convertToolChoice(choice);
193
- if (typeof converted === "string") {
194
- return converted;
195
- }
196
- return {
197
- type: "function",
198
- name: converted.function.name
199
- };
200
- }
201
- function mergeInclude(value, requiredIncludes) {
202
- const include = Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
203
- for (const requiredInclude of requiredIncludes) {
204
- if (!include.includes(requiredInclude)) {
205
- include.push(requiredInclude);
206
- }
207
- }
208
- return include.length > 0 ? include : void 0;
209
- }
210
- function mapSamplingToRequestFields(options) {
211
- return {
212
- ...options.temperature !== void 0 ? { temperature: options.temperature } : {},
213
- ...options.maxTokens !== void 0 ? { max_output_tokens: options.maxTokens } : {},
214
- ...options.topP !== void 0 ? { top_p: options.topP } : {}
215
- };
216
- }
217
- function mapOpenAIProviderOptionsToRequestFields(options) {
218
- return {
219
- ...options?.store !== void 0 ? { store: options.store } : {},
220
- ...options?.serviceTier !== void 0 ? { service_tier: options.serviceTier } : {},
221
- ...options?.include ? { include: options.include } : {},
222
- ...options?.parallelToolCalls !== void 0 ? { parallel_tool_calls: options.parallelToolCalls } : {},
223
- ...options?.user !== void 0 ? { user: options.user } : {}
224
- };
225
- }
226
- function mapGenerateResponse(response) {
227
- const parts = [];
228
- for (const item of response.output) {
229
- if (isReasoningItem(item)) {
230
- const reasoningPart = mapReasoningPart(item);
231
- if (reasoningPart) {
232
- parts.push(reasoningPart);
233
- }
234
- continue;
235
- }
236
- if (isOutputMessage(item)) {
237
- parts.push(...mapMessageTextParts(item));
238
- continue;
239
- }
240
- if (isFunctionToolCall(item)) {
241
- parts.push({
242
- type: "tool-call",
243
- toolCall: {
244
- id: item.call_id,
245
- name: item.name,
246
- arguments: safeParseJsonObject(item.arguments)
247
- }
248
- });
249
- }
250
- }
251
- const content = getTextContent(parts);
252
- const reasoning = getReasoningText(parts);
253
- const toolCalls = getToolCalls(parts);
254
- return {
255
- parts,
256
- content,
257
- reasoning,
258
- toolCalls,
259
- finishReason: mapFinishReason(response, toolCalls.length > 0),
260
- usage: mapUsage(response.usage)
261
- };
262
- }
263
- function mapReasoningPart(item) {
264
- const text = getReasoningSummaryText(item.summary);
265
- const encryptedContent = typeof item.encrypted_content === "string" && item.encrypted_content.length > 0 ? item.encrypted_content : void 0;
266
- if (text.length === 0 && !encryptedContent) {
267
- return null;
268
- }
269
- return {
270
- type: "reasoning",
271
- text,
272
- providerMetadata: {
273
- openai: { ...encryptedContent ? { encryptedContent } : {} }
274
- }
275
- };
276
- }
277
- function getReasoningSummaryText(summary) {
278
- return summary.map((item) => item.text).join(REASONING_SUMMARY_SEPARATOR);
279
- }
280
- function mapMessageTextParts(message) {
281
- return message.content.flatMap(
282
- (contentItem) => contentItem.type === "output_text" && contentItem.text.length > 0 ? [{ type: "text", text: contentItem.text }] : []
283
- );
284
- }
285
- function getTextContent(parts) {
286
- return getJoinedPartText(parts, "text", "");
287
- }
288
- function getReasoningText(parts) {
289
- return getJoinedPartText(parts, "reasoning", REASONING_SUMMARY_SEPARATOR);
290
- }
291
- function getJoinedPartText(parts, type, separator) {
292
- const text = parts.flatMap(
293
- (part) => part.type === type && "text" in part ? [part.text] : []
294
- ).join(separator);
295
- return text.length > 0 ? text : null;
296
- }
297
- function getToolCalls(parts) {
298
- return parts.flatMap(
299
- (part) => part.type === "tool-call" ? [part.toolCall] : []
300
- );
301
- }
302
- function mapFinishReason(response, hasToolCalls) {
303
- const incompleteReason = response.incomplete_details?.reason;
304
- if (incompleteReason === "max_output_tokens") {
305
- return "length";
306
- }
307
- if (incompleteReason === "content_filter") {
308
- return "content-filter";
309
- }
310
- if (hasToolCalls) {
311
- return "tool-calls";
312
- }
313
- if (response.status === "completed") {
314
- return "stop";
315
- }
316
- return "unknown";
317
- }
318
- function mapUsage(usage) {
319
- const reasoningTokens = usage?.output_tokens_details?.reasoning_tokens;
320
- return {
321
- inputTokens: usage?.input_tokens ?? 0,
322
- outputTokens: usage?.output_tokens ?? 0,
323
- inputTokenDetails: {
324
- cacheReadTokens: usage?.input_tokens_details?.cached_tokens ?? 0,
325
- cacheWriteTokens: 0
326
- },
327
- outputTokenDetails: {
328
- ...reasoningTokens !== void 0 ? { reasoningTokens } : {}
329
- }
330
- };
331
- }
332
- function getReasoningSummaryKey(part) {
333
- return `${part.itemId}:${part.summaryIndex}`;
334
- }
335
- function isSameReasoningSummaryPart(left, right) {
336
- return left.itemId === right.itemId && left.summaryIndex === right.summaryIndex;
337
- }
338
- function getReasoningStartTransition(reasoningStarted) {
339
- if (reasoningStarted) {
340
- return {
341
- nextReasoningStarted: true,
342
- event: null
343
- };
344
- }
345
- return {
346
- nextReasoningStarted: true,
347
- event: { type: "reasoning-start" }
348
- };
349
- }
350
- function getReasoningEndTransition(reasoningStarted, providerMetadata) {
351
- if (!reasoningStarted) {
352
- return {
353
- nextReasoningStarted: false,
354
- event: null
355
- };
356
- }
357
- return {
358
- nextReasoningStarted: false,
359
- event: {
360
- type: "reasoning-end",
361
- providerMetadata
362
- }
363
- };
364
- }
365
- async function* transformStream(stream) {
366
- const bufferedToolCalls = /* @__PURE__ */ new Map();
367
- const emittedToolCalls = /* @__PURE__ */ new Set();
368
- const startedToolCalls = /* @__PURE__ */ new Set();
369
- const seenSummaryDeltas = /* @__PURE__ */ new Set();
370
- const emittedReasoningItems = /* @__PURE__ */ new Set();
371
- let latestResponse;
372
- let reasoningStarted = false;
373
- let latestReasoningSummaryPart;
374
- const upsertBufferedToolCall = (outputIndex, getNextToolCall) => {
375
- const nextToolCall = getNextToolCall(
376
- bufferedToolCalls.get(outputIndex)
377
- );
378
- bufferedToolCalls.set(outputIndex, nextToolCall);
379
- return nextToolCall;
380
- };
381
- const getNextReasoningStartEvent = () => {
382
- const transition = getReasoningStartTransition(reasoningStarted);
383
- reasoningStarted = transition.nextReasoningStarted;
384
- return transition.event;
385
- };
386
- const getNextReasoningEndEvent = (providerMetadata) => {
387
- const transition = getReasoningEndTransition(
388
- reasoningStarted,
389
- providerMetadata
390
- );
391
- reasoningStarted = transition.nextReasoningStarted;
392
- if (transition.event) {
393
- latestReasoningSummaryPart = void 0;
394
- }
395
- return transition.event;
396
- };
397
- const getReasoningSummarySeparatorEvent = (currentPart) => {
398
- const previousPart = latestReasoningSummaryPart;
399
- latestReasoningSummaryPart = currentPart;
400
- if (previousPart === void 0 || isSameReasoningSummaryPart(previousPart, currentPart)) {
401
- return null;
402
- }
403
- return {
404
- type: "reasoning-delta",
405
- text: REASONING_SUMMARY_SEPARATOR
406
- };
407
- };
408
- for await (const event of stream) {
409
- if (event.type === "response.reasoning_summary_text.delta") {
410
- const summaryPart = {
411
- itemId: event.item_id,
412
- summaryIndex: event.summary_index
413
- };
414
- seenSummaryDeltas.add(getReasoningSummaryKey(summaryPart));
415
- emittedReasoningItems.add(event.item_id);
416
- const reasoningStartEvent = getNextReasoningStartEvent();
417
- if (reasoningStartEvent) {
418
- yield reasoningStartEvent;
419
- }
420
- const separatorEvent = getReasoningSummarySeparatorEvent(summaryPart);
421
- if (separatorEvent) {
422
- yield separatorEvent;
423
- }
424
- yield {
425
- type: "reasoning-delta",
426
- text: event.delta
427
- };
428
- continue;
429
- }
430
- if (event.type === "response.reasoning_summary_text.done") {
431
- const summaryPart = {
432
- itemId: event.item_id,
433
- summaryIndex: event.summary_index
434
- };
435
- const key = getReasoningSummaryKey(summaryPart);
436
- if (!seenSummaryDeltas.has(key) && event.text.length > 0) {
437
- emittedReasoningItems.add(event.item_id);
438
- const reasoningStartEvent = getNextReasoningStartEvent();
439
- if (reasoningStartEvent) {
440
- yield reasoningStartEvent;
441
- }
442
- const separatorEvent = getReasoningSummarySeparatorEvent(summaryPart);
443
- if (separatorEvent) {
444
- yield separatorEvent;
445
- }
446
- yield {
447
- type: "reasoning-delta",
448
- text: event.text
449
- };
450
- }
451
- continue;
452
- }
453
- if (event.type === "response.output_text.delta") {
454
- yield {
455
- type: "text-delta",
456
- text: event.delta
457
- };
458
- continue;
459
- }
460
- if (event.type === "response.output_item.added") {
461
- if (!isFunctionToolCall(event.item)) {
462
- continue;
463
- }
464
- const toolCallId = event.item.call_id;
465
- const toolCallName = event.item.name;
466
- const toolCallArguments = event.item.arguments;
467
- upsertBufferedToolCall(event.output_index, () => ({
468
- id: toolCallId,
469
- name: toolCallName,
470
- arguments: toolCallArguments
471
- }));
472
- const shouldStartToolCall = !startedToolCalls.has(toolCallId);
473
- if (shouldStartToolCall) {
474
- startedToolCalls.add(toolCallId);
475
- yield {
476
- type: "tool-call-start",
477
- toolCallId,
478
- toolName: toolCallName
479
- };
480
- }
481
- continue;
482
- }
483
- if (event.type === "response.function_call_arguments.delta") {
484
- const currentToolCall = upsertBufferedToolCall(
485
- event.output_index,
486
- (bufferedToolCall) => ({
487
- id: bufferedToolCall?.id ?? event.item_id,
488
- name: bufferedToolCall?.name ?? "",
489
- arguments: `${bufferedToolCall?.arguments ?? ""}${event.delta}`
490
- })
491
- );
492
- const shouldStartToolCall = !startedToolCalls.has(
493
- currentToolCall.id
494
- );
495
- if (shouldStartToolCall) {
496
- startedToolCalls.add(currentToolCall.id);
497
- yield {
498
- type: "tool-call-start",
499
- toolCallId: currentToolCall.id,
500
- toolName: currentToolCall.name
501
- };
502
- }
503
- yield {
504
- type: "tool-call-delta",
505
- toolCallId: currentToolCall.id,
506
- argumentsDelta: event.delta
507
- };
508
- continue;
509
- }
510
- if (event.type === "response.output_item.done") {
511
- if (isReasoningItem(event.item)) {
512
- if (!emittedReasoningItems.has(event.item.id)) {
513
- const summaryText = getReasoningSummaryText(
514
- event.item.summary
515
- );
516
- if (summaryText.length > 0) {
517
- const reasoningStartEvent = getNextReasoningStartEvent();
518
- if (reasoningStartEvent) {
519
- yield reasoningStartEvent;
520
- }
521
- yield {
522
- type: "reasoning-delta",
523
- text: summaryText
524
- };
525
- }
526
- }
527
- const encryptedContent = typeof event.item.encrypted_content === "string" && event.item.encrypted_content.length > 0 ? event.item.encrypted_content : void 0;
528
- if (encryptedContent) {
529
- const reasoningStartEvent = getNextReasoningStartEvent();
530
- if (reasoningStartEvent) {
531
- yield reasoningStartEvent;
532
- }
533
- }
534
- const reasoningEndEvent2 = getNextReasoningEndEvent({
535
- openai: {
536
- ...encryptedContent ? { encryptedContent } : {}
537
- }
538
- });
539
- if (reasoningEndEvent2) {
540
- yield reasoningEndEvent2;
541
- }
542
- continue;
543
- }
544
- if (!isFunctionToolCall(event.item)) {
545
- continue;
546
- }
547
- const toolCallId = event.item.call_id;
548
- const toolCallName = event.item.name;
549
- const toolCallArguments = event.item.arguments;
550
- const currentToolCall = upsertBufferedToolCall(
551
- event.output_index,
552
- (bufferedToolCall) => ({
553
- id: toolCallId,
554
- name: toolCallName,
555
- arguments: toolCallArguments || bufferedToolCall?.arguments || ""
556
- })
557
- );
558
- if (!emittedToolCalls.has(currentToolCall.id)) {
559
- emittedToolCalls.add(currentToolCall.id);
560
- yield {
561
- type: "tool-call-end",
562
- toolCall: {
563
- id: currentToolCall.id,
564
- name: currentToolCall.name,
565
- arguments: safeParseJsonObject(
566
- currentToolCall.arguments
567
- )
568
- }
569
- };
570
- }
571
- continue;
572
- }
573
- if (event.type === "response.completed") {
574
- latestResponse = event.response;
575
- const reasoningEndEvent2 = getNextReasoningEndEvent({ openai: {} });
576
- if (reasoningEndEvent2) {
577
- yield reasoningEndEvent2;
578
- }
579
- for (const bufferedToolCall of bufferedToolCalls.values()) {
580
- if (emittedToolCalls.has(bufferedToolCall.id)) {
581
- continue;
582
- }
583
- emittedToolCalls.add(bufferedToolCall.id);
584
- yield {
585
- type: "tool-call-end",
586
- toolCall: {
587
- id: bufferedToolCall.id,
588
- name: bufferedToolCall.name,
589
- arguments: safeParseJsonObject(
590
- bufferedToolCall.arguments
591
- )
592
- }
593
- };
594
- }
595
- const hasToolCalls2 = bufferedToolCalls.size > 0;
596
- yield {
597
- type: "finish",
598
- finishReason: mapFinishReason(latestResponse, hasToolCalls2),
599
- usage: mapUsage(latestResponse.usage)
600
- };
601
- return;
602
- }
603
- }
604
- const reasoningEndEvent = getNextReasoningEndEvent({
605
- openai: {}
606
- });
607
- if (reasoningEndEvent) {
608
- yield reasoningEndEvent;
609
- }
610
- const hasToolCalls = bufferedToolCalls.size > 0;
611
- const usage = latestResponse ? mapUsage(latestResponse.usage) : mapUsage(void 0);
612
- const finishReason = latestResponse ? mapFinishReason(latestResponse, hasToolCalls) : "unknown";
613
- yield {
614
- type: "finish",
615
- finishReason,
616
- usage
617
- };
618
- }
619
- function mapReasoningToRequestFields(modelId, options) {
620
- if (!options.reasoning) {
621
- return {};
622
- }
623
- const capabilities = getOpenAIModelCapabilities(modelId);
624
- if (!capabilities.reasoning.supported) {
625
- return {};
626
- }
627
- const effort = toOpenAIReasoningEffort(
628
- clampReasoningEffort(
629
- options.reasoning.effort,
630
- capabilities.reasoning.supportedEfforts
631
- )
632
- );
633
- return {
634
- reasoning: {
635
- effort,
636
- summary: "auto"
637
- }
638
- };
639
- }
640
- function isFunctionToolCall(item) {
641
- return item.type === "function_call";
642
- }
643
- function isOutputMessage(item) {
644
- return item.type === "message";
645
- }
646
- function isReasoningItem(item) {
647
- return item.type === "reasoning";
648
- }
649
-
650
- // src/chat-model.ts
651
- function createOpenAIChatModel(client, modelId) {
652
- const provider = "openai";
653
- async function callOpenAIResponsesApi(request, signal) {
654
- try {
655
- return await client.responses.create(request, {
656
- signal
657
- });
658
- } catch (error) {
659
- throw wrapOpenAIError(error);
660
- }
661
- }
662
- async function generateChat(options) {
663
- const request = createGenerateRequest(modelId, options);
664
- const response = await callOpenAIResponsesApi(
665
- request,
666
- options.signal
667
- );
668
- return mapGenerateResponse(response);
669
- }
670
- async function streamChat(options) {
671
- const request = createStreamRequest(modelId, options);
672
- return createChatStream(
673
- async () => transformStream(
674
- await callOpenAIResponsesApi(request, options.signal)
675
- ),
676
- { signal: options.signal }
677
- );
678
- }
679
- return {
680
- provider,
681
- modelId,
682
- capabilities: getOpenAIModelCapabilities(modelId),
683
- generate: generateChat,
684
- stream: streamChat,
685
- async generateObject(options) {
686
- const structuredOptions = createStructuredOutputOptions(options);
687
- const result = await generateChat(structuredOptions);
688
- const toolName = getStructuredOutputToolName(options);
689
- const object = extractStructuredObject(
690
- result,
691
- options.schema,
692
- provider,
693
- toolName
694
- );
695
- return {
696
- object,
697
- finishReason: result.finishReason,
698
- usage: result.usage
699
- };
700
- },
701
- async streamObject(options) {
702
- const structuredOptions = createStructuredOutputOptions(options);
703
- const stream = await streamChat(structuredOptions);
704
- const toolName = getStructuredOutputToolName(options);
705
- return createObjectStream(
706
- transformStructuredOutputStream(
707
- stream,
708
- options.schema,
709
- provider,
710
- toolName
711
- ),
712
- {
713
- signal: options.signal
714
- }
715
- );
716
- }
717
- };
718
- }
11
+ openaiResponsesProviderOptionsSchema
12
+ } from "./chunk-YORO2XQ3.js";
719
13
 
720
14
  // src/provider.ts
721
15
  function createOpenAI(options = {}) {
722
- return createOpenAIProvider(options, createOpenAIChatModel);
16
+ return createOpenAIProvider(options);
723
17
  }
724
18
  export {
725
19
  createOpenAI,
20
+ createOpenAIChatCompletionsModel,
21
+ createOpenAIProvider,
726
22
  getOpenAIModelCapabilities,
23
+ openaiChatGenerateProviderOptionsSchema,
727
24
  openaiCompatGenerateProviderOptionsSchema,
728
25
  openaiCompatProviderOptionsSchema,
729
26
  openaiEmbedProviderOptionsSchema,