Rulga commited on
Commit
405d93a
Β·
1 Parent(s): b67494f

docs: update README with project structure and required directories; enhance AI assistant prompt for clarity and detail

Browse files
Files changed (2) hide show
  1. README.md +17 -2
  2. app.py +33 -14
README.md CHANGED
@@ -7,9 +7,24 @@ sdk: streamlit
7
  sdk_version: 1.42.2
8
  app_file: app.py
9
  pinned: false
10
- short_description: It is a chat built with an AI model about www.Status.law
11
  ---
12
 
13
  # LS Chatbot app
14
 
15
- It is a chat app built using Streamlit that allows users to interact with an AI model to communicate about www.Status.law
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  sdk_version: 1.42.2
8
  app_file: app.py
9
  pinned: false
10
+ short_description: It is a chat built using Streamlit with an AI model about www.Status.law
11
  ---
12
 
13
  # LS Chatbot app
14
 
15
+ It is a chat app built using Streamlit that allows users to interact with an AI model to communicate about www.Status.law
16
+
17
+ ## Project Structure
18
+ ```
19
+ .
20
+ β”œβ”€β”€ app.py
21
+ β”œβ”€β”€ chat_history/
22
+ β”‚ └── .gitkeep
23
+ β”œβ”€β”€ vector_store/
24
+ β”‚ └── .gitkeep
25
+ └── requirements.txt
26
+ ```
27
+
28
+ ## Required Directories
29
+ - `chat_history/` - Stores chat history JSON files
30
+ - `vector_store/` - Stores FAISS vector database
app.py CHANGED
@@ -14,6 +14,15 @@ import requests
14
  import json
15
  from datetime import datetime
16
 
 
 
 
 
 
 
 
 
 
17
  # Page configuration
18
  st.set_page_config(page_title="Status Law Assistant", page_icon="βš–οΈ")
19
 
@@ -214,22 +223,32 @@ def main():
214
  context_text = "\n".join([doc.page_content for doc in context])
215
 
216
  prompt = PromptTemplate.from_template("""
217
- You are a helpful and polite legal assistant at Status Law.
218
- You answer in the language in which the question was asked.
219
- Answer the question based on the context provided.
220
- If you cannot answer based on the context, say so politely and offer to contact Status Law directly via the following channels:
221
- - For all users: +32465594521 (landline phone).
222
- - For English and Swedish speakers only: +46728495129 (available on WhatsApp, Telegram, Signal, IMO).
223
- - Provide a link to the contact form: [Contact Form](https://status.law/law-firm-contact-legal-protection/).
224
- Answer professionally but in a friendly manner.
 
 
 
 
 
 
 
 
225
 
226
- Example:
227
- Q: How can I challenge the sanctions?
228
- 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/).
229
 
230
- Context: {context}
231
- Question: {question}
232
- """)
 
 
 
 
233
 
234
  chain = prompt | llm | StrOutputParser()
235
  response = chain.invoke({
 
14
  import json
15
  from datetime import datetime
16
 
17
+ # Create required directories
18
+ REQUIRED_DIRS = ['chat_history', 'vector_store']
19
+ for dir_name in REQUIRED_DIRS:
20
+ os.makedirs(dir_name, exist_ok=True)
21
+ gitkeep_path = os.path.join(dir_name, '.gitkeep')
22
+ if not os.path.exists(gitkeep_path):
23
+ with open(gitkeep_path, 'w') as f:
24
+ pass
25
+
26
  # Page configuration
27
  st.set_page_config(page_title="Status Law Assistant", page_icon="βš–οΈ")
28
 
 
223
  context_text = "\n".join([doc.page_content for doc in context])
224
 
225
  prompt = PromptTemplate.from_template("""
226
+ You are a helpful and polite legal assistant at Status Law, an international law firm specializing in extradition cases.
227
+
228
+ Answer in the language in which the question was asked.
229
+
230
+ Use the following information to answer questions:
231
+ - Primary context: {context}
232
+ - Services and pricing information: https://status.law/tariffs-for-services-against-extradition-en
233
+
234
+ If asked about services or pricing, refer specifically to our extradition services pricing page and mention:
235
+ 1. We offer different service packages depending on the case stage
236
+ 2. Our services cover legal analysis, document preparation, court representation, and negotiation with authorities
237
+
238
+ If you cannot answer based on the available information, say so politely and offer to contact Status Law directly via the following channels:
239
+ - For all users: +32465594521 (landline phone)
240
+ - For English and Swedish speakers only: +46728495129 (available on WhatsApp, Telegram, Signal, IMO)
241
+ - Provide a link to the contact form: [Contact Form](https://status.law/law-firm-contact-legal-protection/)
242
 
243
+ Question: {question}
 
 
244
 
245
+ Response Guidelines:
246
+ 1. Answer in the user's language
247
+ 2. Be concise but informative
248
+ 3. Cite specific service packages and prices when relevant
249
+ 4. Emphasize our international expertise in extradition law
250
+ 5. Offer contact options if the question requires detailed legal advice
251
+ """)
252
 
253
  chain = prompt | llm | StrOutputParser()
254
  response = chain.invoke({