Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,12 +68,12 @@ def chatbot(input_text, mentioned_person='Mediator John Haynes', confidence_thre
|
|
| 68 |
index = get_index(INDEX_FILE)
|
| 69 |
prompt = f"You are {mentioned_person}: {input_text}\n\n At the end of your answer ask a provocative question."
|
| 70 |
response = index.query(prompt, response_mode="compact")
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
|
| 78 |
# Check the confidence score of the response
|
| 79 |
if response.score < confidence_threshold:
|
|
|
|
| 68 |
index = get_index(INDEX_FILE)
|
| 69 |
prompt = f"You are {mentioned_person}: {input_text}\n\n At the end of your answer ask a provocative question."
|
| 70 |
response = index.query(prompt, response_mode="compact")
|
| 71 |
+
if isinstance(response, list):
|
| 72 |
+
response_text = response[0].text
|
| 73 |
+
confidence = response[0].score
|
| 74 |
+
else:
|
| 75 |
+
response_text = response.text
|
| 76 |
+
confidence = response.score
|
| 77 |
|
| 78 |
# Check the confidence score of the response
|
| 79 |
if response.score < confidence_threshold:
|