summaryrefslogtreecommitdiffstats
path: root/config.example.yaml
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-10-17 19:36:00 +0800
committerGitHub <noreply@github.com>2024-10-17 19:36:00 +0800
commitdb3a7b6ec2dee82df74fa055ab83b5a140cf49f0 (patch)
tree919f258da08eee675e2cefb30c31b3c2f05dd4b2 /config.example.yaml
parentaf1e57f7c6e3259be48783175289b158cd763a10 (diff)
downloadaichat-db3a7b6ec2dee82df74fa055ab83b5a140cf49f0.tar.gz
refactor: improve RAG search (#931)
Diffstat (limited to 'config.example.yaml')
-rw-r--r--config.example.yaml22
1 files changed, 14 insertions, 8 deletions
diff --git a/config.example.yaml b/config.example.yaml
index 9ca6692..c46fbf0 100644
--- a/config.example.yaml
+++ b/config.example.yaml
@@ -44,19 +44,25 @@ rag_min_score_vector_search: 0 # Specifies the minimum relevance sc
rag_min_score_keyword_search: 0 # Specifies the minimum relevance score for keyword-based searching
# Defines the query structure using variables like __CONTEXT__ and __INPUT__ to tailor searches to specific needs
rag_template: |
- Use the following context as your learned knowledge, inside <context></context> XML tags.
+ Answer the query based on the context while respecting the rules. (user query, some textual context and rules, all inside xml tags)
+
<context>
__CONTEXT__
</context>
- When answer to user:
- - If you don't know, just say that you don't know.
- - If you don't know when you are not sure, ask for clarification.
- Avoid mentioning that you obtained the information from the context.
- And answer according to the language of the user's question.
+ <rules>
+ - If you don't know, just say so.
+ - If you are not sure, ask for clarification.
+ - Answer in the same language as the user query.
+ - If the context appears unreadable or of poor quality, tell the user then answer as best as you can.
+ - If the answer is not in the context but you think you know the answer, explain that to the user then answer with your own knowledge.
+ - Answer directly and without using xml tags.
+ </rules>
+
+ <user_query>
+ __INPUT__
+ </user_query>
- Given the context information, answer the query.
- Query: __INPUT__
# Define document loaders to control how RAG and `.file`/`--file` load files of specific formats.
document_loaders:
# You can add custom loaders using the following syntax: