Added support for Claude 4 models to Anthropic provider (#482)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-05-25 15:53:47 +02:00
1 parent baa80beb92
commit 05544eca15
2 files changed
+12 -1

No files matched your search

@@ -89,6 +89,8 @@ public sealed class ProviderAnthropic(ILogger logger) : BaseProvider("https://ap
{
var additionalModels = new[]
{
new Model("claude-opus-4-0", "Claude Opus 4.0 (Latest)"),
new Model("claude-sonnet-4-0", "Claude Sonnet 4.0 (Latest)"),
new Model("claude-3-7-sonnet-latest", "Claude 3.7 Sonnet (Latest)"),
new Model("claude-3-5-sonnet-latest", "Claude 3.5 Sonnet (Latest)"),
new Model("claude-3-5-haiku-latest", "Claude 3.5 Haiku (Latest)"),
@@ -114,6 +116,14 @@ public sealed class ProviderAnthropic(ILogger logger) : BaseProvider("https://ap
{
var modelName = model.Id.ToLowerInvariant().AsSpan();
// Claude 4.x models:
if(modelName.StartsWith("claude-opus-4") || modelName.StartsWith("claude-sonnet-4"))
return [
Capability.TEXT_INPUT, Capability.MULTIPLE_IMAGE_INPUT,
Capability.TEXT_OUTPUT,
Capability.OPTIONAL_REASONING, Capability.FUNCTION_CALLING];
// Claude 3.7 is able to do reasoning:
if(modelName.StartsWith("claude-3-7"))
return [