patti-j commited on
Commit
a4c568e
1 Parent(s): 2bd22ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -7,26 +7,20 @@ from llama_index import GPTVectorStoreIndex
7
  openai_api_key = os.getenv('OPENAI_API_KEY')
8
 
9
 
10
- """class ChatWrapper:
11
 
12
  def __call__(
13
  self, inp: str, history: str, chain
14
  ):
15
- Execute the chat functionality.
 
16
  output = chain({"question": inp, "chat_history": history})["answer"]
17
  history.append((inp, output))
18
- return history, history
19
-
20
 
21
- """
22
  chat = ChatWrapper()
23
  chatbot = gr.Chatbot()
24
 
25
- def get_response(message):
26
- response = (f"You entered: {message}")
27
- return response
28
-
29
-
30
  block = gr.Blocks(css=".gradio-container {background-color: lightblue}")
31
 
32
  with block:
 
7
  openai_api_key = os.getenv('OPENAI_API_KEY')
8
 
9
 
10
+ class ChatWrapper:
11
 
12
  def __call__(
13
  self, inp: str, history: str, chain
14
  ):
15
+
16
+ # Execute the chat functionality.
17
  output = chain({"question": inp, "chat_history": history})["answer"]
18
  history.append((inp, output))
19
+ return history
 
20
 
 
21
  chat = ChatWrapper()
22
  chatbot = gr.Chatbot()
23
 
 
 
 
 
 
24
  block = gr.Blocks(css=".gradio-container {background-color: lightblue}")
25
 
26
  with block: