legaltextai commited on
Commit
9be4834
1 Parent(s): c3b68a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -28,6 +28,15 @@ def search_legal_cases(query, num_results=10):
28
 
29
  return results
30
 
 
 
 
 
 
 
 
 
 
31
 
32
- demo = gr.Interface(fn=search_legal_cases, inputs="text", outputs="markdown")
33
  demo.launch()
 
28
 
29
  return results
30
 
31
+ def get_legal_cases(query):
32
+ results = search_legal_cases(query)
33
+ if results:
34
+ response = ""
35
+ for title, link, citation in results:
36
+ response += f"**Title:** {title}\n**Link:** {link}\n**Citation:** {citation}\n\n"
37
+ return response
38
+ else:
39
+ return "No results found."
40
 
41
+ demo = gr.Interface(fn=get_legal_cases, inputs="text", outputs="markdown")
42
  demo.launch()