Skip to content

Commit d24c721

Browse files
committed
RAG system ready
1 parent 2996e50 commit d24c721

File tree

3 files changed

+283
-160
lines changed

3 files changed

+283
-160
lines changed

app.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,10 @@ def check_document_fits_context(document_text, model_name, user_prompt=""):
343343
344344
CITATION GUIDELINES:
345345
- Use verbatim quotes in their original language (never translate)
346-
- Quote meaningful phrases (3-8 words) that provide context
347-
- Include descriptive context around numbers/measurements
346+
- Quote meaningful phrases (5-15 words) that provide sufficient context
347+
- Include descriptive context around numbers/measurements (e.g., "increased by 50% compared to" not just "50%")
348+
- Avoid very short snippets like single numbers, dates, or isolated words
349+
- Each citation should be substantial enough to be meaningful on its own
348350
- Each citation on its own line
349351
350352
LANGUAGE RULES:
@@ -1033,8 +1035,10 @@ def create_system_prompt(document_content, is_rag=False):
10331035
# Citation guidelines (shared)
10341036
citation_guidelines = """CITATION GUIDELINES:
10351037
- Use verbatim quotes in their original language (never translate)
1036-
- Quote meaningful phrases (3-8 words) that provide context
1037-
- Include descriptive context around numbers/measurements
1038+
- Quote meaningful phrases (5-15 words) that provide sufficient context
1039+
- Include descriptive context around numbers/measurements (e.g., "increased by 50% compared to" not just "50%")
1040+
- Avoid very short snippets like single numbers, dates, or isolated words
1041+
- Each citation should be substantial enough to be meaningful on its own
10381042
- Each citation on its own line"""
10391043

10401044
# Language rules (shared)

0 commit comments

Comments
 (0)