@core-ai/anthropic 0.25.0 → 0.27.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 +12 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -209,10 +209,10 @@ var MAX_EFFORTS = [
|
|
|
209
209
|
"high",
|
|
210
210
|
"max"
|
|
211
211
|
];
|
|
212
|
-
function createCapabilities(supportedEfforts, supportsStrictToolSchemas) {
|
|
212
|
+
function createCapabilities(supportedEfforts, supportsStrictToolSchemas, reasoningMode) {
|
|
213
213
|
return {
|
|
214
214
|
reasoning: {
|
|
215
|
-
mode:
|
|
215
|
+
mode: reasoningMode,
|
|
216
216
|
supportedEfforts,
|
|
217
217
|
restrictsSamplingParams: true,
|
|
218
218
|
supportedToolChoices: ["auto", "none"]
|
|
@@ -234,6 +234,7 @@ var ADAPTIVE_MAX_EFFORT_MODELS = /* @__PURE__ */ new Set([
|
|
|
234
234
|
"claude-fable-5",
|
|
235
235
|
"claude-mythos-5",
|
|
236
236
|
"claude-mythos-preview",
|
|
237
|
+
"claude-opus-5-5",
|
|
237
238
|
"claude-opus-5",
|
|
238
239
|
"claude-opus-4-8",
|
|
239
240
|
"claude-opus-4-7",
|
|
@@ -274,10 +275,12 @@ var MANUAL_INTERLEAVED_THINKING_MODELS = /* @__PURE__ */ new Set([
|
|
|
274
275
|
"claude-opus-4",
|
|
275
276
|
"claude-sonnet-4"
|
|
276
277
|
]);
|
|
278
|
+
var ALWAYS_ON_THINKING_MODELS = /* @__PURE__ */ new Set(["claude-opus-5-5"]);
|
|
277
279
|
var ALWAYS_RESTRICTED_SAMPLING_MODELS = /* @__PURE__ */ new Set([
|
|
278
280
|
"claude-fable-5",
|
|
279
281
|
"claude-mythos-5",
|
|
280
282
|
"claude-mythos-preview",
|
|
283
|
+
"claude-opus-5-5",
|
|
281
284
|
"claude-opus-5",
|
|
282
285
|
"claude-opus-4-8",
|
|
283
286
|
"claude-opus-4-7",
|
|
@@ -300,7 +303,8 @@ function getAnthropicModelCapabilities(modelId) {
|
|
|
300
303
|
const supportedEfforts = supportsAnthropicMaxEffort(modelId) || getAnthropicThinkingMode(modelId) === "manual" ? MAX_EFFORTS : STANDARD_EFFORTS;
|
|
301
304
|
return createCapabilities(
|
|
302
305
|
supportedEfforts,
|
|
303
|
-
supportsAnthropicStrictToolSchemas(modelId)
|
|
306
|
+
supportsAnthropicStrictToolSchemas(modelId),
|
|
307
|
+
isAnthropicThinkingAlwaysOn(modelId) ? "always-on" : "optional"
|
|
304
308
|
);
|
|
305
309
|
}
|
|
306
310
|
function normalizeModelId(modelId) {
|
|
@@ -312,6 +316,9 @@ function getAnthropicThinkingMode(modelId) {
|
|
|
312
316
|
function supportsAnthropicMaxEffort(modelId) {
|
|
313
317
|
return ADAPTIVE_MAX_EFFORT_MODELS.has(normalizeModelId(modelId));
|
|
314
318
|
}
|
|
319
|
+
function isAnthropicThinkingAlwaysOn(modelId) {
|
|
320
|
+
return ALWAYS_ON_THINKING_MODELS.has(normalizeModelId(modelId));
|
|
321
|
+
}
|
|
315
322
|
function supportsAnthropicStrictToolSchemas(modelId) {
|
|
316
323
|
return !NON_STRICT_TOOL_SCHEMA_MODELS.has(normalizeModelId(modelId));
|
|
317
324
|
}
|
|
@@ -703,7 +710,8 @@ function validateAnthropicReasoningConfig(modelId, maxTokens, options, anthropic
|
|
|
703
710
|
provider
|
|
704
711
|
);
|
|
705
712
|
}
|
|
706
|
-
|
|
713
|
+
const reasoningActive = options.reasoning !== void 0 || capabilities.reasoning.mode === "always-on";
|
|
714
|
+
if (!reasoningActive) {
|
|
707
715
|
return;
|
|
708
716
|
}
|
|
709
717
|
if (getAnthropicThinkingMode(modelId) === "manual" && maxTokens <= 1024) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@core-ai/anthropic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Anthropic provider package for @core-ai/core-ai",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Omnifact (https://omnifact.ai)",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@anthropic-ai/sdk": "^0.110.0",
|
|
48
|
-
"@core-ai/core-ai": "^0.
|
|
48
|
+
"@core-ai/core-ai": "^0.27.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^4.0.0"
|