fastx commited on
Commit
9a7b485
·
1 Parent(s): 2fcd52a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -75,10 +75,14 @@ def ask_ai(question,openai_api_key):
75
  else:
76
  os.environ["OPENAI_API_KEY"] = openai_api_key
77
  construct_index("data")
78
-
79
- index = GPTSimpleVectorIndex.load_from_disk('index.json')
80
- response = index.query(question, response_mode="compact")
81
- return response.response
 
 
 
 
82
 
83
 
84
  api_key = gr.inputs.Textbox(label="Paste OPENAI API Key (Or left it blank to use default api)")
 
75
  else:
76
  os.environ["OPENAI_API_KEY"] = openai_api_key
77
  construct_index("data")
78
+
79
+
80
+ reply = chat.choices[0].message.content
81
+ messages.append({"role": "assistant", "content": reply})
82
+ return messages
83
+ #index = GPTSimpleVectorIndex.load_from_disk('index.json')
84
+ #response = index.query(question, response_mode="compact")
85
+ #return response.response
86
 
87
 
88
  api_key = gr.inputs.Textbox(label="Paste OPENAI API Key (Or left it blank to use default api)")