VishnuRamDebyez commited on
Commit
804a7ea
·
verified ·
1 Parent(s): 07828a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -40,7 +40,7 @@ class QASystem:
40
  self.memory = None
41
  self.embeddings = None
42
  self.client = None
43
- self.pdf_dir = "pdfs"
44
 
45
  def load_pdf_documents(self):
46
  documents = []
@@ -120,12 +120,12 @@ class QASystem:
120
  if retrieved_docs:
121
  context = ' '.join(m.content for m in retrieved_docs)
122
  else:
123
- context = "Legal knowledge system. Use Indian judiciary references."
124
 
125
  system_prompt = (
126
- "You are a senior legal assistant with expertise in Indian law. "
127
- "Always provide legally accurate responses with references to Indian judiciary principles. "
128
- "If the user query is not legal-specific, still respond from a legal perspective."
129
  f"\n\nContext:\n{context}"
130
  )
131
 
@@ -139,11 +139,11 @@ class QASystem:
139
  def generate(state: MessagesState):
140
  retrieved_docs = [m for m in reversed(state["messages"]) if m.type == "tool"][::-1]
141
 
142
- context = ' '.join(m.content for m in retrieved_docs) if retrieved_docs else "Legal knowledge system."
143
 
144
  system_prompt = (
145
- "You are a senior legal assistant specializing in Indian judiciary matters. "
146
- "Your responses MUST be legally accurate, concise (5 sentences max), and reference Indian laws when applicable."
147
  f"\n\nContext:\n{context}"
148
  )
149
 
 
40
  self.memory = None
41
  self.embeddings = None
42
  self.client = None
43
+ self.pdf_dir = "pdfss"
44
 
45
  def load_pdf_documents(self):
46
  documents = []
 
120
  if retrieved_docs:
121
  context = ' '.join(m.content for m in retrieved_docs)
122
  else:
123
+ context = "mountain bicycle technical knowledge"
124
 
125
  system_prompt = (
126
+ "You are an AI assistant embedded within the Interactive Electronic Technical Manual (IETM) for Mountain Cycles.. "
127
+ "Always provide accurate responses with references to provided data. "
128
+ "If the user query is not technical-specific, still respond from a technical perspective."
129
  f"\n\nContext:\n{context}"
130
  )
131
 
 
139
  def generate(state: MessagesState):
140
  retrieved_docs = [m for m in reversed(state["messages"]) if m.type == "tool"][::-1]
141
 
142
+ context = ' '.join(m.content for m in retrieved_docs) if retrieved_docs else "mountain bicycle technical knowledge"
143
 
144
  system_prompt = (
145
+ "You are an AI assistant embedded within the Interactive Electronic Technical Manual (IETM) for Mountain Cycles. "
146
+ "Your responses MUST be accurate, concise (5 sentences max)."
147
  f"\n\nContext:\n{context}"
148
  )
149