Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import re
|
|
5 |
import gradio as gr
|
6 |
from neo4j import GraphDatabase
|
7 |
import os
|
|
|
8 |
|
9 |
api_key = os.getenv("GEMINI_API_KEY")
|
10 |
neo4j_uri = os.getenv("NEO4J_URI")
|
@@ -115,16 +116,14 @@ def chatbot(input, history=[]):
|
|
115 |
# we could log these situations in the backend to revisit later in development
|
116 |
return "I'm sorry, there was an error retrieving the information you requested."
|
117 |
|
118 |
-
gr.
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
inputs = ["text",'state'],
|
130 |
-
outputs = ["chatbot",'state']).launch(debug = True, share=True)
|
|
|
5 |
import gradio as gr
|
6 |
from neo4j import GraphDatabase
|
7 |
import os
|
8 |
+
from langchain.memory import ConversationBufferMemory
|
9 |
|
10 |
api_key = os.getenv("GEMINI_API_KEY")
|
11 |
neo4j_uri = os.getenv("NEO4J_URI")
|
|
|
116 |
# we could log these situations in the backend to revisit later in development
|
117 |
return "I'm sorry, there was an error retrieving the information you requested."
|
118 |
|
119 |
+
gr.Interface(fn = chatbot,
|
120 |
+
title = "Mahabharata Chatbot",
|
121 |
+
description = "powered by Neo4j",
|
122 |
+
theme = "soft",
|
123 |
+
clear_btn = "\U0001F5D1 Clear chat",
|
124 |
+
examples = ["Who killed Ghatotakach?",
|
125 |
+
"Who are the parents of Karna?",
|
126 |
+
"Who are the kids of Kunti?",
|
127 |
+
"Who are the siblings of Karna?"],
|
128 |
+
inputs = ["text",'state'],
|
129 |
+
outputs = ["chatbot",'state']).launch(debug = True, share=True)
|
|
|
|