vaishnaveswar commited on
Commit
7dbb9b2
·
verified ·
1 Parent(s): 0f57fd9

Update llm_setup/llm_setup.py

Browse files
Files changed (1) hide show
  1. llm_setup/llm_setup.py +4 -4
llm_setup/llm_setup.py CHANGED
@@ -40,10 +40,10 @@ class LLMService:
40
  Initializes the conversational RAG chain.
41
  """
42
  ### Contextualize question ###
43
- contextualize_q_system_prompt = """Given a chat history and the latest user question \
44
- which might reference context in the chat history, formulate a standalone question \
45
- which can be understood without the chat history. Do NOT answer the question, \
46
- just reformulate it if needed and otherwise return it as is."""
47
 
48
  contextualize_q_prompt = ChatPromptTemplate.from_messages(
49
  [
 
40
  Initializes the conversational RAG chain.
41
  """
42
  ### Contextualize question ###
43
+ contextualize_q_system_prompt = """Given the full chat history and the latest user message, \
44
+ rewrite the message as a fully self-contained question that can be understood without any prior context. \
45
+ Preserve intent and key entities, expand pronouns and references, and include necessary constraints, dates, or assumptions. \
46
+ Do not add new information, do not omit essential details, and do not answer the question. Return only the rewritten question."""
47
 
48
  contextualize_q_prompt = ChatPromptTemplate.from_messages(
49
  [