update config.json default models

This commit is contained in:
LeonOstrez
2024-07-30 14:54:41 +02:00
parent 5a081ebf0d
commit 4259df9700
4 changed files with 29 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
from core.agents.base import BaseAgent from core.agents.base import BaseAgent
from core.agents.convo import AgentConvo from core.agents.convo import AgentConvo
from core.agents.response import AgentResponse, ResponseType 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 import Complexity
from core.db.models.project_state import IterationStatus from core.db.models.project_state import IterationStatus
from core.llm.parser import StringParser from core.llm.parser import StringParser
@@ -95,7 +96,7 @@ class SpecWriter(BaseAgent):
await self.send_message( await self.send_message(
f"Making the following changes to project specification:\n\n{feature_description}\n\nUpdated project specification:" 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) convo = AgentConvo(self).template("add_new_feature", feature_description=feature_description)
llm_response: str = await llm(convo, temperature=0, parser=StringParser()) llm_response: str = await llm(convo, temperature=0, parser=StringParser())
updated_spec = llm_response.strip() updated_spec = llm_response.strip()
@@ -124,7 +125,7 @@ class SpecWriter(BaseAgent):
async def check_prompt_complexity(self, prompt: str) -> str: async def check_prompt_complexity(self, prompt: str) -> str:
await self.send_message("Checking the complexity of the prompt ...") 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) convo = AgentConvo(self).template("prompt_complexity", prompt=prompt)
llm_response: str = await llm(convo, temperature=0, parser=StringParser()) llm_response: str = await llm(convo, temperature=0, parser=StringParser())
return llm_response.lower() return llm_response.lower()
@@ -154,7 +155,7 @@ class SpecWriter(BaseAgent):
) )
await self.send_message(msg) 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) convo = AgentConvo(self).template("ask_questions").user(spec)
n_questions = 0 n_questions = 0
n_answers = 0 n_answers = 0
@@ -204,7 +205,7 @@ class SpecWriter(BaseAgent):
async def review_spec(self, spec: str) -> str: async def review_spec(self, spec: str) -> str:
convo = AgentConvo(self).template("review_spec", spec=spec) 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) llm_response: str = await llm(convo, temperature=0)
additional_info = llm_response.strip() additional_info = llm_response.strip()
if additional_info and len(additional_info) > 6: if additional_info and len(additional_info) > 6:

View File

@@ -27,7 +27,7 @@ def parse_llm_endpoint(value: str) -> Optional[tuple[LLMProvider, str]]:
Option syntax is: --llm-endpoint <provider>:<url> Option syntax is: --llm-endpoint <provider>:<url>
:param value: Argument value. :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: if not value:
return None return None

View File

@@ -38,6 +38,7 @@ CODE_MONKEY_AGENT_NAME = "CodeMonkey"
DESCRIBE_FILES_AGENT_NAME = "CodeMonkey.describe_files" DESCRIBE_FILES_AGENT_NAME = "CodeMonkey.describe_files"
CHECK_LOGS_AGENT_NAME = "BugHunter.check_logs" CHECK_LOGS_AGENT_NAME = "BugHunter.check_logs"
TASK_BREAKDOWN_AGENT_NAME = "Developer.breakdown_current_task" TASK_BREAKDOWN_AGENT_NAME = "Developer.breakdown_current_task"
SPEC_WRITER_AGENT_NAME = "SpecWriter"
# Endpoint for the external documentation # Endpoint for the external documentation
EXTERNAL_DOCUMENTATION_API = "http://docs-pythagora-io-439719575.us-east-1.elb.amazonaws.com" EXTERNAL_DOCUMENTATION_API = "http://docs-pythagora-io-439719575.us-east-1.elb.amazonaws.com"
@@ -112,7 +113,7 @@ class AgentLLMConfig(_StrictModel):
AgentLLMConfig is not specified, default will be used. 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") model: str = Field(description="Model to use", default="gpt-4o-2024-05-13")
temperature: float = Field( temperature: float = Field(
default=0.5, default=0.5,
@@ -318,8 +319,17 @@ class Config(_StrictModel):
DEFAULT_AGENT_NAME: AgentLLMConfig(), DEFAULT_AGENT_NAME: AgentLLMConfig(),
CODE_MONKEY_AGENT_NAME: AgentLLMConfig(model="gpt-4-0125-preview", temperature=0.0), 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), 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), CHECK_LOGS_AGENT_NAME: AgentLLMConfig(
TASK_BREAKDOWN_AGENT_NAME: AgentLLMConfig(model="claude-3-5-sonnet-20240620", temperature=0.5), 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() prompt: PromptConfig = PromptConfig()

View File

@@ -52,6 +52,16 @@
"provider": "anthropic", "provider": "anthropic",
"model": "claude-3-5-sonnet-20240620", "model": "claude-3-5-sonnet-20240620",
"temperature": 0.0 "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, // Logging configuration outputs debug log to "pythagora.log" by default. If you set this to null,