Update run.py
Browse files
run.py
CHANGED
|
@@ -69,9 +69,9 @@ creds = service_account.Credentials.from_service_account_info(json_data, scopes=
|
|
| 69 |
client = gspread.authorize(creds)
|
| 70 |
sheet = client.open("nestolechatbot").sheet1 # Open the sheet
|
| 71 |
|
| 72 |
-
def save_to_sheet(date,name, message
|
| 73 |
# Write user input to the Google Sheet
|
| 74 |
-
sheet.append_row([date,name, message])
|
| 75 |
return f"Thanks {name}, your message has been saved!"
|
| 76 |
|
| 77 |
|
|
@@ -157,7 +157,7 @@ def response(
|
|
| 157 |
#output=output+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
|
| 158 |
# Get current date and time
|
| 159 |
now = str(datetime.now())
|
| 160 |
-
save_to_sheet(now,prompt, output)
|
| 161 |
yield output
|
| 162 |
|
| 163 |
gr.ChatInterface(response, chatbot=gr.Chatbot(value=[[None,"Herzlich willkommen! Ich bin Chätti ein KI-basiertes Studienassistenzsystem, das für jede Anfrage die am besten Studieninformationen empfiehlt.<br>Erzähle mir, was du gerne tust!"]],render_markdown=True),title="German Studyhelper Chätti").queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
|
|
|
|
| 69 |
client = gspread.authorize(creds)
|
| 70 |
sheet = client.open("nestolechatbot").sheet1 # Open the sheet
|
| 71 |
|
| 72 |
+
def save_to_sheet(date,name, message,val:
|
| 73 |
# Write user input to the Google Sheet
|
| 74 |
+
sheet.append_row([date,name, message,val])
|
| 75 |
return f"Thanks {name}, your message has been saved!"
|
| 76 |
|
| 77 |
|
|
|
|
| 157 |
#output=output+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
|
| 158 |
# Get current date and time
|
| 159 |
now = str(datetime.now())
|
| 160 |
+
save_to_sheet(now,prompt, output, val)
|
| 161 |
yield output
|
| 162 |
|
| 163 |
gr.ChatInterface(response, chatbot=gr.Chatbot(value=[[None,"Herzlich willkommen! Ich bin Chätti ein KI-basiertes Studienassistenzsystem, das für jede Anfrage die am besten Studieninformationen empfiehlt.<br>Erzähle mir, was du gerne tust!"]],render_markdown=True),title="German Studyhelper Chätti").queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
|