diff --git a/g4f/providers/base_provider.py b/g4f/providers/base_provider.py index 3b5664e7c15..25e2a2e8aba 100644 --- a/g4f/providers/base_provider.py +++ b/g4f/providers/base_provider.py @@ -7,7 +7,10 @@ from abc import abstractmethod from inspect import signature, Parameter from typing import Optional, _GenericAlias -from types import NoneType +try: + from types import NoneType +except ImportError: + NoneType = type(None) from ..typing import CreateResult, AsyncResult, Messages from .types import BaseProvider