LiamKhoaLe commited on
Commit
0bbea58
·
1 Parent(s): 46db43c

Upd doc reasoning

Browse files
Files changed (1) hide show
  1. routes/chats.py +4 -4
routes/chats.py CHANGED
@@ -93,7 +93,6 @@ async def _generate_query_variations(question: str, nvidia_rotator) -> List[str]
93
  """
94
  if not nvidia_rotator:
95
  return [question] # Fallback to original question
96
-
97
  try:
98
  # Use NVIDIA to generate query variations
99
  sys_prompt = """You are an expert at query expansion and reformulation. Given a user question, generate 3-5 different ways to ask the same question that would help retrieve relevant information from a document database.
@@ -406,9 +405,10 @@ async def _chat_impl(
406
  file_summary_block = "\n".join(lines)
407
 
408
  system_prompt = (
409
- "You are a careful study assistant. Answer strictly using the given CONTEXT.\n"
410
- "If the answer isn't in the context, say 'I don't know based on the provided materials.'\n"
411
- "Write concise, clear explanations with citations like (source: actual_filename, topic).\n"
 
412
  "Use the exact filename as provided in the context, not placeholders.\n"
413
  )
414
 
 
93
  """
94
  if not nvidia_rotator:
95
  return [question] # Fallback to original question
 
96
  try:
97
  # Use NVIDIA to generate query variations
98
  sys_prompt = """You are an expert at query expansion and reformulation. Given a user question, generate 3-5 different ways to ask the same question that would help retrieve relevant information from a document database.
 
405
  file_summary_block = "\n".join(lines)
406
 
407
  system_prompt = (
408
+ "You are a careful study assistant. Prefer using the provided CONTEXT to answer.\n"
409
+ "If the CONTEXT is insufficient, you may use general knowledge responsibly, avoiding fabricated details.\n"
410
+ "Only say 'I don't know based on the provided materials.' when the question requires specific facts that are absent.\n"
411
+ "Always include citations to provided materials when you use them, formatted as (source: actual_filename, topic).\n"
412
  "Use the exact filename as provided in the context, not placeholders.\n"
413
  )
414