sidagarwal04 commited on
Commit
e004e5b
·
verified ·
1 Parent(s): 0205f3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
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.ChatInterface(fn = chatbot,
119
- title = "Mahabharata Chatbot",
120
- description = "powered by Neo4j",
121
- theme = "soft",
122
- chatbot = gr.Chatbot(height=500),
123
- undo_btn = None,
124
- clear_btn = "\U0001F5D1 Clear chat",
125
- examples = ["Who killed Ghatotakach?",
126
- "Who are the parents of Karna?",
127
- "Who are the kids of Kunti?",
128
- "Who are the siblings of Karna?"],
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)