Add RAG_WEB_LOADER + Playwright mode + improve stability of search

This commit is contained in:
Rory committed 2025-01-28 23:03:15 -06:00
1 parent b72150c881
commit 4e8b390682
10 files changed
+220 -39

No files matched your search

+4
View File
@@ -1,3 +1,5 @@
import validators
from typing import Optional
from urllib.parse import urlparse
@@ -10,6 +12,8 @@ def get_filtered_results(results, filter_list):
filtered_results = []
for result in results:
url = result.get("url") or result.get("link", "")
if not validators.url(url):
continue
domain = urlparse(url).netloc
if any(domain.endswith(filtered_domain) for filtered_domain in filter_list):
filtered_results.append(result)