added conditionning to better answer the user

This commit is contained in:
saloui 2023-12-21 08:03:31 +01:00
parent 6a9595fed1
commit e042ef49d9

View File

@ -1487,6 +1487,7 @@ class LoLLMsAPI(LollmsApplication):
docs, sorted_similarities = self.personality.vectorizer.recover_text(query, top_k=self.config.data_vectorization_nb_chunks) docs, sorted_similarities = self.personality.vectorizer.recover_text(query, top_k=self.config.data_vectorization_nb_chunks)
for doc, infos in zip(docs, sorted_similarities): for doc, infos in zip(docs, sorted_similarities):
documentation += f"document chunk:\nchunk path: {infos[0]}\nchunk content:{doc}" documentation += f"document chunk:\nchunk path: {infos[0]}\nchunk content:{doc}"
documentation += "\nrequest: Use the documentation data to answer the user questions. If the data is not present in the documentation, please notify the user."
except: except:
self.warning("Couldn't add documentation to the context. Please verify the vector database") self.warning("Couldn't add documentation to the context. Please verify the vector database")
# Check if there is discussion history to add to the prompt # Check if there is discussion history to add to the prompt