Rulga commited on
Commit
07dd6be
·
verified ·
1 Parent(s): 0fbb073

Update app.py

Browse files

add urls edit promt

Files changed (1) hide show
  1. app.py +36 -7
app.py CHANGED
@@ -80,7 +80,17 @@ VECTOR_STORE_PATH = "vector_store"
80
  URLS = [
81
  "https://status.law",
82
  "https://status.law/about",
83
- # ... other URLs ...
 
 
 
 
 
 
 
 
 
 
84
  ]
85
 
86
  def build_knowledge_base(_embeddings):
@@ -208,13 +218,32 @@ def main():
208
 
209
  # Generate response
210
  prompt_template = PromptTemplate.from_template('''
211
- You are a helpful and polite legal assistant at Status.Law.
212
- Answer in the language in which the question was asked.
213
- Answer the question based on the context provided.
 
 
 
 
 
214
 
215
- Context: {context}
216
- Question: {question}
217
- ''')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
 
219
  chain = prompt_template | llm | StrOutputParser()
220
  response = chain.invoke({
 
80
  URLS = [
81
  "https://status.law",
82
  "https://status.law/about",
83
+ "https://status.law/careers",
84
+ "https://status.law/tariffs-for-services-of-protection-against-extradition",
85
+ "https://status.law/challenging-sanctions",
86
+ "https://status.law/law-firm-contact-legal-protection"
87
+ "https://status.law/cross-border-banking-legal-issues",
88
+ "https://status.law/extradition-defense",
89
+ "https://status.law/international-prosecution-protection",
90
+ "https://status.law/interpol-red-notice-removal",
91
+ "https://status.law/practice-areas",
92
+ "https://status.law/reputation-protection",
93
+ "https://status.law/faq"
94
  ]
95
 
96
  def build_knowledge_base(_embeddings):
 
218
 
219
  # Generate response
220
  prompt_template = PromptTemplate.from_template('''
221
+ You are a helpful and polite legal assistant at Status Law.
222
+ You answer in the language in which the question was asked.
223
+ Answer the question based on the context provided.
224
+ If you cannot answer based on the context, say so politely and offer to contact Status Law directly via the following channels:
225
+ - For all users: +32465594521 (landline phone).
226
+ - For English and Swedish speakers only: +46728495129 (available on WhatsApp, Telegram, Signal, IMO).
227
+ - Provide a link to the contact form: [Contact Form](https://status.law/law-firm-contact-legal-protection/).
228
+ If the user has questions about specific services and their costs, suggest they visit the page https://status.law/tariffs-for-services-of-protection-against-extradition-and-international-prosecution/ for detailed information.
229
 
230
+ Ask the user additional questions to understand which service to recommend and provide an estimated cost. For example, clarify their situation and needs to suggest the most appropriate options.
231
+
232
+ Also, offer free consultations if they are available and suitable for the user's request.
233
+ Answer professionally but in a friendly manner.
234
+
235
+ Example:
236
+ Q: How can I challenge the sanctions?
237
+ A: To challenge the sanctions, you should consult with our legal team, who specialize in this area. Please contact us directly for detailed advice. You can fill out our contact form here: [Contact Form](https://status.law/law-firm-contact-legal-protection/).
238
+
239
+ Context: {context}
240
+ Question: {question}
241
+
242
+ Response Guidelines:
243
+ 1. Answer in the user's language
244
+ 2. Cite sources when possible
245
+ 3. Offer contact options if unsure
246
+ ''')
247
 
248
  chain = prompt_template | llm | StrOutputParser()
249
  response = chain.invoke({