diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9ed1bd6..26d0cf8c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ... ### Fixes -... +- Reverted a bug introduced in `MultipleChunkRetrieverQa` text highlighting. ### Deprecations ... diff --git a/src/intelligence_layer/examples/qa/multiple_chunk_retriever_qa.py b/src/intelligence_layer/examples/qa/multiple_chunk_retriever_qa.py index 9b4ada941..794be3f85 100644 --- a/src/intelligence_layer/examples/qa/multiple_chunk_retriever_qa.py +++ b/src/intelligence_layer/examples/qa/multiple_chunk_retriever_qa.py @@ -156,15 +156,10 @@ def _combine_input_texts( start_indices: list[int] = [] combined_text = "" for i, chunk in enumerate(chunks): + combined_text += source_appendix.format(i=i + 1) start_indices.append(len(combined_text)) - - c = source_appendix.format(i=i + 1) - c += chunk + "\n\n" - c = c.strip() - if i != 0: - c = " " + c - combined_text += c - return (TextChunk(combined_text), start_indices) + combined_text += chunk + "\n\n" + return (TextChunk(combined_text.strip()), start_indices) @staticmethod def _get_highlights_per_chunk(