langchain
516d74b6 - fix(core): use `get_type_hints` for Python 3.14 `TypedDict` compatibility (#34390)

Commit
56 days ago
fix(core): use `get_type_hints` for Python 3.14 `TypedDict` compatibility (#34390) Replace direct `__annotations__` access with `get_type_hints()` in `_convert_any_typed_dicts_to_pydantic` to handle [PEP 649](https://peps.python.org/pep-0649/) deferred annotations in Python 3.14: > [`Changed in version 3.14: Annotations are now lazily evaluated by default`](https://docs.python.org/3/reference/compound_stmts.html#annotations) Before: ```python class MyTool(TypedDict): name: str MyTool.__annotations__ # {'name': 'str'} - string, not type issubclass('str', ...) # TypeError: arg 1 must be a class ``` After: ```python get_type_hints(MyTool) # {'name': <class 'str'>} - actual type ``` Fixes #34291
Author
Parents
Loading