Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ openai.api_key = "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"
|
|
12 |
records = []
|
13 |
credentials = Credentials.from_service_account_file("credentials.json", scopes=["https://www.googleapis.com/auth/spreadsheets"])
|
14 |
client = gspread.authorize(credentials)
|
15 |
-
sheet = client.open_by_url("https://docs.google.com/spreadsheets/d/
|
16 |
|
17 |
def get_user_ip():
|
18 |
try:
|
@@ -22,7 +22,7 @@ def get_user_ip():
|
|
22 |
except:
|
23 |
return None
|
24 |
|
25 |
-
def CustomChatGPT(user_input, user_name, user_email, user_agent):
|
26 |
messages = []
|
27 |
|
28 |
if not user_name:
|
@@ -52,7 +52,7 @@ def CustomChatGPT(user_input, user_name, user_email, user_agent):
|
|
52 |
interaction_patterns = "" # Track user interface interaction patterns
|
53 |
success_of_advice = "" # Measure success of advice
|
54 |
user_satisfaction_rate = "" # Measure user satisfaction rate
|
55 |
-
user_location =
|
56 |
industry_or_profession = "" # Capture user industry or profession
|
57 |
|
58 |
record = {
|
@@ -98,11 +98,13 @@ def launch_interface():
|
|
98 |
inputs = [
|
99 |
gradio.inputs.Textbox(label="User Input", placeholder="Talk to your lawyer..."),
|
100 |
gradio.inputs.Textbox(label="Your Name", placeholder="Enter your name"),
|
101 |
-
gradio.inputs.Textbox(label="Your Email", placeholder="Enter your email")
|
|
|
|
|
102 |
]
|
103 |
outputs = gradio.outputs.Textbox(label="Our AI Lawyer Reply")
|
104 |
|
105 |
-
interface = gradio.Interface(fn=CustomChatGPT, inputs=inputs, outputs=outputs, title="
|
106 |
interface.launch()
|
107 |
|
108 |
if __name__ == "__main__":
|
|
|
12 |
records = []
|
13 |
credentials = Credentials.from_service_account_file("credentials.json", scopes=["https://www.googleapis.com/auth/spreadsheets"])
|
14 |
client = gspread.authorize(credentials)
|
15 |
+
sheet = client.open_by_url("https://docs.google.com/spreadsheets/d/1oYcyCduLLlTaL-KPcDPlCNEvDUvjuSN_wx1QN5Fv6As/edit?usp=sharing").sheet1
|
16 |
|
17 |
def get_user_ip():
|
18 |
try:
|
|
|
22 |
except:
|
23 |
return None
|
24 |
|
25 |
+
def CustomChatGPT(user_input, user_name, user_email, user_agent, fintech_startup, location):
|
26 |
messages = []
|
27 |
|
28 |
if not user_name:
|
|
|
52 |
interaction_patterns = "" # Track user interface interaction patterns
|
53 |
success_of_advice = "" # Measure success of advice
|
54 |
user_satisfaction_rate = "" # Measure user satisfaction rate
|
55 |
+
user_location = location
|
56 |
industry_or_profession = "" # Capture user industry or profession
|
57 |
|
58 |
record = {
|
|
|
98 |
inputs = [
|
99 |
gradio.inputs.Textbox(label="User Input", placeholder="Talk to your lawyer..."),
|
100 |
gradio.inputs.Textbox(label="Your Name", placeholder="Enter your name"),
|
101 |
+
gradio.inputs.Textbox(label="Your Email", placeholder="Enter your email"),
|
102 |
+
gradio.inputs.Radio(label="Are you a fintech startup?", choices=["Yes", "No"]),
|
103 |
+
gradio.inputs.Dropdown(label="Select your location", choices=["England", "Scotland", "Wales", "Northern Ireland"])
|
104 |
]
|
105 |
outputs = gradio.outputs.Textbox(label="Our AI Lawyer Reply")
|
106 |
|
107 |
+
interface = gradio.Interface(fn=CustomChatGPT, inputs=inputs, outputs=outputs, title="", description="")
|
108 |
interface.launch()
|
109 |
|
110 |
if __name__ == "__main__":
|