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
This commit is contained in:
Debanjum Singh Solanky 2023-01-16 22:56:06 -03:00
parent 7071d081e9
commit e7b89f7fd0

View file

@ -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}", "score": f"{hit['cross-score'] if 'cross-score' in hit else hit['score']:.3f}",
"additional": { "additional": {
"file": entries[hit['corpus_id']].file, "file": entries[hit['corpus_id']].file,
"compiled": entries[hit['corpus_id']].compiled
} }
}) })
for hit for hit