@ai-sdk/anthropic 4.0.0-beta.13 → 4.0.0-beta.15
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": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.15",
|
|
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": "4.0.0-beta.5",
|
|
40
|
-
"@ai-sdk/provider-utils": "5.0.0-beta.
|
|
40
|
+
"@ai-sdk/provider-utils": "5.0.0-beta.9"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -278,6 +278,8 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV4 {
|
|
|
278
278
|
isKnownModel,
|
|
279
279
|
} = getModelCapabilities(this.modelId);
|
|
280
280
|
|
|
281
|
+
const isAnthropicModel = isKnownModel || this.modelId.startsWith('claude-');
|
|
282
|
+
|
|
281
283
|
const supportsStructuredOutput =
|
|
282
284
|
(this.config.supportsNativeStructuredOutput ?? true) &&
|
|
283
285
|
modelSupportsStructuredOutput;
|
|
@@ -564,8 +566,10 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV4 {
|
|
|
564
566
|
// adjust max tokens to account for thinking:
|
|
565
567
|
baseArgs.max_tokens = maxTokens + (thinkingBudget ?? 0);
|
|
566
568
|
} else {
|
|
567
|
-
// Only check temperature/topP mutual exclusivity
|
|
568
|
-
|
|
569
|
+
// Only check temperature/topP mutual exclusivity for known Anthropic models
|
|
570
|
+
// when thinking is not enabled. Non-Anthropic models using the Anthropic-compatible
|
|
571
|
+
// API (e.g. Minimax) may require both parameters to be set.
|
|
572
|
+
if (isAnthropicModel && topP != null && temperature != null) {
|
|
569
573
|
warnings.push({
|
|
570
574
|
type: 'unsupported',
|
|
571
575
|
feature: 'topP',
|