Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,17 +25,7 @@ def get_user_ip():
|
|
25 |
|
26 |
def validate_passcode(passcode, user_input, user_name, user_email, is_fintech_startup, region, profession):
|
27 |
valid_passcodes = {
|
28 |
-
"organization1": "
|
29 |
-
"organization2": "launchlabrocks",
|
30 |
-
"organization3": "fintechalliance",
|
31 |
-
"organization4": "cisi-fintech",
|
32 |
-
"organization5": "city-bayes-alumni",
|
33 |
-
"organization6": "bar-council",
|
34 |
-
"organization7": "vcinnovations",
|
35 |
-
"organization8": "remi-slama",
|
36 |
-
"organization9": "dalton-latymer",
|
37 |
-
"organization10": "barrister",
|
38 |
-
"organization11": "r-muttukrishnan",
|
39 |
}
|
40 |
|
41 |
if not passcode:
|
@@ -59,7 +49,7 @@ def CustomChatGPT(passcode, user_input, user_name, user_email, is_fintech_startu
|
|
59 |
|
60 |
user_message = f"{user_input} [USER_IDENTITY: {user_name}]"
|
61 |
messages.append({"role": "user", "content": user_message})
|
62 |
-
messages.append({"role": "system", "content": "As a specialized
|
63 |
|
64 |
response = openai.ChatCompletion.create(
|
65 |
model="gpt-3.5-turbo",
|
@@ -79,8 +69,6 @@ def CustomChatGPT(passcode, user_input, user_name, user_email, is_fintech_startu
|
|
79 |
"User Identity": user_name,
|
80 |
"User Email": user_email,
|
81 |
"IP Address": ip_address,
|
82 |
-
"Fintech Startup": "Yes" if is_fintech_startup == "Yes" else "No",
|
83 |
-
"Region": region,
|
84 |
"Profession": profession,
|
85 |
"Our AI Lawyer Reply": ChatGPT_reply
|
86 |
}
|
@@ -103,8 +91,6 @@ def launch_interface():
|
|
103 |
gradio.inputs.Textbox(label="Your Legal Query", placeholder="Talk to your lawyer..."),
|
104 |
gradio.inputs.Textbox(label="Your Name", placeholder="Enter your name"),
|
105 |
gradio.inputs.Textbox(label="Your Email", placeholder="Enter your email"),
|
106 |
-
gradio.inputs.Radio(label="Are you a fintech startup?", choices=["Yes", "No"]),
|
107 |
-
gradio.inputs.Dropdown(label="Select your region", choices=["England", "Scotland", "Wales", "Northern Ireland"]),
|
108 |
gradio.inputs.Textbox(label="Profession", placeholder="Enter your profession")
|
109 |
]
|
110 |
outputs = gradio.outputs.Textbox(label="Our AI Lawyer Reply")
|
|
|
25 |
|
26 |
def validate_passcode(passcode, user_input, user_name, user_email, is_fintech_startup, region, profession):
|
27 |
valid_passcodes = {
|
28 |
+
"organization1": "r-muttukrishnan",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
|
31 |
if not passcode:
|
|
|
49 |
|
50 |
user_message = f"{user_input} [USER_IDENTITY: {user_name}]"
|
51 |
messages.append({"role": "user", "content": user_message})
|
52 |
+
messages.append({"role": "system", "content": "As a specialized Sri Lanka lawyer, specialized in sri lanka national regulations and law, you're currently in a confidential consultation with your client. The startup has complete trust in your expertise and advice regulation. Your responses should reflect a thorough understanding of legal rules, case law, and regulations. Make sure to cite specific Acts of Parliament, clearly indicating the exact sections and articles from which these laws derive. If secondary legislation is relevant. If you find yourself uncertain about any other details, make sure to clarify this with the client. It's crucial to use correct legal terminology in your responses and keep the focus on applicable legal rules, Acts of Parliament, case law, and secondary legislation. Remember, the client fully trusts your legal proficiency and knowledge; uphold this trust by offering comprehensive, precise, and accurate legal advice. Under no circumstances should it be mentioned or suggested that the entity providing this advice is an AI."})
|
53 |
|
54 |
response = openai.ChatCompletion.create(
|
55 |
model="gpt-3.5-turbo",
|
|
|
69 |
"User Identity": user_name,
|
70 |
"User Email": user_email,
|
71 |
"IP Address": ip_address,
|
|
|
|
|
72 |
"Profession": profession,
|
73 |
"Our AI Lawyer Reply": ChatGPT_reply
|
74 |
}
|
|
|
91 |
gradio.inputs.Textbox(label="Your Legal Query", placeholder="Talk to your lawyer..."),
|
92 |
gradio.inputs.Textbox(label="Your Name", placeholder="Enter your name"),
|
93 |
gradio.inputs.Textbox(label="Your Email", placeholder="Enter your email"),
|
|
|
|
|
94 |
gradio.inputs.Textbox(label="Profession", placeholder="Enter your profession")
|
95 |
]
|
96 |
outputs = gradio.outputs.Textbox(label="Our AI Lawyer Reply")
|