From 7fc09b2c642cc1f84f6c4ee87b63f4f4eff8dd94 Mon Sep 17 00:00:00 2001 From: avidelatm Date: Wed, 28 May 2025 13:38:02 -0700 Subject: [PATCH] chore: Adding regex for claude-4 models to anthropic_llm and updating tests Copybara import of the project: -- 824b4379d59a375191f8ce10997efd4021d5d0b3 by Andres Videla : Adding regex for claude-4 models to anthropic_llm and updating tests -- 8fa2a2df1931026dc803eee0e9b60e82e90c9efa by Wei Sun (Jack) : Adds trailing comma. COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/934 from avidelatm:feature/add-support-for-claude-4-models-to-anthropic_llm 8d10bacdbec952ec9832180ac6c1d220916641da PiperOrigin-RevId: 764396694 --- src/google/adk/models/anthropic_llm.py | 2 +- tests/unittests/models/test_models.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/google/adk/models/anthropic_llm.py b/src/google/adk/models/anthropic_llm.py index 0c635e2..9fbaaee 100644 --- a/src/google/adk/models/anthropic_llm.py +++ b/src/google/adk/models/anthropic_llm.py @@ -208,7 +208,7 @@ class Claude(BaseLlm): @staticmethod @override def supported_models() -> list[str]: - return [r"claude-3-.*"] + return [r"claude-3-.*", r"claude-.*-4.*"] @override async def generate_content_async( diff --git a/tests/unittests/models/test_models.py b/tests/unittests/models/test_models.py index fb21171..70246c7 100644 --- a/tests/unittests/models/test_models.py +++ b/tests/unittests/models/test_models.py @@ -46,6 +46,8 @@ def test_match_gemini_family(model_name): 'claude-3-haiku@20240307', 'claude-3-opus@20240229', 'claude-3-sonnet@20240229', + 'claude-sonnet-4@20250514', + 'claude-opus-4@20250514', ], ) def test_match_claude_family(model_name):