mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-28 13:53:28 +02:00
Fixed llm_indices from document search api (#1853)
This commit is contained in:
@@ -278,17 +278,17 @@ def search_postprocessing(
|
|||||||
_log_top_section_links(search_query.search_type.value, reranked_sections)
|
_log_top_section_links(search_query.search_type.value, reranked_sections)
|
||||||
yield reranked_sections
|
yield reranked_sections
|
||||||
|
|
||||||
llm_section_selection = cast(
|
llm_selected_section_ids = (
|
||||||
list[str] | None,
|
[
|
||||||
post_processing_results.get(str(llm_filter_task_id))
|
section.center_chunk.unique_id
|
||||||
if llm_filter_task_id
|
for section in post_processing_results.get(str(llm_filter_task_id), [])
|
||||||
else None,
|
|
||||||
)
|
|
||||||
if llm_section_selection is not None:
|
|
||||||
yield [
|
|
||||||
index
|
|
||||||
for index, section in enumerate(reranked_sections or retrieved_sections)
|
|
||||||
if section.center_chunk.unique_id in llm_section_selection
|
|
||||||
]
|
]
|
||||||
else:
|
if llm_filter_task_id
|
||||||
yield cast(list[int], [])
|
else []
|
||||||
|
)
|
||||||
|
|
||||||
|
yield [
|
||||||
|
index
|
||||||
|
for index, section in enumerate(reranked_sections or retrieved_sections)
|
||||||
|
if section.center_chunk.unique_id in llm_selected_section_ids
|
||||||
|
]
|
||||||
|
Reference in New Issue
Block a user