Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ParisNeo committed Dec 15, 2024
1 parent 7f81b6b commit f855262
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lollms/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ def prepare_query(self, client_id: str, message_id: int = -1, is_continue: bool
"--- discussion --",
f"{discussion[-2048:]}",
"---",
"Make sure to write the RAG vector database query in your output json code."
])
template = """{
"query": "[the rag query deduced from the last messge in the discussion]"
Expand All @@ -1104,8 +1105,12 @@ def prepare_query(self, client_id: str, message_id: int = -1, is_continue: bool
if query is None:
query = current_message.content
else:
query = json.loads(query)
query = query["query"]
try:
query = json.loads(query)
query = query["query"]
except Exception as ex:
ASCIIColors.error("failed to generate the query")
query = current_message.content
self.personality.step_end("Building vector store query")
ASCIIColors.magenta(f"Query: {query}")
self.personality.step(f"Query: {query}")
Expand Down

0 comments on commit f855262

Please sign in to comment.