diff --git a/src/core/tools/web_search.py b/src/core/tools/web_search.py index a9e0fce..0a6f934 100644 --- a/src/core/tools/web_search.py +++ b/src/core/tools/web_search.py @@ -12,6 +12,10 @@ from bs4 import BeautifulSoup from tool_parse import ToolRegistry +from src.utils import get_logger + +logger = get_logger(__name__) + class Search: """Class to perform an online search.""" @@ -63,7 +67,8 @@ def run(self, search_query: str) -> str: results = [] if not links: - print('[!] No links found') + logger.error('No links found') + return '' elif len(links) == 1: title, content, _ = self.__parse(links[0]) results = [f"# {title}\n{content}"] @@ -104,6 +109,7 @@ def __google_search( "num": results, "start": 0, "safe": "active", + "hl": "en" }, timeout=timeout, )