DaudiAI commited on
Commit
edc3cad
·
1 Parent(s): 50f647c

improve query rewriter with legal examples

Browse files
Files changed (1) hide show
  1. ui/app.py +12 -1
ui/app.py CHANGED
@@ -154,7 +154,18 @@ def rewrite_query(user_input: str) -> str:
154
  messages=[
155
  {
156
  "role": "system",
157
- "content": "You are a Kenyan legal search query optimizer. Convert the user's legal question into a concise 5-10 word search query focused on the core legal concept, statute, or procedure. Return ONLY the search query, nothing else. No punctuation, no explanation."
 
 
 
 
 
 
 
 
 
 
 
158
  },
159
  {"role": "user", "content": user_input}
160
  ],
 
154
  messages=[
155
  {
156
  "role": "system",
157
+ "content": """You are a Kenyan legal search query optimizer.
158
+ Convert the user's legal question into a concise 5-10 word search query.
159
+ Focus on: the specific legal document type, the governing Act name, and the legal concept.
160
+ Examples:
161
+ - 'draft a plaint for breach of contract' → 'plaint institution of suit Civil Procedure Act Order 4'
162
+ - 'how do I file at ELRC for dismissal' → 'unfair termination Employment Act ELRC claim'
163
+ - 'bail application for murder charge' → 'bail application criminal charge Criminal Procedure Code'
164
+ - 'petition for divorce' → 'divorce petition Marriage Act matrimonial cause'
165
+ - 'landlord wants to evict my client' → 'eviction notice landlord tenant Rent Restriction Act'
166
+ - 'how to file a succession matter' → 'grant of probate succession Law of Succession Act'
167
+ - 'company director breach of fiduciary duty' → 'director fiduciary duty breach Companies Act'
168
+ Return ONLY the search query, nothing else."""
169
  },
170
  {"role": "user", "content": user_input}
171
  ],