summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/helper.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-27 02:00:44 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-27 02:00:44 +0100
commit47b50b4827121ec68d9e52a018b631a4a3f09625 (patch)
treed4d9d2040f8588634413be86d7e24b914fa6e29c /g4f/Provider/helper.py
parentFix: ChromeDriver only supports characters in the BMP (diff)
downloadgpt4free-47b50b4827121ec68d9e52a018b631a4a3f09625.tar
gpt4free-47b50b4827121ec68d9e52a018b631a4a3f09625.tar.gz
gpt4free-47b50b4827121ec68d9e52a018b631a4a3f09625.tar.bz2
gpt4free-47b50b4827121ec68d9e52a018b631a4a3f09625.tar.lz
gpt4free-47b50b4827121ec68d9e52a018b631a4a3f09625.tar.xz
gpt4free-47b50b4827121ec68d9e52a018b631a4a3f09625.tar.zst
gpt4free-47b50b4827121ec68d9e52a018b631a4a3f09625.zip
Diffstat (limited to 'g4f/Provider/helper.py')
-rw-r--r--g4f/Provider/helper.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/g4f/Provider/helper.py b/g4f/Provider/helper.py
index 87fdb158..9788bffd 100644
--- a/g4f/Provider/helper.py
+++ b/g4f/Provider/helper.py
@@ -22,11 +22,11 @@ except ImportError:
has_browser_cookie3 = False
from ..typing import Dict, Messages, Cookies, Optional
-from ..errors import AiohttpSocksError, MissingRequirementsError
+from ..errors import MissingAiohttpSocksError, MissingRequirementsError
from .. import debug
# Global variable to store cookies
-_cookies: Dict[str, Dict[str, str]] = {}
+_cookies: Dict[str, Cookies] = {}
if has_browser_cookie3 and os.environ.get('DBUS_SESSION_BUS_ADDRESS') == "/dev/null":
_LinuxPasswordManager.get_password = lambda a, b: b"secret"
@@ -54,7 +54,7 @@ def set_cookies(domain_name: str, cookies: Cookies = None) -> None:
else:
_cookies.pop(domain_name)
-def load_cookies_from_browsers(domain_name: str, raise_requirements_error: bool = True) -> Dict[str, str]:
+def load_cookies_from_browsers(domain_name: str, raise_requirements_error: bool = True) -> Cookies:
"""
Helper function to load cookies from various browsers.
@@ -149,5 +149,5 @@ def get_connector(connector: BaseConnector = None, proxy: str = None) -> Optiona
from aiohttp_socks import ProxyConnector
connector = ProxyConnector.from_url(proxy)
except ImportError:
- raise AiohttpSocksError('Install "aiohttp_socks" package for proxy support')
+ raise MissingAiohttpSocksError('Install "aiohttp_socks" package for proxy support')
return connector \ No newline at end of file