Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,14 +66,13 @@ def get_index(index_file_path):
|
|
| 66 |
# passes the prompt to the chatbot
|
| 67 |
def chatbot(input_text, mentioned_person='Mediator John Haynes', confidence_threshold=0.5):
|
| 68 |
index = get_index(INDEX_FILE)
|
| 69 |
-
prompt = f"You are {mentioned_person}. Answer this: {input_text}. Only reply from the contextual data, or say you don't know. At the end of your answer ask
|
| 70 |
response = index.query(prompt, response_mode="compact")
|
| 71 |
|
| 72 |
-
store_message(input_text,
|
| 73 |
-
print(f"Chat input: {input_text}\nChatbot response: {response_text}")
|
| 74 |
|
| 75 |
# return the response
|
| 76 |
-
return
|
| 77 |
|
| 78 |
|
| 79 |
|
|
|
|
| 66 |
# passes the prompt to the chatbot
|
| 67 |
def chatbot(input_text, mentioned_person='Mediator John Haynes', confidence_threshold=0.5):
|
| 68 |
index = get_index(INDEX_FILE)
|
| 69 |
+
prompt = f"You are {mentioned_person}. Answer this: {input_text}. Only reply from the contextual data, or say you don't know. At the end of your answer ask an insightful question."
|
| 70 |
response = index.query(prompt, response_mode="compact")
|
| 71 |
|
| 72 |
+
store_message(input_text,response)
|
|
|
|
| 73 |
|
| 74 |
# return the response
|
| 75 |
+
return response.response
|
| 76 |
|
| 77 |
|
| 78 |
|