Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 2 #1065

Closed
wants to merge 3 commits into from
Closed

Fixes 2 #1065

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/agents/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
}
]
Expand Down
6 changes: 6 additions & 0 deletions core/llm/anthropic_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Maximum number of tokens supported by Anthropic Claude 3
MAX_TOKENS = 4096
MAX_TOKENS_SONNET = 8192


class AnthropicClient(BaseLLMClient):
Expand Down Expand Up @@ -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"}

Expand Down
4 changes: 2 additions & 2 deletions core/templates/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from core.log import get_logger

from .node_express_mongoose import NodeExpressMongooseProjectTemplate
from .react_express import ReactExpressProjectTemplate

Check failure on line 6 in core/templates/registry.py

View workflow job for this annotation

GitHub Actions / build (3.9, ubuntu-latest)

Ruff (F401)

core/templates/registry.py:6:28: F401 `.react_express.ReactExpressProjectTemplate` imported but unused

Check failure on line 6 in core/templates/registry.py

View workflow job for this annotation

GitHub Actions / build (3.9, macos-latest)

Ruff (F401)

core/templates/registry.py:6:28: F401 `.react_express.ReactExpressProjectTemplate` imported but unused

Check failure on line 6 in core/templates/registry.py

View workflow job for this annotation

GitHub Actions / build (3.9, windows-latest)

Ruff (F401)

core\templates\registry.py:6:28: F401 `.react_express.ReactExpressProjectTemplate` imported but unused

Check failure on line 6 in core/templates/registry.py

View workflow job for this annotation

GitHub Actions / build (3.12, ubuntu-latest)

Ruff (F401)

core/templates/registry.py:6:28: F401 `.react_express.ReactExpressProjectTemplate` imported but unused

Check failure on line 6 in core/templates/registry.py

View workflow job for this annotation

GitHub Actions / build (3.12, macos-latest)

Ruff (F401)

core/templates/registry.py:6:28: F401 `.react_express.ReactExpressProjectTemplate` imported but unused

Check failure on line 6 in core/templates/registry.py

View workflow job for this annotation

GitHub Actions / build (3.12, windows-latest)

Ruff (F401)

core\templates\registry.py:6:28: F401 `.react_express.ReactExpressProjectTemplate` imported but unused

log = get_logger(__name__)

Expand All @@ -13,11 +13,11 @@

# 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,
}
Loading