@ai-sdk/anthropic 3.0.64 → 3.0.66
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/CHANGELOG.md +15 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +2 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +2 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/anthropic-messages-language-model.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.66",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ai-sdk/provider": "3.0.8",
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.22"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -272,6 +272,8 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
272
272
|
isKnownModel,
|
|
273
273
|
} = getModelCapabilities(this.modelId);
|
|
274
274
|
|
|
275
|
+
const isAnthropicModel = isKnownModel || this.modelId.startsWith('claude-');
|
|
276
|
+
|
|
275
277
|
const supportsStructuredOutput =
|
|
276
278
|
(this.config.supportsNativeStructuredOutput ?? true) &&
|
|
277
279
|
modelSupportsStructuredOutput;
|
|
@@ -535,8 +537,10 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
535
537
|
// adjust max tokens to account for thinking:
|
|
536
538
|
baseArgs.max_tokens = maxTokens + (thinkingBudget ?? 0);
|
|
537
539
|
} else {
|
|
538
|
-
// Only check temperature/topP mutual exclusivity
|
|
539
|
-
|
|
540
|
+
// Only check temperature/topP mutual exclusivity for known Anthropic models
|
|
541
|
+
// when thinking is not enabled. Non-Anthropic models using the Anthropic-compatible
|
|
542
|
+
// API (e.g. Minimax) may require both parameters to be set.
|
|
543
|
+
if (isAnthropicModel && topP != null && temperature != null) {
|
|
540
544
|
warnings.push({
|
|
541
545
|
type: 'unsupported',
|
|
542
546
|
feature: 'topP',
|