michaelmc1618 commited on
Commit
cbb7771
·
verified ·
1 Parent(s): 80942ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -50,10 +50,10 @@ def respond(
50
  yield response, history + [(message, response)]
51
 
52
  def generate_case_outcome(prosecutor_response, defense_response):
53
- prompt = f"Prosecutor's Argument: {prosecutor_response}\nDefense Attorney's Argument: {defense_response}\n\nEvaluate both arguments, point out the strengths and weaknesses, and determine who won the case. Provide reasons for your decision."
54
  evaluation = ""
55
  for message in client.chat_completion(
56
- [{"role": "system", "content": "You are a legal expert evaluating the arguments presented by the prosecution and the defense."},
57
  {"role": "user", "content": prompt}],
58
  max_tokens=512,
59
  stream=True,
@@ -202,10 +202,10 @@ def update_pdf_gallery_and_extract_text(pdf_files):
202
  return pdf_files, pdf_text
203
 
204
  def get_top_10_cases():
205
- prompt = "Give me a list of the current top 10 cases in the country being discussed by the top lawyers in the country."
206
  response = ""
207
  for message in client.chat_completion(
208
- [{"role": "system", "content": "You are a legal expert providing information about top legal cases."},
209
  {"role": "user", "content": prompt}],
210
  max_tokens=512,
211
  stream=True,
@@ -222,7 +222,7 @@ def add_message(history, message):
222
  history.append(((x,), None))
223
  if message["text"] is not None:
224
  history.append((message["text"], None))
225
- return history, gr.MultimodalTextbox(value=None, interactive=False)
226
 
227
  def bot(history):
228
  system_message = "You are a helpful assistant."
 
50
  yield response, history + [(message, response)]
51
 
52
  def generate_case_outcome(prosecutor_response, defense_response):
53
+ prompt = Provide details on who won the case and why. Provide reasons for your decision and provide a link to the source of the case."
54
  evaluation = ""
55
  for message in client.chat_completion(
56
+ [{"role": "system", "content": "You are a legal expert evaluating the details of the case presented by the prosecution and the defense."},
57
  {"role": "user", "content": prompt}],
58
  max_tokens=512,
59
  stream=True,
 
202
  return pdf_files, pdf_text
203
 
204
  def get_top_10_cases():
205
+ prompt = " 10 high-profile legal cases that have received significant media attention and are currently ongoing. Just a list of case names and numbers"
206
  response = ""
207
  for message in client.chat_completion(
208
+ [{"role": "system", "content": "You are a legal research expert, able to provide information about high-profile legal cases."},
209
  {"role": "user", "content": prompt}],
210
  max_tokens=512,
211
  stream=True,
 
222
  history.append(((x,), None))
223
  if message["text"] is not None:
224
  history.append((message["text"], None))
225
+ return history, gr.MultimodalTextbox(value=None, interactive=True)
226
 
227
  def bot(history):
228
  system_message = "You are a helpful assistant."