mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-05 18:20:35 -08:00
Fix ddgs search
This commit is contained in:
parent
c4b18df769
commit
acffc939cf
4 changed files with 13 additions and 13 deletions
|
|
@ -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
|
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)
|
messages[-1]["content"], sources = await do_search(messages[-1]["content"], search_query)
|
||||||
except Exception as e:
|
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
|
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
|
# 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))
|
messages[-1]["content"], sources = asyncio.run(do_search(messages[-1]["content"], search_query))
|
||||||
except Exception as e:
|
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
|
# Get API key if needed
|
||||||
if provider is not None:
|
if provider is not None:
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ pycryptodome
|
||||||
curl_cffi>=0.6.2
|
curl_cffi>=0.6.2
|
||||||
aiohttp
|
aiohttp
|
||||||
certifi
|
certifi
|
||||||
duckduckgo-search>=6.3.7
|
|
||||||
nest_asyncio
|
nest_asyncio
|
||||||
werkzeug
|
werkzeug
|
||||||
pillow
|
pillow
|
||||||
|
|
@ -17,4 +16,5 @@ cryptography
|
||||||
python-multipart
|
python-multipart
|
||||||
markitdown[all]
|
markitdown[all]
|
||||||
a2wsgi
|
a2wsgi
|
||||||
python-dotenv
|
python-dotenv
|
||||||
|
ddgs
|
||||||
|
|
@ -4,7 +4,6 @@ curl_cffi>=0.6.2
|
||||||
aiohttp
|
aiohttp
|
||||||
certifi
|
certifi
|
||||||
browser_cookie3
|
browser_cookie3
|
||||||
duckduckgo-search>=5.0
|
|
||||||
nest_asyncio
|
nest_asyncio
|
||||||
werkzeug
|
werkzeug
|
||||||
pillow
|
pillow
|
||||||
|
|
@ -21,3 +20,4 @@ python-multipart
|
||||||
markitdown[all]
|
markitdown[all]
|
||||||
a2wsgi
|
a2wsgi
|
||||||
python-dotenv
|
python-dotenv
|
||||||
|
ddgs
|
||||||
|
|
|
||||||
14
setup.py
14
setup.py
|
|
@ -21,9 +21,9 @@ EXTRA_REQUIRE = {
|
||||||
'all': [
|
'all': [
|
||||||
"curl_cffi>=0.6.2",
|
"curl_cffi>=0.6.2",
|
||||||
"certifi",
|
"certifi",
|
||||||
"browser_cookie3", # get_cookies
|
"browser_cookie3", # get_cookies
|
||||||
"duckduckgo-search>=5.0", # internet.search
|
"ddgs", # web_search
|
||||||
"beautifulsoup4", # internet.search and bing.create_images
|
"beautifulsoup4", # web_search and bing.create_images
|
||||||
"platformdirs",
|
"platformdirs",
|
||||||
"aiohttp_socks", # proxy
|
"aiohttp_socks", # proxy
|
||||||
"pillow", # image
|
"pillow", # image
|
||||||
|
|
@ -44,8 +44,8 @@ EXTRA_REQUIRE = {
|
||||||
"curl_cffi>=0.6.2",
|
"curl_cffi>=0.6.2",
|
||||||
"certifi",
|
"certifi",
|
||||||
"browser_cookie3",
|
"browser_cookie3",
|
||||||
"duckduckgo-search>=5.0" ,# internet.search
|
"ddgs", # web_search
|
||||||
"beautifulsoup4", # internet.search and bing.create_images
|
"beautifulsoup4", # web_search and bing.create_images
|
||||||
"aiohttp_socks", # proxy
|
"aiohttp_socks", # proxy
|
||||||
"pillow", # image
|
"pillow", # image
|
||||||
"werkzeug", "flask", # gui
|
"werkzeug", "flask", # gui
|
||||||
|
|
@ -75,12 +75,12 @@ EXTRA_REQUIRE = {
|
||||||
"gui": [
|
"gui": [
|
||||||
"werkzeug", "flask",
|
"werkzeug", "flask",
|
||||||
"beautifulsoup4", "pillow",
|
"beautifulsoup4", "pillow",
|
||||||
"duckduckgo-search>=5.0",
|
"ddgs",
|
||||||
],
|
],
|
||||||
"search": [
|
"search": [
|
||||||
"beautifulsoup4",
|
"beautifulsoup4",
|
||||||
"pillow",
|
"pillow",
|
||||||
"duckduckgo-search>=5.0",
|
"ddgs",
|
||||||
],
|
],
|
||||||
"local": [
|
"local": [
|
||||||
"gpt4all"
|
"gpt4all"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue