Skip to content

Commit

Permalink
Fix: set web_search tool language to english
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninoLorenzo committed Nov 25, 2024
1 parent cbcb7a5 commit 36e8e0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/tools/web_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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}"]
Expand Down Expand Up @@ -104,6 +109,7 @@ def __google_search(
"num": results,
"start": 0,
"safe": "active",
"hl": "en"
},
timeout=timeout,
)
Expand Down

0 comments on commit 36e8e0c

Please sign in to comment.