@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/dist/internal/index.mjs
CHANGED
|
@@ -3464,7 +3464,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3464
3464
|
topP = void 0;
|
|
3465
3465
|
}
|
|
3466
3466
|
}
|
|
3467
|
-
const isAnthropicModel = isKnownModel || this.modelId.
|
|
3467
|
+
const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
|
|
3468
3468
|
const supportsStructuredOutput = ((_a = this.config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
3469
3469
|
const supportsStrictTools = ((_b = this.config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
3470
3470
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
@@ -5282,6 +5282,20 @@ function getModelCapabilities(modelId) {
|
|
|
5282
5282
|
rejectsSamplingParameters: false,
|
|
5283
5283
|
isKnownModel: true
|
|
5284
5284
|
};
|
|
5285
|
+
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
5286
|
+
return {
|
|
5287
|
+
maxOutputTokens: 4096,
|
|
5288
|
+
supportsStructuredOutput: false,
|
|
5289
|
+
rejectsSamplingParameters: false,
|
|
5290
|
+
isKnownModel: false
|
|
5291
|
+
};
|
|
5292
|
+
} else if (modelId.includes("claude-")) {
|
|
5293
|
+
return {
|
|
5294
|
+
maxOutputTokens: 128e3,
|
|
5295
|
+
supportsStructuredOutput: true,
|
|
5296
|
+
rejectsSamplingParameters: true,
|
|
5297
|
+
isKnownModel: false
|
|
5298
|
+
};
|
|
5285
5299
|
} else {
|
|
5286
5300
|
return {
|
|
5287
5301
|
maxOutputTokens: 4096,
|
|
@@ -5911,6 +5925,7 @@ var anthropicTools = {
|
|
|
5911
5925
|
export {
|
|
5912
5926
|
AnthropicMessagesLanguageModel,
|
|
5913
5927
|
anthropicTools,
|
|
5928
|
+
getModelCapabilities,
|
|
5914
5929
|
prepareTools,
|
|
5915
5930
|
sanitizeJsonSchema
|
|
5916
5931
|
};
|