mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Update internet.py
This commit is contained in:
parent
61428de4f3
commit
bc79969e5c
1 changed files with 2 additions and 2 deletions
|
|
@ -97,9 +97,9 @@ async def fetch_and_scrape(session: ClientSession, url: str, max_words: int = No
|
|||
async def search(query: str, n_results: int = 5, max_words: int = 2500, add_text: bool = True) -> SearchResults:
|
||||
if not has_requirements:
|
||||
raise MissingRequirementsError('Install "duckduckgo-search" and "beautifulsoup4" package')
|
||||
async with DDGS() as ddgs:
|
||||
with DDGS() as ddgs:
|
||||
results = []
|
||||
for result in await ddgs.atext(
|
||||
for result in ddgs.text(
|
||||
query,
|
||||
region="wt-wt",
|
||||
safesearch="moderate",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue