From e7b89f7fd0aca8eb1db2c1b72ecd033e58da701d Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 16 Jan 2023 22:56:06 -0300 Subject: [PATCH] Return compiled entry in additional details of /api/search response This can be used to highlight portion of raw entry to highlight and for passing to summarizer to stay with max_tokens limit supported by GPT models --- src/search_type/text_search.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/search_type/text_search.py b/src/search_type/text_search.py index 8a758a20..0aba5e2f 100644 --- a/src/search_type/text_search.py +++ b/src/search_type/text_search.py @@ -134,6 +134,7 @@ def collate_results(hits, entries: list[Entry], count=5) -> list[SearchResponse] "score": f"{hit['cross-score'] if 'cross-score' in hit else hit['score']:.3f}", "additional": { "file": entries[hit['corpus_id']].file, + "compiled": entries[hit['corpus_id']].compiled } }) for hit