summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/base_provider.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-01 02:09:06 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-01 02:09:06 +0100
commitebc522150eca6d458eb54d24594f71e28e91360a (patch)
tree842b124b449f1741d2070b7d4981da0bd95bfd64 /g4f/Provider/base_provider.py
parentAdd _puid cookie, save access_token in cookies in OpenaiChat (diff)
downloadgpt4free-ebc522150eca6d458eb54d24594f71e28e91360a.tar
gpt4free-ebc522150eca6d458eb54d24594f71e28e91360a.tar.gz
gpt4free-ebc522150eca6d458eb54d24594f71e28e91360a.tar.bz2
gpt4free-ebc522150eca6d458eb54d24594f71e28e91360a.tar.lz
gpt4free-ebc522150eca6d458eb54d24594f71e28e91360a.tar.xz
gpt4free-ebc522150eca6d458eb54d24594f71e28e91360a.tar.zst
gpt4free-ebc522150eca6d458eb54d24594f71e28e91360a.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/base_provider.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/g4f/Provider/base_provider.py b/g4f/Provider/base_provider.py
index f3959634..62029f5d 100644
--- a/g4f/Provider/base_provider.py
+++ b/g4f/Provider/base_provider.py
@@ -13,6 +13,13 @@ if sys.version_info < (3, 10):
else:
from types import NoneType
+# Change event loop policy on windows for curl_cffi
+if sys.platform == 'win32':
+ if isinstance(
+ asyncio.get_event_loop_policy(), asyncio.WindowsProactorEventLoopPolicy
+ ):
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+
class BaseProvider(ABC):
url: str
working: bool = False