From b89794b8b09d25ef76174ff71c0556030832ffdb Mon Sep 17 00:00:00 2001 From: Darryl Reeves Date: Mon, 28 Jul 2025 11:51:59 -0400 Subject: [PATCH 1/2] Add files via upload --- src/opendeepsearch/context_building/process_sources_pro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opendeepsearch/context_building/process_sources_pro.py b/src/opendeepsearch/context_building/process_sources_pro.py index 91bb152..64deac0 100644 --- a/src/opendeepsearch/context_building/process_sources_pro.py +++ b/src/opendeepsearch/context_building/process_sources_pro.py @@ -71,7 +71,7 @@ async def _fetch_html_contents(self, links: List[str]) -> List[str]: return [x['no_extraction'].content for x in raw_contents.values()] def _process_html_content(self, html: str, query: str) -> str: - if not html: + if not html.strip(): return "" try: # Split the HTML content into chunks @@ -100,4 +100,4 @@ def _update_sources_with_content( for (i, source), html in zip(valid_sources, html_contents): source['html'] = self._process_html_content(html, query) # sources[i] = source - return sources \ No newline at end of file + return sources From 13062aef3e062d585727566df040d256866544b3 Mon Sep 17 00:00:00 2001 From: Darryl Reeves Date: Mon, 28 Jul 2025 15:03:18 -0400 Subject: [PATCH 2/2] Handle case when html is None --- src/opendeepsearch/context_building/process_sources_pro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opendeepsearch/context_building/process_sources_pro.py b/src/opendeepsearch/context_building/process_sources_pro.py index 64deac0..c52a9e0 100644 --- a/src/opendeepsearch/context_building/process_sources_pro.py +++ b/src/opendeepsearch/context_building/process_sources_pro.py @@ -71,7 +71,7 @@ async def _fetch_html_contents(self, links: List[str]) -> List[str]: return [x['no_extraction'].content for x in raw_contents.values()] def _process_html_content(self, html: str, query: str) -> str: - if not html.strip(): + if not html or not html.strip(): return "" try: # Split the HTML content into chunks