Skip to content

Commit

Permalink
update config.json default models
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonOstrez committed Jul 30, 2024
1 parent 5a081eb commit 4259df9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
9 changes: 5 additions & 4 deletions core/agents/spec_writer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from core.agents.base import BaseAgent
from core.agents.convo import AgentConvo
from core.agents.response import AgentResponse, ResponseType
from core.config import SPEC_WRITER_AGENT_NAME
from core.db.models import Complexity
from core.db.models.project_state import IterationStatus
from core.llm.parser import StringParser
Expand Down Expand Up @@ -95,7 +96,7 @@ async def update_spec(self, iteration_mode) -> AgentResponse:
await self.send_message(
f"Making the following changes to project specification:\n\n{feature_description}\n\nUpdated project specification:"
)
llm = self.get_llm()
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
convo = AgentConvo(self).template("add_new_feature", feature_description=feature_description)
llm_response: str = await llm(convo, temperature=0, parser=StringParser())
updated_spec = llm_response.strip()
Expand Down Expand Up @@ -124,7 +125,7 @@ async def update_spec(self, iteration_mode) -> AgentResponse:

async def check_prompt_complexity(self, prompt: str) -> str:
await self.send_message("Checking the complexity of the prompt ...")
llm = self.get_llm()
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
convo = AgentConvo(self).template("prompt_complexity", prompt=prompt)
llm_response: str = await llm(convo, temperature=0, parser=StringParser())
return llm_response.lower()
Expand Down Expand Up @@ -154,7 +155,7 @@ async def analyze_spec(self, spec: str) -> str:
)
await self.send_message(msg)

llm = self.get_llm()
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
convo = AgentConvo(self).template("ask_questions").user(spec)
n_questions = 0
n_answers = 0
Expand Down Expand Up @@ -204,7 +205,7 @@ async def analyze_spec(self, spec: str) -> str:

async def review_spec(self, spec: str) -> str:
convo = AgentConvo(self).template("review_spec", spec=spec)
llm = self.get_llm()
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
llm_response: str = await llm(convo, temperature=0)
additional_info = llm_response.strip()
if additional_info and len(additional_info) > 6:
Expand Down
2 changes: 1 addition & 1 deletion core/cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def parse_llm_endpoint(value: str) -> Optional[tuple[LLMProvider, str]]:
Option syntax is: --llm-endpoint <provider>:<url>
:param value: Argument value.
:return: Tuple with LLM provider and URL, or None if if the option wasn't provided.
:return: Tuple with LLM provider and URL, or None if the option wasn't provided.
"""
if not value:
return None
Expand Down
16 changes: 13 additions & 3 deletions core/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
DESCRIBE_FILES_AGENT_NAME = "CodeMonkey.describe_files"
CHECK_LOGS_AGENT_NAME = "BugHunter.check_logs"
TASK_BREAKDOWN_AGENT_NAME = "Developer.breakdown_current_task"
SPEC_WRITER_AGENT_NAME = "SpecWriter"

# Endpoint for the external documentation
EXTERNAL_DOCUMENTATION_API = "http://docs-pythagora-io-439719575.us-east-1.elb.amazonaws.com"
Expand Down Expand Up @@ -112,7 +113,7 @@ class AgentLLMConfig(_StrictModel):
AgentLLMConfig is not specified, default will be used.
"""

provider: LLMProvider = LLMProvider.OPENAI
provider: Optional[LLMProvider] = Field(default=LLMProvider.OPENAI, description="LLM provider")
model: str = Field(description="Model to use", default="gpt-4o-2024-05-13")
temperature: float = Field(
default=0.5,
Expand Down Expand Up @@ -318,8 +319,17 @@ class Config(_StrictModel):
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),
CHECK_LOGS_AGENT_NAME: AgentLLMConfig(model="claude-3-5-sonnet-20240620", temperature=0.5),
TASK_BREAKDOWN_AGENT_NAME: AgentLLMConfig(model="claude-3-5-sonnet-20240620", temperature=0.5),
CHECK_LOGS_AGENT_NAME: AgentLLMConfig(
provider=LLMProvider.ANTHROPIC,
model="claude-3-5-sonnet-20240620",
temperature=0.5,
),
TASK_BREAKDOWN_AGENT_NAME: AgentLLMConfig(
provider=LLMProvider.ANTHROPIC,
model="claude-3-5-sonnet-20240620",
temperature=0.5,
),
SPEC_WRITER_AGENT_NAME: AgentLLMConfig(model="gpt-4-0125-preview", temperature=0.0),
}
)
prompt: PromptConfig = PromptConfig()
Expand Down
10 changes: 10 additions & 0 deletions example-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
"provider": "anthropic",
"model": "claude-3-5-sonnet-20240620",
"temperature": 0.0
},
"Developer.breakdown_current_task": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20240620",
"temperature": 0.5
},
"SpecWriter": {
"provider": "openai",
"model": "gpt-4-0125-preview",
"temperature": 0.5
}
},
// Logging configuration outputs debug log to "pythagora.log" by default. If you set this to null,
Expand Down

0 comments on commit 4259df9

Please sign in to comment.