From 3364d9af371aa8c68ca1386ead09ce1c255164a4 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:56:06 +0530 Subject: [PATCH] fix: handle llm error, bump videodb chat --- backend/director/core/reasoning.py | 17 +++++++++++++---- frontend/package.json | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/backend/director/core/reasoning.py b/backend/director/core/reasoning.py index 4990a31..0c131f8 100644 --- a/backend/director/core/reasoning.py +++ b/backend/director/core/reasoning.py @@ -188,7 +188,18 @@ def step(self): logger.info(f"LLM Response: {llm_response}") if not llm_response.status: - # TODO: Handle llm error + self.output_message.content.append( + TextContent( + text=llm_response.content, + status=MsgStatus.error, + status_message="Error in reasoning", + agent_name="assistant", + ) + ) + self.output_message.actions.append("Failed to reason the message") + self.output_message.status = MsgStatus.error + self.output_message.publish() + self.stop() break if llm_response.tool_calls: @@ -234,9 +245,7 @@ def step(self): ) if self.iterations == self.max_iterations - 1: # Direct response case - self.summary_content.status_message = ( - "Here is the the response" - ) + self.summary_content.status_message = "Here is the response" self.summary_content.text = llm_response.content self.summary_content.status = MsgStatus.success else: diff --git a/frontend/package.json b/frontend/package.json index 7fce820..d9c6c18 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "@videodb/chat-vue": "^0.0.5", + "@videodb/chat-vue": "~0.0.6", "@videodb/player-vue": "^0.0.2", "axios": "^1.7.5", "dayjs": "^1.11.13",