Skip to content

Commit

Permalink
Fix: TypedDict from typing error #886
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin-jun-xiang committed Sep 11, 2023
1 parent 7c58dc0 commit b42b6fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions 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]
Expand All @@ -11,4 +17,4 @@
'TypedDict',
'SHA256',
'CreateResult',
]
]
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -9,3 +9,4 @@ js2py
quickjs
flask
flask-cors
typing-extensions

0 comments on commit b42b6fe

Please sign in to comment.