Spaces:
Sleeping
Sleeping
Update app.py
Browse files49 unmodified lines50515253545556575859142 unmodified lines20220320420520620720820921021110 unmodified lines22222322422522622722849 unmodified linesyield response, history + [(message, response)]def generate_case_outcome(prosecutor_response, defense_response):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."evaluation = ""for message in client.chat_completion([{"role": "system", "content": "You are a legal expert evaluating the arguments presented by the prosecution and the defense."},{"role": "user", "content": prompt}],max_tokens=512,stream=True,142 unmodified linesreturn pdf_files, pdf_textdef get_top_10_cases():prompt = "Give me a list of the current top 10 cases in the country being discussed by the top lawyers in the country."response = ""for message in client.chat_completion([{"role": "system", "content": "You are a legal expert providing information about top legal cases."},{"role": "user", "content": prompt}],max_tokens=512,stream=True,10 unmodified lineshistory.append(((x,), None))if message["text"] is not None:history.append((message["text"], None))return history, gr.MultimodalTextbox(value=None, interactive=False)def bot(history):system_message = "You are a helpful assistant."49 unmodified lines50515253545556575859142 unmodified lines20220320420520620720820921021110 unmodified lines22222322422522622722849 unmodified linesyield response, history + [(message, response)]def generate_case_outcome(prosecutor_response, defense_response):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."evaluation = ""for message in client.chat_completion([{"role": "system", "content": "You are a legal expert evaluating the details of the case presented by the prosecution and the defense."},{"role": "user", "content": prompt}],max_tokens=512,stream=True,142 unmodified linesreturn pdf_files, pdf_textdef get_top_10_cases():prompt = " 10 high-profile legal cases that have received significant media attention and are currently ongoing. Just a list of case names and numbers"response = ""for message in client.chat_completion([{"role": "system", "content": "You are a legal research expert, able to provide information about high-profile legal cases."},{"role": "user", "content": prompt}],max_tokens=512,stream=True,10 unmodified lineshistory.append(((x,), None))if message["text"] is not None:history.append((message["text"], None))return history, gr.MultimodalTextbox(value=None, interactive=True)def bot(history):system_message = "You are a helpful assistant."
app.py+5-5