Fix Citation Sort Tiebreak (#1397)

This commit is contained in:
Yuhong Sun
2024-04-26 18:33:09 -07:00
committed by GitHub
parent 6f2d6fc5f2
commit 4c740060aa

View File

@@ -220,6 +220,11 @@ class SavedSearchDoc(SearchDoc):
search_doc_data["score"] = search_doc_data.get("score") or 0.0
return cls(**search_doc_data, db_doc_id=db_doc_id)
def __lt__(self, other: Any) -> bool:
if not isinstance(other, SavedSearchDoc):
return NotImplemented
return self.score < other.score
class RetrievalDocs(BaseModel):
top_documents: list[SavedSearchDoc]