diff --git a/core/agents/error_handler.py b/core/agents/error_handler.py index 66dbe05ce..0150bf3c1 100644 --- a/core/agents/error_handler.py +++ b/core/agents/error_handler.py @@ -111,7 +111,7 @@ async def handle_command_error(self, message: str, details: dict) -> AgentRespon "description": llm_response, "alternative_solutions": [], "attempts": 1, - "status": IterationStatus.HUNTING_FOR_BUG, + "status": IterationStatus.IMPLEMENT_SOLUTION, "bug_hunting_cycles": [], } ] diff --git a/core/llm/anthropic_client.py b/core/llm/anthropic_client.py index f458a7b2b..1fc7d1d01 100644 --- a/core/llm/anthropic_client.py +++ b/core/llm/anthropic_client.py @@ -15,6 +15,7 @@ # Maximum number of tokens supported by Anthropic Claude 3 MAX_TOKENS = 4096 +MAX_TOKENS_SONNET = 8192 class AnthropicClient(BaseLLMClient): @@ -72,6 +73,11 @@ async def _make_request( "messages": messages, "temperature": self.config.temperature if temperature is None else temperature, } + + if "sonnet" in self.config.model: + completion_kwargs["extra_headers"] = {"anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15"} + completion_kwargs["max_tokens"] = MAX_TOKENS_SONNET + if json_mode: completion_kwargs["response_format"] = {"type": "json_object"} diff --git a/core/templates/registry.py b/core/templates/registry.py index f52f89b89..6c865eea1 100644 --- a/core/templates/registry.py +++ b/core/templates/registry.py @@ -13,11 +13,11 @@ class ProjectTemplateEnum(str, Enum): # JAVASCRIPT_REACT = JavascriptReactProjectTemplate.name NODE_EXPRESS_MONGOOSE = NodeExpressMongooseProjectTemplate.name - REACT_EXPRESS = ReactExpressProjectTemplate.name + # REACT_EXPRESS = ReactExpressProjectTemplate.name PROJECT_TEMPLATES = { # JavascriptReactProjectTemplate.name: JavascriptReactProjectTemplate, NodeExpressMongooseProjectTemplate.name: NodeExpressMongooseProjectTemplate, - ReactExpressProjectTemplate.name: ReactExpressProjectTemplate, + # ReactExpressProjectTemplate.name: ReactExpressProjectTemplate, }