Added test instructions sending to UI

pull/1160/head
matija-ilijas 2 years ago
parent 00c3087d23
commit d5eed516ce

@ -72,7 +72,9 @@ class Troubleshooter(IterationPromptMixin, RelevantFilesMixin, BaseAgent):
self.next_state.flag_tasks_as_modified()
return AgentResponse.done(self)
else:
await self.send_message("Here are instruction on how to test the app:\n\n" + user_instructions)
await self.send_message("Here are instructions on how to test the app:\n\n" + user_instructions)
await self.ui.send_test_instructions(user_instructions)
# Developer sets iteration as "completed" when it generates the step breakdown, so we can't
# use "current_iteration" here
@ -177,7 +179,7 @@ class Troubleshooter(IterationPromptMixin, RelevantFilesMixin, BaseAgent):
route_files = await self._get_route_files()
llm = self.get_llm(stream_output=True)
llm = self.get_llm()
convo = self._get_task_convo().template(
"define_user_review_goal", task=self.current_state.current_task, route_files=route_files
)

@ -316,6 +316,14 @@ class UIBase:
"""
raise NotImplementedError()
async def send_test_instructions(self, test_instructions: str):
"""
Send test instructions.
:param test_instructions: Test instructions.
"""
raise NotImplementedError()
async def send_file_status(self, file_path: str, file_status: str):
"""
Send file status.

@ -154,6 +154,9 @@ class PlainConsoleUI(UIBase):
async def send_project_stats(self, stats: dict):
pass
async def send_test_instructions(self, test_instructions: str):
pass
async def send_file_status(self, file_path: str, file_status: str):
pass

@ -49,6 +49,7 @@ class MessageType(str, Enum):
EPICS_AND_TASKS = "epicsAndTasks"
MODIFIED_FILES = "modifiedFiles"
IMPORTANT_STREAM = "importantStream"
TEST_INSTRUCTIONS = "testInstructions"
class Message(BaseModel):
@ -418,6 +419,14 @@ class IPCClientUI(UIBase):
content=stats,
)
async def send_test_instructions(self, test_instructions: str):
await self._send(
MessageType.TEST_INSTRUCTIONS,
content={
"test_instructions": test_instructions,
},
)
async def send_file_status(self, file_path: str, file_status: str):
await self._send(
MessageType.FILE_STATUS,

@ -150,6 +150,9 @@ class VirtualUI(UIBase):
async def send_project_stats(self, stats: dict):
pass
async def send_test_instructions(self, test_instructions: str):
pass
async def send_file_status(self, file_path: str, file_status: str):
pass

Loading…
Cancel
Save