Skip to content

Commit

Permalink
enhanced rag
Browse files Browse the repository at this point in the history
  • Loading branch information
ParisNeo committed Dec 26, 2024
1 parent 3901f0b commit 4d2e198
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lollms/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,11 +1204,12 @@ def post_process(summary):

if documentation=="":
documentation=f"{self.separator_template}".join([
f"{self.separator_template}{self.start_header_id_template}important information{self.end_header_id_template}Utilize Documentation Data: Always refer to the provided documentation to answer user questions accurately.",
f"{self.system_custom_header('important information')}",
"Utilize Documentation Data: Always refer to the provided documentation to answer user questions accurately.",
"Absence of Information: If the required information is not available in the documentation, inform the user that the requested information is not present in the documentation section.",
"Strict Adherence to Documentation: It is strictly prohibited to provide answers without concrete evidence from the documentation.",
"Cite Your Sources: After providing an answer, include the full path to the document where the information was found.",
f"{self.start_header_id_template}Documentation{self.end_header_id_template}"])
f"{self.system_custom_header('Documentation')}"])
documentation += f"{self.separator_template}"
if query is None:
if self.config.rag_build_keys_words:
Expand All @@ -1229,11 +1230,13 @@ def post_process(summary):

if documentation=="":
documentation=f"{self.separator_template}".join([
f"{self.separator_template}{self.start_header_id_template}important information{self.end_header_id_template}Utilize Documentation Data: Always refer to the provided documentation to answer user questions accurately.",
"Absence of Information: If the required information is not available in the documentation, inform the user that the requested information is not present in the documentation section.",
"Strict Adherence to Documentation: It is strictly prohibited to provide answers without concrete evidence from the documentation.",
"Cite Your Sources: After providing an answer, include the full path to the document where the information was found.",
f"{self.start_header_id_template}Documentation{self.end_header_id_template}"])
f"{self.system_custom_header('important information')}",
"Utilize Documentation Data: Always refer to the provided documentation to answer user questions accurately.",
"Absence of Information: If the required information is not available in the documentation, inform the user that the requested information is not present in the documentation section.",
"Strict Adherence to Documentation: It is strictly prohibited to provide answers without concrete evidence from the documentation.",
"Cite Your Sources: After providing an answer, include the full path to the document where the information was found.",
f"{self.system_custom_header('Documentation')}"])

documentation += f"{self.separator_template}"

if query is None:
Expand Down

0 comments on commit 4d2e198

Please sign in to comment.