patti-j commited on
Commit
67af7f1
1 Parent(s): d2a8971

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -5,6 +5,19 @@ gr.HTML("Omdena AI Chatbot For Mental Health and Well Being")
5
  chatbot = gr.Chatbot()
6
  chat = ChatWrapper()
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  block = gr.Blocks(css=".gradio-container {background-color: gray}")
9
 
10
  with block:
 
5
  chatbot = gr.Chatbot()
6
  chat = ChatWrapper()
7
 
8
+ class ChatWrapper:
9
+
10
+ def __call__(
11
+ self, inp: str, history: str, chain
12
+ ):
13
+ """Execute the chat functionality."""
14
+
15
+ output = chain({"question": inp, "chat_history": history})["answer"]
16
+ history.append((inp, output))
17
+
18
+ return history, history
19
+
20
+
21
  block = gr.Blocks(css=".gradio-container {background-color: gray}")
22
 
23
  with block: