broadfield-dev commited on
Commit
78a4110
·
verified ·
1 Parent(s): 059b4f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -180,15 +180,15 @@ def search_memory():
180
  for hit in response['hits']:
181
  print(hit)
182
  # Filter low relevance
183
- if hit.score < 0.65:
184
  continue
185
 
186
  clean_results.append({
187
- "title": hit.title or "Untitled Memory",
188
- "snippet": hit.snippet, # The highlighted text
189
- "full_text": hit.text, # Available on click
190
- "date": hit.timestamp, # Context!
191
- "score": f"{hit.score:.2f}"
192
  })
193
 
194
  #return jsonify(clean_results)
 
180
  for hit in response['hits']:
181
  print(hit)
182
  # Filter low relevance
183
+ if hit['score'] < 0.65:
184
  continue
185
 
186
  clean_results.append({
187
+ "title": hit['title'] or "Untitled Memory",
188
+ "snippet": hit['snippet'], # The highlighted text
189
+ "full_text": hit['text'], # Available on click
190
+ "date": hit['timestamp'], # Context!
191
+ "score": f"{hit['score']:.2f}"
192
  })
193
 
194
  #return jsonify(clean_results)