@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/package.json
CHANGED
|
@@ -317,7 +317,7 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
const isAnthropicModel = isKnownModel || this.modelId.
|
|
320
|
+
const isAnthropicModel = isKnownModel || this.modelId.includes('claude-');
|
|
321
321
|
|
|
322
322
|
const supportsStructuredOutput =
|
|
323
323
|
(this.config.supportsNativeStructuredOutput ?? true) &&
|
|
@@ -2598,7 +2598,7 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
2598
2598
|
* @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
|
|
2599
2599
|
* @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
|
|
2600
2600
|
*/
|
|
2601
|
-
function getModelCapabilities(modelId: string): {
|
|
2601
|
+
export function getModelCapabilities(modelId: string): {
|
|
2602
2602
|
maxOutputTokens: number;
|
|
2603
2603
|
supportsStructuredOutput: boolean;
|
|
2604
2604
|
rejectsSamplingParameters: boolean;
|
|
@@ -2665,6 +2665,25 @@ function getModelCapabilities(modelId: string): {
|
|
|
2665
2665
|
rejectsSamplingParameters: false,
|
|
2666
2666
|
isKnownModel: true,
|
|
2667
2667
|
};
|
|
2668
|
+
} else if (
|
|
2669
|
+
/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)
|
|
2670
|
+
) {
|
|
2671
|
+
return {
|
|
2672
|
+
maxOutputTokens: 4096,
|
|
2673
|
+
supportsStructuredOutput: false,
|
|
2674
|
+
rejectsSamplingParameters: false,
|
|
2675
|
+
isKnownModel: false,
|
|
2676
|
+
};
|
|
2677
|
+
} else if (modelId.includes('claude-')) {
|
|
2678
|
+
// Known and legacy Claude families are handled above, so any remaining
|
|
2679
|
+
// Claude ID is assumed to be newer than the known list. Keep it unknown so
|
|
2680
|
+
// callers still receive the maxOutputTokens compatibility warning.
|
|
2681
|
+
return {
|
|
2682
|
+
maxOutputTokens: 128000,
|
|
2683
|
+
supportsStructuredOutput: true,
|
|
2684
|
+
rejectsSamplingParameters: true,
|
|
2685
|
+
isKnownModel: false,
|
|
2686
|
+
};
|
|
2668
2687
|
} else {
|
|
2669
2688
|
return {
|
|
2670
2689
|
maxOutputTokens: 4096,
|
package/src/internal/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
AnthropicMessagesLanguageModel,
|
|
3
|
+
getModelCapabilities,
|
|
4
|
+
} from '../anthropic-messages-language-model';
|
|
2
5
|
export { anthropicTools } from '../anthropic-tools';
|
|
3
6
|
export type { AnthropicMessagesModelId } from '../anthropic-messages-options';
|
|
4
7
|
export { prepareTools } from '../anthropic-prepare-tools';
|