summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2023-09-11 13:33:59 +0200
committerGitHub <noreply@github.com>2023-09-11 13:33:59 +0200
commit5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36 (patch)
treef6dd367d4c1115aee18ec98ddcaaa9ab5076698e /g4f
parent~| Merge pull request #889 from hlohaus/new (diff)
parentFix: `TypedDict` from `typing` error #886 (diff)
downloadgpt4free-5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36.tar
gpt4free-5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36.tar.gz
gpt4free-5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36.tar.bz2
gpt4free-5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36.tar.lz
gpt4free-5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36.tar.xz
gpt4free-5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36.tar.zst
gpt4free-5e7ea0d8f2db3644ab0d733f9e4f0454da3e9b36.zip
Diffstat (limited to 'g4f')
-rw-r--r--g4f/typing.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/g4f/typing.py b/g4f/typing.py
index 02386037..5f63c222 100644
--- a/g4f/typing.py
+++ b/g4f/typing.py
@@ -1,4 +1,10 @@
-from typing import Any, AsyncGenerator, Generator, NewType, Tuple, TypedDict, Union
+import sys
+from typing import Any, AsyncGenerator, Generator, NewType, Tuple, Union
+
+if sys.version_info >= (3, 8):
+ from typing import TypedDict
+else:
+ from typing_extensions import TypedDict
SHA256 = NewType('sha_256_hash', str)
CreateResult = Generator[str, None, None]
@@ -11,4 +17,4 @@ __all__ = [
'TypedDict',
'SHA256',
'CreateResult',
-] \ No newline at end of file
+]