mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-03 13:34:36 +00:00
Fix ddgs search
This commit is contained in:
@@ -216,8 +216,8 @@ async def perform_web_search(messages: Messages, web_search_param: Any) -> Tuple
|
||||
search_query = web_search_param if isinstance(web_search_param, str) and web_search_param != "true" else None
|
||||
messages[-1]["content"], sources = await do_search(messages[-1]["content"], search_query)
|
||||
except Exception as e:
|
||||
debug.error(f"Couldn't do web search: {e.__class__.__name__}: {e}")
|
||||
|
||||
debug.error(f"Couldn't do web search:", e)
|
||||
|
||||
return messages, sources
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ def iter_run_tools(
|
||||
# Note: Using asyncio.run inside sync function is not ideal, but maintaining original pattern
|
||||
messages[-1]["content"], sources = asyncio.run(do_search(messages[-1]["content"], search_query))
|
||||
except Exception as e:
|
||||
debug.error(f"Couldn't do web search: {e.__class__.__name__}: {e}")
|
||||
debug.error(f"Couldn't do web search:", e)
|
||||
|
||||
# Get API key if needed
|
||||
if provider is not None:
|
||||
|
||||
@@ -3,7 +3,6 @@ pycryptodome
|
||||
curl_cffi>=0.6.2
|
||||
aiohttp
|
||||
certifi
|
||||
duckduckgo-search>=6.3.7
|
||||
nest_asyncio
|
||||
werkzeug
|
||||
pillow
|
||||
@@ -17,4 +16,5 @@ cryptography
|
||||
python-multipart
|
||||
markitdown[all]
|
||||
a2wsgi
|
||||
python-dotenv
|
||||
python-dotenv
|
||||
ddgs
|
||||
@@ -4,7 +4,6 @@ curl_cffi>=0.6.2
|
||||
aiohttp
|
||||
certifi
|
||||
browser_cookie3
|
||||
duckduckgo-search>=5.0
|
||||
nest_asyncio
|
||||
werkzeug
|
||||
pillow
|
||||
@@ -21,3 +20,4 @@ python-multipart
|
||||
markitdown[all]
|
||||
a2wsgi
|
||||
python-dotenv
|
||||
ddgs
|
||||
|
||||
14
setup.py
14
setup.py
@@ -21,9 +21,9 @@ EXTRA_REQUIRE = {
|
||||
'all': [
|
||||
"curl_cffi>=0.6.2",
|
||||
"certifi",
|
||||
"browser_cookie3", # get_cookies
|
||||
"duckduckgo-search>=5.0", # internet.search
|
||||
"beautifulsoup4", # internet.search and bing.create_images
|
||||
"browser_cookie3", # get_cookies
|
||||
"ddgs", # web_search
|
||||
"beautifulsoup4", # web_search and bing.create_images
|
||||
"platformdirs",
|
||||
"aiohttp_socks", # proxy
|
||||
"pillow", # image
|
||||
@@ -44,8 +44,8 @@ EXTRA_REQUIRE = {
|
||||
"curl_cffi>=0.6.2",
|
||||
"certifi",
|
||||
"browser_cookie3",
|
||||
"duckduckgo-search>=5.0" ,# internet.search
|
||||
"beautifulsoup4", # internet.search and bing.create_images
|
||||
"ddgs", # web_search
|
||||
"beautifulsoup4", # web_search and bing.create_images
|
||||
"aiohttp_socks", # proxy
|
||||
"pillow", # image
|
||||
"werkzeug", "flask", # gui
|
||||
@@ -75,12 +75,12 @@ EXTRA_REQUIRE = {
|
||||
"gui": [
|
||||
"werkzeug", "flask",
|
||||
"beautifulsoup4", "pillow",
|
||||
"duckduckgo-search>=5.0",
|
||||
"ddgs",
|
||||
],
|
||||
"search": [
|
||||
"beautifulsoup4",
|
||||
"pillow",
|
||||
"duckduckgo-search>=5.0",
|
||||
"ddgs",
|
||||
],
|
||||
"local": [
|
||||
"gpt4all"
|
||||
|
||||
Reference in New Issue
Block a user