@ai-sdk/anthropic 3.0.100 → 3.0.101
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 +6 -0
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +13 -1
- package/dist/internal/index.d.ts +13 -1
- package/dist/internal/index.js +17 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-language-model.ts +21 -2
- package/src/internal/index.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 3.0.101
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0608dca: fix (provider/anthropic): use current-generation capability defaults for unrecognized Claude model IDs while retaining conservative defaults for legacy Claude and non-Claude models.
|
|
8
|
+
|
|
3
9
|
## 3.0.100
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
32
32
|
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
33
33
|
|
|
34
34
|
// src/version.ts
|
|
35
|
-
var VERSION = true ? "3.0.
|
|
35
|
+
var VERSION = true ? "3.0.101" : "0.0.0-test";
|
|
36
36
|
|
|
37
37
|
// src/anthropic-messages-language-model.ts
|
|
38
38
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -3429,7 +3429,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3429
3429
|
topP = void 0;
|
|
3430
3430
|
}
|
|
3431
3431
|
}
|
|
3432
|
-
const isAnthropicModel = isKnownModel || this.modelId.
|
|
3432
|
+
const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
|
|
3433
3433
|
const supportsStructuredOutput = ((_a = this.config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
3434
3434
|
const supportsStrictTools = ((_b = this.config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
3435
3435
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
@@ -5247,6 +5247,20 @@ function getModelCapabilities(modelId) {
|
|
|
5247
5247
|
rejectsSamplingParameters: false,
|
|
5248
5248
|
isKnownModel: true
|
|
5249
5249
|
};
|
|
5250
|
+
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
5251
|
+
return {
|
|
5252
|
+
maxOutputTokens: 4096,
|
|
5253
|
+
supportsStructuredOutput: false,
|
|
5254
|
+
rejectsSamplingParameters: false,
|
|
5255
|
+
isKnownModel: false
|
|
5256
|
+
};
|
|
5257
|
+
} else if (modelId.includes("claude-")) {
|
|
5258
|
+
return {
|
|
5259
|
+
maxOutputTokens: 128e3,
|
|
5260
|
+
supportsStructuredOutput: true,
|
|
5261
|
+
rejectsSamplingParameters: true,
|
|
5262
|
+
isKnownModel: false
|
|
5263
|
+
};
|
|
5250
5264
|
} else {
|
|
5251
5265
|
return {
|
|
5252
5266
|
maxOutputTokens: 4096,
|