peterpull commited on
Commit
229c2d6
·
1 Parent(s): d15fee4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- 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:
 
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: