Seth0330 commited on
Commit
b7324d7
·
verified ·
1 Parent(s): 14dc418

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -197,15 +197,18 @@ class HybridRetriever(BaseRetriever):
197
 
198
  # --- SYSTEM PROMPT & PROMPT TEMPLATE
199
  system_prompt = (
200
- "You are a JSON data assistant. Always give a direct, concise answer based only on the context provided. "
201
- "If you do not see the answer in the context, reply: 'I don’t have that information.' "
202
- "Never make up information. Never ask for clarification."
 
 
203
  )
204
  prompt = ChatPromptTemplate.from_messages([
205
  ("system", system_prompt),
206
- ("human", "Context:\n{context}\n\nQuestion: {question}")
207
  ])
208
 
 
209
  llm = ChatOpenAI(model="gpt-4.1", openai_api_key=OPENAI_API_KEY, temperature=0)
210
 
211
  retriever = HybridRetriever(top_k=5)
 
197
 
198
  # --- SYSTEM PROMPT & PROMPT TEMPLATE
199
  system_prompt = (
200
+ "You are a JSON data assistant. Always answer using only the provided context records. "
201
+ "If a question mentions a person or entity (e.g. 'Johnny'), find all records where any field includes that name "
202
+ "(including as part of an email or username, e.g. customer_name: johnny, customer: johnny.appleseed@gmail.com). "
203
+ "If you find a relevant record, answer as directly as possible using its fields (e.g. 'Johnny spent $100'). "
204
+ "If you cannot find the answer, reply: 'I don’t have that information.'"
205
  )
206
  prompt = ChatPromptTemplate.from_messages([
207
  ("system", system_prompt),
208
+ ("human", "Here are the most relevant records:\n{context}\n\nQuestion: {question}")
209
  ])
210
 
211
+
212
  llm = ChatOpenAI(model="gpt-4.1", openai_api_key=OPENAI_API_KEY, temperature=0)
213
 
214
  retriever = HybridRetriever(top_k=5)