diff --git a/src/opendeepsearch/context_building/process_sources_pro.py b/src/opendeepsearch/context_building/process_sources_pro.py index 91bb152..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: + if not html or 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