Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,8 @@ import sys
|
|
| 5 |
import os
|
| 6 |
import datetime
|
| 7 |
|
| 8 |
-
os.environ["OPENAI_API_KEY"] = '
|
| 9 |
-
|
| 10 |
|
| 11 |
def construct_index(directory_path):
|
| 12 |
max_input_size = 4096
|
|
@@ -27,7 +27,7 @@ def construct_index(directory_path):
|
|
| 27 |
|
| 28 |
return index
|
| 29 |
|
| 30 |
-
def chatbot(input_text, mentioned_person):
|
| 31 |
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
| 32 |
prompt = f"{mentioned_person}: {input_text}\n\n At the end of your answer, if you think appropriate, please ask a provocative question. Start it with a polite phrase such as - I wonder what you think...-."
|
| 33 |
response = index.query(prompt, response_mode="compact")
|
|
|
|
| 5 |
import os
|
| 6 |
import datetime
|
| 7 |
|
| 8 |
+
os.environ["OPENAI_API_KEY"] = 'SECRET'
|
| 9 |
+
|
| 10 |
|
| 11 |
def construct_index(directory_path):
|
| 12 |
max_input_size = 4096
|
|
|
|
| 27 |
|
| 28 |
return index
|
| 29 |
|
| 30 |
+
def chatbot(input_text, mentioned_person='Mediation teacher John Haynes'):
|
| 31 |
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
| 32 |
prompt = f"{mentioned_person}: {input_text}\n\n At the end of your answer, if you think appropriate, please ask a provocative question. Start it with a polite phrase such as - I wonder what you think...-."
|
| 33 |
response = index.query(prompt, response_mode="compact")
|