@ai-sdk/anthropic 3.0.99 → 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 +12 -0
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -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 +24 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +23 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-language-model.ts +32 -2
- package/src/internal/index.ts +4 -1
package/dist/internal/index.mjs
CHANGED
|
@@ -3431,6 +3431,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3431
3431
|
rejectsSamplingParameters,
|
|
3432
3432
|
isKnownModel
|
|
3433
3433
|
} = getModelCapabilities(this.modelId);
|
|
3434
|
+
if (!isKnownModel && maxOutputTokens == null) {
|
|
3435
|
+
warnings.push({
|
|
3436
|
+
type: "compatibility",
|
|
3437
|
+
feature: "maxOutputTokens",
|
|
3438
|
+
details: `The model "${this.modelId}" is unknown. The max output tokens have been limited to ${maxOutputTokensForModel}. Set maxOutputTokens explicitly to override this limit.`
|
|
3439
|
+
});
|
|
3440
|
+
}
|
|
3434
3441
|
if (rejectsSamplingParameters) {
|
|
3435
3442
|
if (temperature != null) {
|
|
3436
3443
|
warnings.push({
|
|
@@ -3457,7 +3464,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3457
3464
|
topP = void 0;
|
|
3458
3465
|
}
|
|
3459
3466
|
}
|
|
3460
|
-
const isAnthropicModel = isKnownModel || this.modelId.
|
|
3467
|
+
const isAnthropicModel = isKnownModel || this.modelId.includes("claude-");
|
|
3461
3468
|
const supportsStructuredOutput = ((_a = this.config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
3462
3469
|
const supportsStrictTools = ((_b = this.config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
3463
3470
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
@@ -5275,6 +5282,20 @@ function getModelCapabilities(modelId) {
|
|
|
5275
5282
|
rejectsSamplingParameters: false,
|
|
5276
5283
|
isKnownModel: true
|
|
5277
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
|
+
};
|
|
5278
5299
|
} else {
|
|
5279
5300
|
return {
|
|
5280
5301
|
maxOutputTokens: 4096,
|
|
@@ -5904,6 +5925,7 @@ var anthropicTools = {
|
|
|
5904
5925
|
export {
|
|
5905
5926
|
AnthropicMessagesLanguageModel,
|
|
5906
5927
|
anthropicTools,
|
|
5928
|
+
getModelCapabilities,
|
|
5907
5929
|
prepareTools,
|
|
5908
5930
|
sanitizeJsonSchema
|
|
5909
5931
|
};
|