summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/base_provider.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/base_provider.py')
-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