This commit is contained in:
Zvonimir Sabljic
2025-02-02 12:01:01 +01:00
parent 0c78ae341e
commit b5b124c20d
3 changed files with 20 additions and 2 deletions

View File

@@ -229,12 +229,20 @@ class CodeMonkey(FileDiffMixin, BaseAgent):
task = self.current_state.current_task
current_task_index = self.current_state.tasks.index(task)
related_api_endpoints = task.get("related_api_endpoints", [])
# TODO: Temp fix for old projects
if not (
related_api_endpoints
and len(related_api_endpoints) > 0
and all(isinstance(api, dict) and "endpoint" in api for api in related_api_endpoints)
):
related_api_endpoints = []
convo = AgentConvo(self).template(
"breakdown",
task=task,
iteration=None,
current_task_index=current_task_index,
related_api_endpoints=task.get("related_api_endpoints", []),
related_api_endpoints=related_api_endpoints,
)
# TODO: We currently show last iteration to the code monkey; we might need to show the task
# breakdown and all the iterations instead? To think about when refactoring prompts

View File

@@ -219,6 +219,7 @@ class Developer(ChatWithBreakdownMixin, RelevantFilesMixin, BaseAgent):
await self.ui.start_breakdown_stream()
related_api_endpoints = current_task.get("related_api_endpoints", [])
llm = self.get_llm(TASK_BREAKDOWN_AGENT_NAME, stream_output=True)
# TODO: Temp fix for old projects
if not (
related_api_endpoints
and len(related_api_endpoints) > 0

View File

@@ -151,6 +151,15 @@ class Troubleshooter(ChatWithBreakdownMixin, IterationPromptMixin, RelevantFiles
task = self.current_state.current_task
current_task_index = self.current_state.tasks.index(task)
related_api_endpoints = task.get("related_api_endpoints", [])
# TODO: Temp fix for old projects
if not (
related_api_endpoints
and len(related_api_endpoints) > 0
and all(isinstance(api, dict) and "endpoint" in api for api in related_api_endpoints)
):
related_api_endpoints = []
return (
AgentConvo(self)
.template(
@@ -158,7 +167,7 @@ class Troubleshooter(ChatWithBreakdownMixin, IterationPromptMixin, RelevantFiles
task=task,
iteration=None,
current_task_index=current_task_index,
related_api_endpoints=task.get("related_api_endpoints", []),
related_api_endpoints=related_api_endpoints,
)
.assistant(self.current_state.current_task["instructions"])
)