mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-31 02:11:09 +00:00
fix: handle TypeGuard import for compatibility with older Python versions
This commit is contained in:
parent
a3929c71e4
commit
719c9dfaaa
@ -103,9 +103,14 @@ The module defines several types of content blocks, including:
|
||||
""" # noqa: E501
|
||||
|
||||
import warnings
|
||||
from typing import Any, Literal, Optional, TypeGuard, Union
|
||||
from typing import Any, Literal, Optional, Union
|
||||
from uuid import uuid4
|
||||
|
||||
try:
|
||||
from typing import TypeGuard
|
||||
except ImportError:
|
||||
from typing_extensions import TypeGuard
|
||||
|
||||
from typing_extensions import NotRequired, TypedDict, get_args, get_origin
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user