diff --git a/core/agents/code_monkey.py b/core/agents/code_monkey.py index 0a2674366..710da8dcd 100644 --- a/core/agents/code_monkey.py +++ b/core/agents/code_monkey.py @@ -5,7 +5,7 @@ from core.agents.base import BaseAgent from core.agents.convo import AgentConvo from core.agents.response import AgentResponse, ResponseType -from core.config import DESCRIBE_FILES_AGENT_NAME +from core.config import CODE_MONKEY_AGENT_NAME, DESCRIBE_FILES_AGENT_NAME from core.llm.parser import JSONParser, OptionalCodeBlockParser from core.log import get_logger @@ -56,7 +56,7 @@ async def implement_changes(self) -> AgentResponse: iterations = self.current_state.iterations user_feedback = None user_feedback_qa = None - llm = self.get_llm() + llm = self.get_llm(CODE_MONKEY_AGENT_NAME) if "task_review_feedback" in task and task["task_review_feedback"]: instructions = task.get("task_review_feedback") diff --git a/core/agents/troubleshooter.py b/core/agents/troubleshooter.py index 4f097ed03..fefd9cbad 100644 --- a/core/agents/troubleshooter.py +++ b/core/agents/troubleshooter.py @@ -7,7 +7,6 @@ from core.agents.convo import AgentConvo from core.agents.mixins import IterationPromptMixin from core.agents.response import AgentResponse -from core.config import ROUTE_FILES_AGENT_NAME from core.db.models.file import File from core.db.models.project_state import TaskStatus from core.llm.parser import JSONParser, OptionalCodeBlockParser @@ -158,7 +157,7 @@ async def get_user_instructions(self) -> Optional[str]: async def _get_route_files(self) -> list[File]: """Returns the list of file paths that have routes defined in them.""" - llm = self.get_llm(ROUTE_FILES_AGENT_NAME) + llm = self.get_llm() convo = AgentConvo(self).template("get_route_files").require_schema(RouteFilePaths) file_list = await llm(convo, parser=JSONParser(RouteFilePaths)) route_files: set[str] = set(file_list.files) diff --git a/core/config/__init__.py b/core/config/__init__.py index 20152e0fb..b7de2249d 100644 --- a/core/config/__init__.py +++ b/core/config/__init__.py @@ -34,8 +34,8 @@ # Agents with sane setup in the default configuration DEFAULT_AGENT_NAME = "default" +CODE_MONKEY_AGENT_NAME = "CodeMonkey" DESCRIBE_FILES_AGENT_NAME = "CodeMonkey.describe_files" -ROUTE_FILES_AGENT_NAME = "Troubleshooter.get_route_files" # Endpoint for the external documentation EXTERNAL_DOCUMENTATION_API = "http://docs-pythagora-io-439719575.us-east-1.elb.amazonaws.com" @@ -111,7 +111,7 @@ class AgentLLMConfig(_StrictModel): """ provider: LLMProvider = LLMProvider.OPENAI - model: str = Field(description="Model to use", default="gpt-4-0125-preview") + model: str = Field(description="Model to use", default="gpt-4o-2024-05-13") temperature: float = Field( default=0.5, description="Temperature to use for sampling", @@ -309,8 +309,8 @@ class Config(_StrictModel): agent: dict[str, AgentLLMConfig] = Field( default={ DEFAULT_AGENT_NAME: AgentLLMConfig(), + CODE_MONKEY_AGENT_NAME: AgentLLMConfig(model="gpt-4-0125-preview", temperature=0.0), DESCRIBE_FILES_AGENT_NAME: AgentLLMConfig(model="gpt-3.5-turbo", temperature=0.0), - ROUTE_FILES_AGENT_NAME: AgentLLMConfig(model="gpt-4o", temperature=0.0), } ) prompt: PromptConfig = PromptConfig() diff --git a/example-config.json b/example-config.json index 800845c7d..5afefdcfd 100644 --- a/example-config.json +++ b/example-config.json @@ -28,7 +28,7 @@ "agent": { "default": { "provider": "openai", - "model": "gpt-4o", + "model": "gpt-4o-2024-05-13", "temperature": 0.5 }, "CodeMonkey": { diff --git a/tests/config/test_config.py b/tests/config/test_config.py index ce97e8206..06b8692b1 100644 --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -65,7 +65,7 @@ def test_builtin_defaults(): config = ConfigLoader.from_json("{}") assert config.llm_for_agent().provider == LLMProvider.OPENAI - assert config.llm_for_agent().model == "gpt-4-0125-preview" + assert config.llm_for_agent().model == "gpt-4o-2024-05-13" assert config.llm_for_agent().base_url is None assert config.llm_for_agent().api_key is None