GitHub Actions commited on
Commit
d87399c
·
1 Parent(s): 8ccf339

Deploy cf7f476

Browse files
app/pipeline/nodes/generate.py CHANGED
@@ -40,14 +40,14 @@ def make_generate_node(llm_client: LLMClient) -> Callable[[PipelineState], dict]
40
  context_block = "\n\n".join(context_parts)
41
 
42
  system_prompt = (
43
- "You are an AI assistant embedded on Darshan Chheda's personal portfolio website. "
44
- "The numbered context passages below describe Darshan's projects, blog posts, skills, and experiences. "
45
- "Darshan Chheda is the subject — always refer to him by name or as 'he'/'his'. "
46
- "When a passage uses 'I', 'my', or 'me', that voice belongs to Darshan. "
47
- "Answer questions using ONLY the context passages provided. "
48
- "Cite sources inline using bracketed numbers like [1], [2] immediately after each claim. "
49
- "Be concise, confident, and factual. Never invent details not present in the context. "
50
- "If the context doesn't contain enough information to answer fully, say so honestly."
51
  )
52
 
53
  prompt = f"Context:\n{context_block}\n\nQuestion: {query}"
 
40
  context_block = "\n\n".join(context_parts)
41
 
42
  system_prompt = (
43
+ "You are a knowledgeable assistant on Darshan Chheda's personal portfolio website. "
44
+ "Use the numbered context passages below — which cover Darshan's projects, blog posts, skills, and background — to answer the question. "
45
+ "Darshan Chheda is always the subject. When a passage says 'I', 'my', or 'me', that voice is Darshan's. "
46
+ "Write in clear, professional English as if you know Darshan well. "
47
+ "You may draw reasonable, confident inferences from the evidence (e.g. if he built a full-stack app he knows both front-end and back-end; if he wrote Assembly he understands low-level programming). "
48
+ "Do NOT say you cannot find information when the context clearly contains the answer — read it carefully. "
49
+ "Cite every factual claim inline with bracketed numbers like [1], [2] immediately after the claim. "
50
+ "Be concise and direct. Avoid hedging phrases like 'based on the context' or 'the context suggests'."
51
  )
52
 
53
  prompt = f"Context:\n{context_block}\n\nQuestion: {query}"
app/security/sanitizer.py CHANGED
@@ -59,7 +59,10 @@ def redact_pii(text: str) -> str:
59
  # Failsafe if Presidio isn't installed/working
60
  return text
61
 
62
- entities = ["EMAIL_ADDRESS", "PHONE_NUMBER", "UK_NHS", "IBAN_CODE", "PERSON"]
 
 
 
63
 
64
  try:
65
  results = analyzer.analyze(text=text, entities=entities, language='en')
 
59
  # Failsafe if Presidio isn't installed/working
60
  return text
61
 
62
+ # PERSON is intentionally excluded: visitors are expected to name Darshan Chheda
63
+ # in their queries. Redacting that breaks retrieval and confuses the LLM.
64
+ # We only protect against visitor PII that could leak into logs (e-mail, phone, etc.).
65
+ entities = ["EMAIL_ADDRESS", "PHONE_NUMBER", "UK_NHS", "IBAN_CODE"]
66
 
67
  try:
68
  results = analyzer.analyze(text=text, entities=entities, language='en')