Skip to content

Commit fc96651

Browse files
committed
Revert "bug fix"
This reverts commit feab1e6.
1 parent a3a0963 commit fc96651

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed
-7.61 KB
Binary file not shown.

agents/generator.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ def create_prompt(self, query: str, context_chunks: list[dict], query_analysis:
105105
intent_type = query_analysis.get("intent_type", "new_topic")
106106
conversation_topic = query_analysis.get("conversation_topic") # Can be None
107107

108-
prompt = f"""You are Yuhasa, an AI History Tutor specializing *only* in the provided Sri Lankan Grade 11 History textbook content OR explicitly marked web research.
109-
**IMPORTANT: Your knowledge is strictly limited to the information presented below in 'Textbook Context Information' and 'Web Research Information'. Do not use any external knowledge or make assumptions.**
110-
Your goal is to answer student questions accurately and concisely based *strictly* on the **Context Information** and **Web Research** (if provided) below.
108+
prompt = f"""You are Yuhasa, an AI History Tutor specializing *only* in the provided Sri Lankan Grade 11 History textbook content OR explicitly marked web research. Your goal is to answer student questions accurately and concisely based *strictly* on the **Context Information** and **Web Research** (if provided) below.
111109
112110
**Textbook Context Information:**
113111
"""
@@ -155,16 +153,15 @@ def create_prompt(self, query: str, context_chunks: list[dict], query_analysis:
155153
prompt += f"""
156154
157155
**Answering Rules:**
158-
1. Base answers *exclusively* on the provided **Textbook Context Information** or **Web Research Information**. Prioritize the Textbook Context. Do not use any other external knowledge.
156+
1. Prioritize answers from the **Textbook Context Information**. Base answers *exclusively* on the provided information (Textbook or Web). Do not use external knowledge unless it's in the **Web Research Information**.
159157
2. If the textbook context directly answers the question, provide the answer clearly and concisely.
160158
3. Cite **every** factual statement, detail, date, or name from the **Textbook Context** using the format `[p. PageNumber, Section: SectionName]`.
161159
4. If using information *only* from **Web Research**, clearly state this at the beginning of the relevant sentence or paragraph (e.g., "From web research: ...") and cite the source URL at the end using `(Source: URL)`. If combining info, cite both appropriately.
162160
5. If the textbook context contains partial information and web research supplements it, synthesize the answer, clearly indicating which part comes from which source and citing accordingly.
163161
6. If **neither** the Textbook Context nor the Web Research Information (if provided) contains relevant information to answer the question, state clearly: "Based on the provided textbook context and web research, I cannot answer the question about [specific topic of the question]." Do not apologize or use filler phrases.
164162
7. Structure multi-part answers or lists using Markdown.
165163
8. Maintain a neutral, informative, and direct tone. Avoid emojis, apologies, or unnecessary conversational filler.
166-
9. **Strict Rule:** Never hedge if the context provides a direct fact.
167-
10. **Strict Rule:** Never invent facts or information not present in the provided **Textbook Context** or **Web Research**.
164+
9. **Strict Rule:** Never hedge if the context provides a direct fact. Never invent facts or information not present in the provided **Textbook Context** or **Web Research**.
168165
169166
**Example Q&A Pairs:**
170167
{EXAMPLE_QA_PAIRS}

agents/query_analyzer.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,4 @@ def run(self, query: str, query_analysis: dict, initial_top_k: int = DEFAULT_HYB
274274
return []
275275

276276
expansion_time = time.time() - expansion_start_time
277-
logger.info(f"Step 2a: Query expansion & embedding took: {expansion_time:.4f}s") # Corrected this line
278-
279-
faiss_start_time = time.time()
280-
# ...existing code...
277+
logger.info(f"Step 2a: Query expansion

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ pypdf
66
python-dotenv
77
numpy
88
spacy
9-
nltk

0 commit comments

Comments
 (0)