mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-20 05:08:00 +00:00
fix
This commit is contained in:
parent
7f81b6b558
commit
f855262848
@ -1095,6 +1095,7 @@ class LollmsApplication(LoLLMsCom):
|
|||||||
"--- discussion --",
|
"--- discussion --",
|
||||||
f"{discussion[-2048:]}",
|
f"{discussion[-2048:]}",
|
||||||
"---",
|
"---",
|
||||||
|
"Make sure to write the RAG vector database query in your output json code."
|
||||||
])
|
])
|
||||||
template = """{
|
template = """{
|
||||||
"query": "[the rag query deduced from the last messge in the discussion]"
|
"query": "[the rag query deduced from the last messge in the discussion]"
|
||||||
@ -1104,8 +1105,12 @@ class LollmsApplication(LoLLMsCom):
|
|||||||
if query is None:
|
if query is None:
|
||||||
query = current_message.content
|
query = current_message.content
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
query = json.loads(query)
|
query = json.loads(query)
|
||||||
query = query["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")
|
self.personality.step_end("Building vector store query")
|
||||||
ASCIIColors.magenta(f"Query: {query}")
|
ASCIIColors.magenta(f"Query: {query}")
|
||||||
self.personality.step(f"Query: {query}")
|
self.personality.step(f"Query: {query}")
|
||||||
|
Loading…
Reference in New Issue
Block a user