Skip to content

Commit

Permalink
add verification for stackvm (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
IANTHEREAL authored Dec 14, 2024
1 parent 10ca9eb commit 3322cd1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/app/rag/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,17 @@ def _external_chat(self) -> Generator[ChatEvent | str, None, None]:

response_text = stackvm_response_text
base_url = stream_chat_api_url.replace("/api/stream_execute_vm", "")
try:
post_verification_result_url = self._post_verification(
goal,
response_text,
self.db_chat_obj.id,
db_assistant_message.id,
)
db_assistant_message.post_verification_result_url = post_verification_result_url
except Exception as e:
logger.error("Specific error occurred during post verification job.", exc_info=True)

db_assistant_message.content = response_text
db_assistant_message.trace_url = (
f"{base_url}?task_id={task_id}" if task_id else ""
Expand Down Expand Up @@ -920,6 +931,7 @@ def _external_chat(self) -> Generator[ChatEvent | str, None, None]:
),
)


def _parse_chat_messages(
self, chat_messages: List[ChatMessage]
) -> tuple[str, List[ChatMessage]]:
Expand Down

0 comments on commit 3322cd1

Please sign in to comment.