LeedsLibraries commited on
Commit
713369d
·
verified ·
1 Parent(s): b064247

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -579,18 +579,18 @@ INSTRUCTIONS:
579
  """
580
 
581
  if has_docs and SAFETY_CONFIG.get("allow_general_knowledge", True):
582
- return f"""You are an educational assistant that answers questions using provided document excerpts when relevant.
583
 
584
  {base_safety}
585
 
586
  CONTEXT:
587
  {conversation_context}
588
 
589
- DOCUMENT EXCERPTS:
590
  {document_snippets}
591
 
592
  STRATEGY:
593
- 1) If the question is answered by the excerpts: answer using them.
594
  2) If not covered by excerpts but still educational: say "This isn't in my documents, but here’s helpful context:" then answer from general knowledge.
595
  3) If unsafe/inappropriate: refuse politely.
596
 
@@ -598,19 +598,19 @@ STRATEGY:
598
  """
599
 
600
  if has_docs:
601
- return f"""You are an educational assistant focused strictly on the provided document excerpts.
602
 
603
  {base_safety}
604
 
605
  CONTEXT:
606
  {conversation_context}
607
 
608
- DOCUMENT EXCERPTS:
609
  {document_snippets}
610
 
611
  INSTRUCTIONS:
612
- - Use ONLY the excerpts to answer
613
- - If not in the excerpts, say so clearly
614
 
615
  {style_line}
616
  """
 
579
  """
580
 
581
  if has_docs and SAFETY_CONFIG.get("allow_general_knowledge", True):
582
+ return f"""You are an educational assistant that answers questions using provided document when relevant.
583
 
584
  {base_safety}
585
 
586
  CONTEXT:
587
  {conversation_context}
588
 
589
+ DOCUMENT:
590
  {document_snippets}
591
 
592
  STRATEGY:
593
+ 1) If the question is answered by the documents: answer using them.
594
  2) If not covered by excerpts but still educational: say "This isn't in my documents, but here’s helpful context:" then answer from general knowledge.
595
  3) If unsafe/inappropriate: refuse politely.
596
 
 
598
  """
599
 
600
  if has_docs:
601
+ return f"""You are an educational assistant focused strictly on the provided document.
602
 
603
  {base_safety}
604
 
605
  CONTEXT:
606
  {conversation_context}
607
 
608
+ DOCUMENT:
609
  {document_snippets}
610
 
611
  INSTRUCTIONS:
612
+ - Use ONLY the documents to answer
613
+ - If not in the documents, say so clearly
614
 
615
  {style_line}
616
  """