From 25ddc603e8c3803859161f8c044cda7694b7e841 Mon Sep 17 00:00:00 2001 From: Takahiro Kikumoto Date: Sat, 31 May 2025 16:49:37 +0900 Subject: [PATCH] feat: Add Claude-4 thinking support - Support thinking for claude-sonnet-4 and claude-opus-4 - Add get_thinking_supported_models() for better maintainability --- .../pipelines/providers/anthropic_manifold_pipeline.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/pipelines/providers/anthropic_manifold_pipeline.py b/examples/pipelines/providers/anthropic_manifold_pipeline.py index 12ae634..7f3ebfa 100644 --- a/examples/pipelines/providers/anthropic_manifold_pipeline.py +++ b/examples/pipelines/providers/anthropic_manifold_pipeline.py @@ -68,6 +68,14 @@ class Pipeline: {"id": "claude-sonnet-4-20250514", "name": "claude-4-sonnet"}, ] + def get_thinking_supported_models(self): + """Returns list of model identifiers that support extended thinking""" + return [ + "claude-3-7", + "claude-sonnet-4", + "claude-opus-4" + ] + async def on_startup(self): print(f"on_startup:{__name__}") pass @@ -168,7 +176,7 @@ class Pipeline: } if body.get("stream", False): - supports_thinking = "claude-3-7" in model_id + supports_thinking = any(model in model_id for model in self.get_thinking_supported_models()) reasoning_effort = body.get("reasoning_effort", "none") budget_tokens = REASONING_EFFORT_BUDGET_TOKEN_MAP.get(reasoning_effort)