From 490cb37c2769f713d6617c0125e9d9e4d66876b7 Mon Sep 17 00:00:00 2001 From: Muhammad Hasnain Date: Tue, 16 Jan 2024 18:55:37 +0500 Subject: [PATCH 1/2] added page(s) to 341 line --- ragna/deploy/_ui/central_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ragna/deploy/_ui/central_view.py b/ragna/deploy/_ui/central_view.py index 8614b8f1..2116398d 100644 --- a/ragna/deploy/_ui/central_view.py +++ b/ragna/deploy/_ui/central_view.py @@ -338,7 +338,7 @@ def on_click_source_info_wrapper(self, event, sources): location = source["location"] if location: location = f": {location}" - markdown.append(f"{rank}. **{source['document']['name']}**{location}") + markdown.append(f"{rank}. **page(s) {source['document']['name']}**{location}") markdown.append("----") self.on_click_chat_info( From 66bb04bbf74fd3258d6027134ef78c6c55739e06 Mon Sep 17 00:00:00 2001 From: Muhammad Hasnain Date: Tue, 16 Jan 2024 21:16:54 +0500 Subject: [PATCH 2/2] pages number added --- ragna/deploy/_ui/central_view.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ragna/deploy/_ui/central_view.py b/ragna/deploy/_ui/central_view.py index 2116398d..24dcc10e 100644 --- a/ragna/deploy/_ui/central_view.py +++ b/ragna/deploy/_ui/central_view.py @@ -336,9 +336,16 @@ def on_click_source_info_wrapper(self, event, sources): ] for rank, source in enumerate(sources, 1): location = source["location"] + pages = source["document"].get("pages") + if location: location = f": {location}" - markdown.append(f"{rank}. **page(s) {source['document']['name']}**{location}") + + if pages: + pages_str = ', '.join(f"Page(s) {page}" for page in pages) + markdown.append(f"{rank}. **{source['document']['name']}**: {pages_str}{location}") + else: + markdown.append(f"{rank}. **{source['document']['name']}**{location}") markdown.append("----") self.on_click_chat_info(