Skip to content

Commit 4259df9

Browse files
committed
update config.json default models
1 parent 5a081eb commit 4259df9

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

core/agents/spec_writer.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from core.agents.base import BaseAgent
22
from core.agents.convo import AgentConvo
33
from core.agents.response import AgentResponse, ResponseType
4+
from core.config import SPEC_WRITER_AGENT_NAME
45
from core.db.models import Complexity
56
from core.db.models.project_state import IterationStatus
67
from core.llm.parser import StringParser
@@ -95,7 +96,7 @@ async def update_spec(self, iteration_mode) -> AgentResponse:
9596
await self.send_message(
9697
f"Making the following changes to project specification:\n\n{feature_description}\n\nUpdated project specification:"
9798
)
98-
llm = self.get_llm()
99+
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
99100
convo = AgentConvo(self).template("add_new_feature", feature_description=feature_description)
100101
llm_response: str = await llm(convo, temperature=0, parser=StringParser())
101102
updated_spec = llm_response.strip()
@@ -124,7 +125,7 @@ async def update_spec(self, iteration_mode) -> AgentResponse:
124125

125126
async def check_prompt_complexity(self, prompt: str) -> str:
126127
await self.send_message("Checking the complexity of the prompt ...")
127-
llm = self.get_llm()
128+
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
128129
convo = AgentConvo(self).template("prompt_complexity", prompt=prompt)
129130
llm_response: str = await llm(convo, temperature=0, parser=StringParser())
130131
return llm_response.lower()
@@ -154,7 +155,7 @@ async def analyze_spec(self, spec: str) -> str:
154155
)
155156
await self.send_message(msg)
156157

157-
llm = self.get_llm()
158+
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
158159
convo = AgentConvo(self).template("ask_questions").user(spec)
159160
n_questions = 0
160161
n_answers = 0
@@ -204,7 +205,7 @@ async def analyze_spec(self, spec: str) -> str:
204205

205206
async def review_spec(self, spec: str) -> str:
206207
convo = AgentConvo(self).template("review_spec", spec=spec)
207-
llm = self.get_llm()
208+
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
208209
llm_response: str = await llm(convo, temperature=0)
209210
additional_info = llm_response.strip()
210211
if additional_info and len(additional_info) > 6:

core/cli/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def parse_llm_endpoint(value: str) -> Optional[tuple[LLMProvider, str]]:
2727
Option syntax is: --llm-endpoint <provider>:<url>
2828
2929
:param value: Argument value.
30-
:return: Tuple with LLM provider and URL, or None if if the option wasn't provided.
30+
:return: Tuple with LLM provider and URL, or None if the option wasn't provided.
3131
"""
3232
if not value:
3333
return None

core/config/__init__.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
DESCRIBE_FILES_AGENT_NAME = "CodeMonkey.describe_files"
3939
CHECK_LOGS_AGENT_NAME = "BugHunter.check_logs"
4040
TASK_BREAKDOWN_AGENT_NAME = "Developer.breakdown_current_task"
41+
SPEC_WRITER_AGENT_NAME = "SpecWriter"
4142

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

115-
provider: LLMProvider = LLMProvider.OPENAI
116+
provider: Optional[LLMProvider] = Field(default=LLMProvider.OPENAI, description="LLM provider")
116117
model: str = Field(description="Model to use", default="gpt-4o-2024-05-13")
117118
temperature: float = Field(
118119
default=0.5,
@@ -318,8 +319,17 @@ class Config(_StrictModel):
318319
DEFAULT_AGENT_NAME: AgentLLMConfig(),
319320
CODE_MONKEY_AGENT_NAME: AgentLLMConfig(model="gpt-4-0125-preview", temperature=0.0),
320321
DESCRIBE_FILES_AGENT_NAME: AgentLLMConfig(model="gpt-3.5-turbo", temperature=0.0),
321-
CHECK_LOGS_AGENT_NAME: AgentLLMConfig(model="claude-3-5-sonnet-20240620", temperature=0.5),
322-
TASK_BREAKDOWN_AGENT_NAME: AgentLLMConfig(model="claude-3-5-sonnet-20240620", temperature=0.5),
322+
CHECK_LOGS_AGENT_NAME: AgentLLMConfig(
323+
provider=LLMProvider.ANTHROPIC,
324+
model="claude-3-5-sonnet-20240620",
325+
temperature=0.5,
326+
),
327+
TASK_BREAKDOWN_AGENT_NAME: AgentLLMConfig(
328+
provider=LLMProvider.ANTHROPIC,
329+
model="claude-3-5-sonnet-20240620",
330+
temperature=0.5,
331+
),
332+
SPEC_WRITER_AGENT_NAME: AgentLLMConfig(model="gpt-4-0125-preview", temperature=0.0),
323333
}
324334
)
325335
prompt: PromptConfig = PromptConfig()

example-config.json

+10
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
"provider": "anthropic",
5353
"model": "claude-3-5-sonnet-20240620",
5454
"temperature": 0.0
55+
},
56+
"Developer.breakdown_current_task": {
57+
"provider": "anthropic",
58+
"model": "claude-3-5-sonnet-20240620",
59+
"temperature": 0.5
60+
},
61+
"SpecWriter": {
62+
"provider": "openai",
63+
"model": "gpt-4-0125-preview",
64+
"temperature": 0.5
5565
}
5666
},
5767
// Logging configuration outputs debug log to "pythagora.log" by default. If you set this to null,

0 commit comments

Comments
 (0)