@core-ai/openai 0.27.1 → 0.28.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.
|
@@ -109,7 +109,7 @@ var GPT_6_SOL_LUNA_CAPABILITIES = createCapabilities({
|
|
|
109
109
|
supportedEfforts: GPT_6_EFFORTS,
|
|
110
110
|
restrictsSamplingParams: true,
|
|
111
111
|
reasoningMode: "always-on",
|
|
112
|
-
functionCalling: "
|
|
112
|
+
functionCalling: "supported",
|
|
113
113
|
nativeMaxEffort: true
|
|
114
114
|
});
|
|
115
115
|
function createNoReasoningCapabilities({
|
|
@@ -603,7 +603,6 @@ function createRequest(modelId, options, stream, adapterOptions) {
|
|
|
603
603
|
function createRequestBase(modelId, options, adapterOptions) {
|
|
604
604
|
const functionCalling = getOpenAIModelCapabilities(modelId).chatCompletions.functionCalling;
|
|
605
605
|
const usingTools = options.tools !== void 0 && Object.keys(options.tools).length > 0;
|
|
606
|
-
const disableReasoningForTools = usingTools && functionCalling === "none-only" && options.reasoning === void 0;
|
|
607
606
|
if (usingTools && functionCalling === "unsupported") {
|
|
608
607
|
throw new ValidationError2(
|
|
609
608
|
`${adapterOptions.providerId} model "${modelId}" does not support tool calling on Chat Completions. Use the Responses API`,
|
|
@@ -611,32 +610,18 @@ function createRequestBase(modelId, options, adapterOptions) {
|
|
|
611
610
|
adapterOptions.providerId
|
|
612
611
|
);
|
|
613
612
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
621
|
-
if (!disableReasoningForTools) {
|
|
622
|
-
validateReasoningConfig(
|
|
623
|
-
modelId,
|
|
624
|
-
options,
|
|
625
|
-
adapterOptions.capabilities,
|
|
626
|
-
adapterOptions.providerId
|
|
627
|
-
);
|
|
628
|
-
}
|
|
613
|
+
validateReasoningConfig(
|
|
614
|
+
modelId,
|
|
615
|
+
options,
|
|
616
|
+
adapterOptions.capabilities,
|
|
617
|
+
adapterOptions.providerId
|
|
618
|
+
);
|
|
629
619
|
validateInputModalities({
|
|
630
620
|
messages: options.messages,
|
|
631
621
|
capabilities: adapterOptions.capabilities,
|
|
632
622
|
modelId,
|
|
633
623
|
providerId: adapterOptions.providerId
|
|
634
624
|
});
|
|
635
|
-
const reasoningFields = disableReasoningForTools ? { reasoning_effort: "none" } : mapReasoningToRequestFields(
|
|
636
|
-
modelId,
|
|
637
|
-
options,
|
|
638
|
-
adapterOptions.capabilities
|
|
639
|
-
);
|
|
640
625
|
return {
|
|
641
626
|
model: modelId,
|
|
642
627
|
messages: convertMessages(options.messages, adapterOptions),
|
|
@@ -648,7 +633,11 @@ function createRequestBase(modelId, options, adapterOptions) {
|
|
|
648
633
|
})
|
|
649
634
|
} : {},
|
|
650
635
|
...options.toolChoice ? { tool_choice: convertToolChoice(options.toolChoice) } : {},
|
|
651
|
-
...
|
|
636
|
+
...mapReasoningToRequestFields(
|
|
637
|
+
modelId,
|
|
638
|
+
options,
|
|
639
|
+
adapterOptions.capabilities
|
|
640
|
+
),
|
|
652
641
|
...mapSamplingToRequestFields(modelId, options, adapterOptions)
|
|
653
642
|
};
|
|
654
643
|
}
|
package/dist/compat.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _core_ai_core_ai from '@core-ai/core-ai';
|
|
2
2
|
import { ChatModel } from '@core-ai/core-ai';
|
|
3
|
-
import { O as OpenAIChatClient, a as OpenAIProvider, b as OpenAIProviderBaseOptions } from './provider-factory-
|
|
4
|
-
export { c as OpenAICompatGenerateProviderOptions, d as OpenAICompatRequestOptions, o as openaiCompatGenerateProviderOptionsSchema, e as openaiCompatProviderOptionsSchema } from './provider-factory-
|
|
3
|
+
import { O as OpenAIChatClient, a as OpenAIProvider, b as OpenAIProviderBaseOptions } from './provider-factory-h4e42zh6.js';
|
|
4
|
+
export { c as OpenAICompatGenerateProviderOptions, d as OpenAICompatRequestOptions, o as openaiCompatGenerateProviderOptionsSchema, e as openaiCompatProviderOptionsSchema } from './provider-factory-h4e42zh6.js';
|
|
5
5
|
import 'openai';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
package/dist/compat.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as OpenAIProvider$1, b as OpenAIProviderBaseOptions } from './provider-factory-
|
|
2
|
-
export { O as OpenAIChatClient, f as OpenAIChatCompletionsModelOptions, g as OpenAIChatGenerateProviderOptions, h as OpenAIChatGenerateProviderOptionsConfig, i as OpenAIChatProvider, c as OpenAICompatGenerateProviderOptions, d as OpenAICompatRequestOptions, j as OpenAICompatibility, k as OpenAICompatibilityOptions, l as OpenAIEmbedProviderOptions, m as OpenAIImageProviderOptions, n as OpenAIModelCapabilities, p as OpenAIProviderFactoryOptions, q as OpenAIReasoningTokenAccounting, r as OpenAIResponsesGenerateProviderOptions, s as OpenAIResponsesGenerateProviderOptionsConfig, t as OpenAIResponsesProviderOptions, u as OpenAIStructuredOutputMode, v as createOpenAIChatCompletionsModel, w as createOpenAIProvider, x as getOpenAIModelCapabilities, y as openaiChatGenerateProviderOptionsSchema, o as openaiCompatGenerateProviderOptionsSchema, e as openaiCompatProviderOptionsSchema, z as openaiEmbedProviderOptionsSchema, A as openaiImageProviderOptionsSchema, B as openaiResponsesGenerateProviderOptionsSchema, C as openaiResponsesProviderOptionsSchema } from './provider-factory-
|
|
1
|
+
import { a as OpenAIProvider$1, b as OpenAIProviderBaseOptions } from './provider-factory-h4e42zh6.js';
|
|
2
|
+
export { O as OpenAIChatClient, f as OpenAIChatCompletionsModelOptions, g as OpenAIChatGenerateProviderOptions, h as OpenAIChatGenerateProviderOptionsConfig, i as OpenAIChatProvider, c as OpenAICompatGenerateProviderOptions, d as OpenAICompatRequestOptions, j as OpenAICompatibility, k as OpenAICompatibilityOptions, l as OpenAIEmbedProviderOptions, m as OpenAIImageProviderOptions, n as OpenAIModelCapabilities, p as OpenAIProviderFactoryOptions, q as OpenAIReasoningTokenAccounting, r as OpenAIResponsesGenerateProviderOptions, s as OpenAIResponsesGenerateProviderOptionsConfig, t as OpenAIResponsesProviderOptions, u as OpenAIStructuredOutputMode, v as createOpenAIChatCompletionsModel, w as createOpenAIProvider, x as getOpenAIModelCapabilities, y as openaiChatGenerateProviderOptionsSchema, o as openaiCompatGenerateProviderOptionsSchema, e as openaiCompatProviderOptionsSchema, z as openaiEmbedProviderOptionsSchema, A as openaiImageProviderOptionsSchema, B as openaiResponsesGenerateProviderOptionsSchema, C as openaiResponsesProviderOptionsSchema } from './provider-factory-h4e42zh6.js';
|
|
3
3
|
import 'openai';
|
|
4
4
|
import '@core-ai/core-ai';
|
|
5
5
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
openaiImageProviderOptionsSchema,
|
|
11
11
|
openaiResponsesGenerateProviderOptionsSchema,
|
|
12
12
|
openaiResponsesProviderOptionsSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NAZAEUX3.js";
|
|
14
14
|
|
|
15
15
|
// src/provider.ts
|
|
16
16
|
function createOpenAI(options = {}) {
|
|
@@ -5,10 +5,9 @@ import { z } from 'zod';
|
|
|
5
5
|
/**
|
|
6
6
|
* Chat Completions function-calling support for a model.
|
|
7
7
|
*
|
|
8
|
-
* `
|
|
9
|
-
* `none`. `unsupported` models accept tools on the Responses API only.
|
|
8
|
+
* `unsupported` models accept tools on the Responses API only.
|
|
10
9
|
*/
|
|
11
|
-
type OpenAIChatCompletionsFunctionCalling = 'supported' | '
|
|
10
|
+
type OpenAIChatCompletionsFunctionCalling = 'supported' | 'unsupported';
|
|
12
11
|
type OpenAIChatCompletionsCapabilities = {
|
|
13
12
|
maxTokensParameter: 'max_tokens' | 'max_completion_tokens';
|
|
14
13
|
functionCalling: OpenAIChatCompletionsFunctionCalling;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@core-ai/openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "OpenAI provider package for @core-ai/core-ai",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Omnifact (https://omnifact.ai)",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"test:watch": "vitest"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@core-ai/core-ai": "^0.
|
|
53
|
+
"@core-ai/core-ai": "^0.28.0",
|
|
54
54
|
"openai": "^6.46.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|