PydanticUserError: Please use typing_extensions.TypedDict instead of typing.TypedDict on Python < 3.12. #377

Closed
opened 2026-02-20 17:39:14 -05:00 by yindo · 2 comments
Owner

Originally created by @mariomeissner on GitHub (Dec 31, 2024).

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

from langgraph.graph import MessagesState
from prisma.models import Document

class CustomState(MessagesState):
    document_store: dict[str, str]

Error Message and Stack Trace (if applicable)

copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
copilot-api:dev: │ │                       annotation = <class 'langgraph.prebuilt.tool_node.InjectedState'>      │ │
copilot-api:dev: │ │                 get_inner_schema = <pydantic._internal._schema_generation_shared.CallbackGe… │ │
copilot-api:dev: │ │                                    object at 0x1048746d0>                                    │ │
copilot-api:dev: │ │              metadata_get_schema = <function                                                 │ │
copilot-api:dev: │ │                                    GenerateSchema._get_wrapped_inner_schema.<locals>.<lambd… │ │
copilot-api:dev: │ │                                    at 0x1235401f0>                                           │ │
copilot-api:dev: │ │ pydantic_js_annotation_functions = []                                                        │ │
copilot-api:dev: │ │                             self = <pydantic._internal._generate_schema.GenerateSchema       │ │
copilot-api:dev: │ │                                    object at 0x1056acf40>                                    │ │
copilot-api:dev: │ │                           source = <class 'copilot_api.state.CustomState'>                   │ │
copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │
copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:1968 in <lambda>                                │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │   1965 │   │   pydantic_js_annotation_functions: list[GetJsonSchemaFunction],                    │
copilot-api:dev: │   1966) -> CallbackGetCoreSchemaHandler:                                                    │
copilot-api:dev: │   1967 │   │   metadata_get_schema: GetCoreSchemaFunction = getattr(annotation, '__get_pydantic  │
copilot-api:dev: │ ❱ 1968 │   │   │   lambda source, handler: handler(source)                                       │
copilot-api:dev: │   1969 │   │   )                                                                                 │
copilot-api:dev: │   1970 │   │                                                                                     │
copilot-api:dev: │   1971 │   │   def new_handler(source: Any) -> core_schema.CoreSchema:                           │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
copilot-api:dev: │ │ handler = <pydantic._internal._schema_generation_shared.CallbackGetCoreSchemaHandler object  │ │
copilot-api:dev: │ │           at 0x1048746d0>                                                                    │ │
copilot-api:dev: │ │  source = <class 'copilot_api.state.CustomState'>                                            │ │
copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │
copilot-api:dev: │ -packages/pydantic/_internal/_schema_generation_shared.py:83 in __call__                         │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │    80 │   │   self._ref_mode = ref_mode                                                          │
copilot-api:dev: │    81 │                                                                                          │
copilot-api:dev: │    82 │   def __call__(self, source_type: Any, /) -> core_schema.CoreSchema:                     │
copilot-api:dev: │ ❱  83 │   │   schema = self._handler(source_type)                                                │
copilot-api:dev: │    84 │   │   ref = schema.get('ref')                                                            │
copilot-api:dev: │    85 │   │   if self._ref_mode == 'to-def':                                                     │
copilot-api:dev: │    86 │   │   │   if ref is not None:                                                            │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
copilot-api:dev: │ │        self = <pydantic._internal._schema_generation_shared.CallbackGetCoreSchemaHandler     │ │
copilot-api:dev: │ │               object at 0x1048746d0>                                                         │ │
copilot-api:dev: │ │ source_type = <class 'copilot_api.state.CustomState'>                                        │ │
copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │
copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:1871 in inner_handler                           │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │   1868 │   │   def inner_handler(obj: Any) -> CoreSchema:                                        │
copilot-api:dev: │   1869 │   │   │   from_property = self._generate_schema_from_property(obj, source_type)         │
copilot-api:dev: │   1870 │   │   │   if from_property is None:                                                     │
copilot-api:dev: │ ❱ 1871 │   │   │   │   schema = self._generate_schema_inner(obj)                                 │
copilot-api:dev: │   1872 │   │   │   else:                                                                         │
copilot-api:dev: │   1873 │   │   │   │   schema = from_property                                                    │
copilot-api:dev: │   1874 │   │   │   metadata_js_function = _extract_get_pydantic_json_schema(obj, schema)         │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
copilot-api:dev: │ │          from_property = None                                                                │ │
copilot-api:dev: │ │                    obj = <class 'copilot_api.state.CustomState'>                             │ │
copilot-api:dev: │ │                   self = <pydantic._internal._generate_schema.GenerateSchema object at       │ │
copilot-api:dev: │ │                          0x1056acf40>                                                        │ │
copilot-api:dev: │ │            source_type = <class 'copilot_api.state.CustomState'>                             │ │
copilot-api:dev: │ │ transform_inner_schema = <function GenerateSchema.<lambda> at 0x10191f5b0>                   │ │
copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │
copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:789 in _generate_schema_inner                   │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │    786 │   │   if isinstance(obj, PydanticRecursiveRef):                                         │
copilot-api:dev: │    787 │   │   │   return core_schema.definition_reference_schema(schema_ref=obj.type_ref)       │
copilot-api:dev: │    788 │   │                                                                                     │
copilot-api:dev: │ ❱  789 │   │   return self.match_type(obj)                                                       │
copilot-api:dev: │    790 │                                                                                         │
copilot-api:dev: │    791 │   def match_type(self, obj: Any) -> core_schema.CoreSchema:  # noqa: C901               │
copilot-api:dev: │    792 │   │   """Main mapping of types to schemas.                                              │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ ╭──────────────────────────────────────── locals ────────────────────────────────────────╮       │
copilot-api:dev: │ │ BaseModel = <class 'pydantic.main.BaseModel'>                                          │       │
copilot-api:dev: │ │       obj = <class 'copilot_api.state.CustomState'>                                    │       │
copilot-api:dev: │ │      self = <pydantic._internal._generate_schema.GenerateSchema object at 0x1056acf40> │       │
copilot-api:dev: │ ╰────────────────────────────────────────────────────────────────────────────────────────╯       │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │
copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:837 in match_type                               │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │    834 │   │   elif _typing_extra.is_literal_type(obj):                                          │
copilot-api:dev: │    835 │   │   │   return self._literal_schema(obj)                                              │
copilot-api:dev: │    836 │   │   elif is_typeddict(obj):                                                           │
copilot-api:dev: │ ❱  837 │   │   │   return self._typed_dict_schema(obj, None)                                     │
copilot-api:dev: │    838 │   │   elif _typing_extra.is_namedtuple(obj):                                            │
copilot-api:dev: │    839 │   │   │   return self._namedtuple_schema(obj, None)                                     │
copilot-api:dev: │    840 │   │   elif _typing_extra.is_new_type(obj):                                              │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ ╭───────────────────────────────────── locals ──────────────────────────────────────╮            │
copilot-api:dev: │ │  obj = <class 'copilot_api.state.CustomState'>                                    │            │
copilot-api:dev: │ │ self = <pydantic._internal._generate_schema.GenerateSchema object at 0x1056acf40> │            │
copilot-api:dev: │ ╰───────────────────────────────────────────────────────────────────────────────────╯            │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │
copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:1283 in _typed_dict_schema                      │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │   1280 │   │   │   │   typed_dict_cls = origin                                                   │
copilot-api:dev: │   1281 │   │   │                                                                                 │
copilot-api:dev: │   1282 │   │   │   if not _SUPPORTS_TYPEDDICT and type(typed_dict_cls).__module__ == 'typing':   │
copilot-api:dev: │ ❱ 1283 │   │   │   │   raise PydanticUserError(                                                  │
copilot-api:dev: │   1284 │   │   │   │   │   'Please use `typing_extensions.TypedDict` instead of `typing.TypedDi  │
copilot-api:dev: │   1285 │   │   │   │   │   code='typed-dict-version',                                            │
copilot-api:dev: │   1286 │   │   │   │   )                                                                         │
copilot-api:dev: │                                                                                                  │
copilot-api:dev: │ ╭────────────────────────────────────────── locals ───────────────────────────────────────────╮  │
copilot-api:dev: │ │      FieldInfo = <class 'pydantic.fields.FieldInfo'>                                        │  │
copilot-api:dev: │ │   maybe_schema = None                                                                       │  │
copilot-api:dev: │ │         origin = None                                                                       │  │
copilot-api:dev: │ │           self = <pydantic._internal._generate_schema.GenerateSchema object at 0x1056acf40> │  │
copilot-api:dev: │ │ typed_dict_cls = <class 'copilot_api.state.CustomState'>                                    │  │
copilot-api:dev: │ │ typed_dict_ref = 'copilot_api.state.CustomState:4394103488'                                 │  │
copilot-api:dev: │ │   typevars_map = None                                                                       │  │
copilot-api:dev: │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯  │
copilot-api:dev: ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
copilot-api:dev: PydanticUserError: Please use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.12.
copilot-api:dev:
copilot-api:dev: For further information visit https://errors.pydantic.dev/2.8/u/typed-dict-version
copilot-api:dev:  ELIFECYCLE  Command failed with exit code 1.
copilot-api:dev:  WARN   Local package.json exists, but node_modules missing, did you mean to install?
copilot-api:dev: ERROR: command finished with error: command (/Users/mario/Projects/research-copilot/apps/copilot_api) /opt/homebrew/bin/pnpm run dev exited (1)

Description

Verified happening on langgraph 0.2.53 ~ 0.2.60

The problem is in graph/message.py, line 2.
There might be more instances throughout the code though, let's try to catch them all.

There were similar issues in the past:
https://github.com/langchain-ai/langgraph/issues/1856
https://github.com/langchain-ai/langgraph/issues/2198

Might be worthwhile to come up with a way to check that this remains compatible.

I might be able to issue a PR for this myself over the coming days.

System Info

NA

Originally created by @mariomeissner on GitHub (Dec 31, 2024). ### Checked other resources - [X] This is a bug, not a usage question. For questions, please use GitHub Discussions. - [X] I added a clear and detailed title that summarizes the issue. - [X] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [X] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python from langgraph.graph import MessagesState from prisma.models import Document class CustomState(MessagesState): document_store: dict[str, str] ``` ### Error Message and Stack Trace (if applicable) ```shell copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ copilot-api:dev: │ │ annotation = <class 'langgraph.prebuilt.tool_node.InjectedState'> │ │ copilot-api:dev: │ │ get_inner_schema = <pydantic._internal._schema_generation_shared.CallbackGe… │ │ copilot-api:dev: │ │ object at 0x1048746d0> │ │ copilot-api:dev: │ │ metadata_get_schema = <function │ │ copilot-api:dev: │ │ GenerateSchema._get_wrapped_inner_schema.<locals>.<lambd… │ │ copilot-api:dev: │ │ at 0x1235401f0> │ │ copilot-api:dev: │ │ pydantic_js_annotation_functions = [] │ │ copilot-api:dev: │ │ self = <pydantic._internal._generate_schema.GenerateSchema │ │ copilot-api:dev: │ │ object at 0x1056acf40> │ │ copilot-api:dev: │ │ source = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ copilot-api:dev: │ │ copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │ copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:1968 in <lambda> │ copilot-api:dev: │ │ copilot-api:dev: │ 1965 │ │ pydantic_js_annotation_functions: list[GetJsonSchemaFunction], │ copilot-api:dev: │ 1966 │ ) -> CallbackGetCoreSchemaHandler: │ copilot-api:dev: │ 1967 │ │ metadata_get_schema: GetCoreSchemaFunction = getattr(annotation, '__get_pydantic │ copilot-api:dev: │ ❱ 1968 │ │ │ lambda source, handler: handler(source) │ copilot-api:dev: │ 1969 │ │ ) │ copilot-api:dev: │ 1970 │ │ │ copilot-api:dev: │ 1971 │ │ def new_handler(source: Any) -> core_schema.CoreSchema: │ copilot-api:dev: │ │ copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ copilot-api:dev: │ │ handler = <pydantic._internal._schema_generation_shared.CallbackGetCoreSchemaHandler object │ │ copilot-api:dev: │ │ at 0x1048746d0> │ │ copilot-api:dev: │ │ source = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ copilot-api:dev: │ │ copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │ copilot-api:dev: │ -packages/pydantic/_internal/_schema_generation_shared.py:83 in __call__ │ copilot-api:dev: │ │ copilot-api:dev: │ 80 │ │ self._ref_mode = ref_mode │ copilot-api:dev: │ 81 │ │ copilot-api:dev: │ 82 │ def __call__(self, source_type: Any, /) -> core_schema.CoreSchema: │ copilot-api:dev: │ ❱ 83 │ │ schema = self._handler(source_type) │ copilot-api:dev: │ 84 │ │ ref = schema.get('ref') │ copilot-api:dev: │ 85 │ │ if self._ref_mode == 'to-def': │ copilot-api:dev: │ 86 │ │ │ if ref is not None: │ copilot-api:dev: │ │ copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ copilot-api:dev: │ │ self = <pydantic._internal._schema_generation_shared.CallbackGetCoreSchemaHandler │ │ copilot-api:dev: │ │ object at 0x1048746d0> │ │ copilot-api:dev: │ │ source_type = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ copilot-api:dev: │ │ copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │ copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:1871 in inner_handler │ copilot-api:dev: │ │ copilot-api:dev: │ 1868 │ │ def inner_handler(obj: Any) -> CoreSchema: │ copilot-api:dev: │ 1869 │ │ │ from_property = self._generate_schema_from_property(obj, source_type) │ copilot-api:dev: │ 1870 │ │ │ if from_property is None: │ copilot-api:dev: │ ❱ 1871 │ │ │ │ schema = self._generate_schema_inner(obj) │ copilot-api:dev: │ 1872 │ │ │ else: │ copilot-api:dev: │ 1873 │ │ │ │ schema = from_property │ copilot-api:dev: │ 1874 │ │ │ metadata_js_function = _extract_get_pydantic_json_schema(obj, schema) │ copilot-api:dev: │ │ copilot-api:dev: │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ copilot-api:dev: │ │ from_property = None │ │ copilot-api:dev: │ │ obj = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ │ self = <pydantic._internal._generate_schema.GenerateSchema object at │ │ copilot-api:dev: │ │ 0x1056acf40> │ │ copilot-api:dev: │ │ source_type = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ │ transform_inner_schema = <function GenerateSchema.<lambda> at 0x10191f5b0> │ │ copilot-api:dev: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ copilot-api:dev: │ │ copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │ copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:789 in _generate_schema_inner │ copilot-api:dev: │ │ copilot-api:dev: │ 786 │ │ if isinstance(obj, PydanticRecursiveRef): │ copilot-api:dev: │ 787 │ │ │ return core_schema.definition_reference_schema(schema_ref=obj.type_ref) │ copilot-api:dev: │ 788 │ │ │ copilot-api:dev: │ ❱ 789 │ │ return self.match_type(obj) │ copilot-api:dev: │ 790 │ │ copilot-api:dev: │ 791 │ def match_type(self, obj: Any) -> core_schema.CoreSchema: # noqa: C901 │ copilot-api:dev: │ 792 │ │ """Main mapping of types to schemas. │ copilot-api:dev: │ │ copilot-api:dev: │ ╭──────────────────────────────────────── locals ────────────────────────────────────────╮ │ copilot-api:dev: │ │ BaseModel = <class 'pydantic.main.BaseModel'> │ │ copilot-api:dev: │ │ obj = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ │ self = <pydantic._internal._generate_schema.GenerateSchema object at 0x1056acf40> │ │ copilot-api:dev: │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ │ copilot-api:dev: │ │ copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │ copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:837 in match_type │ copilot-api:dev: │ │ copilot-api:dev: │ 834 │ │ elif _typing_extra.is_literal_type(obj): │ copilot-api:dev: │ 835 │ │ │ return self._literal_schema(obj) │ copilot-api:dev: │ 836 │ │ elif is_typeddict(obj): │ copilot-api:dev: │ ❱ 837 │ │ │ return self._typed_dict_schema(obj, None) │ copilot-api:dev: │ 838 │ │ elif _typing_extra.is_namedtuple(obj): │ copilot-api:dev: │ 839 │ │ │ return self._namedtuple_schema(obj, None) │ copilot-api:dev: │ 840 │ │ elif _typing_extra.is_new_type(obj): │ copilot-api:dev: │ │ copilot-api:dev: │ ╭───────────────────────────────────── locals ──────────────────────────────────────╮ │ copilot-api:dev: │ │ obj = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ │ self = <pydantic._internal._generate_schema.GenerateSchema object at 0x1056acf40> │ │ copilot-api:dev: │ ╰───────────────────────────────────────────────────────────────────────────────────╯ │ copilot-api:dev: │ │ copilot-api:dev: │ /Users/mario/Library/Caches/pypoetry/virtualenvs/copilot-api-7C_KWYzt-py3.10/lib/python3.10/site │ copilot-api:dev: │ -packages/pydantic/_internal/_generate_schema.py:1283 in _typed_dict_schema │ copilot-api:dev: │ │ copilot-api:dev: │ 1280 │ │ │ │ typed_dict_cls = origin │ copilot-api:dev: │ 1281 │ │ │ │ copilot-api:dev: │ 1282 │ │ │ if not _SUPPORTS_TYPEDDICT and type(typed_dict_cls).__module__ == 'typing': │ copilot-api:dev: │ ❱ 1283 │ │ │ │ raise PydanticUserError( │ copilot-api:dev: │ 1284 │ │ │ │ │ 'Please use `typing_extensions.TypedDict` instead of `typing.TypedDi │ copilot-api:dev: │ 1285 │ │ │ │ │ code='typed-dict-version', │ copilot-api:dev: │ 1286 │ │ │ │ ) │ copilot-api:dev: │ │ copilot-api:dev: │ ╭────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ copilot-api:dev: │ │ FieldInfo = <class 'pydantic.fields.FieldInfo'> │ │ copilot-api:dev: │ │ maybe_schema = None │ │ copilot-api:dev: │ │ origin = None │ │ copilot-api:dev: │ │ self = <pydantic._internal._generate_schema.GenerateSchema object at 0x1056acf40> │ │ copilot-api:dev: │ │ typed_dict_cls = <class 'copilot_api.state.CustomState'> │ │ copilot-api:dev: │ │ typed_dict_ref = 'copilot_api.state.CustomState:4394103488' │ │ copilot-api:dev: │ │ typevars_map = None │ │ copilot-api:dev: │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ │ copilot-api:dev: ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ copilot-api:dev: PydanticUserError: Please use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.12. copilot-api:dev: copilot-api:dev: For further information visit https://errors.pydantic.dev/2.8/u/typed-dict-version copilot-api:dev:  ELIFECYCLE  Command failed with exit code 1. copilot-api:dev:  WARN  Local package.json exists, but node_modules missing, did you mean to install? copilot-api:dev: ERROR: command finished with error: command (/Users/mario/Projects/research-copilot/apps/copilot_api) /opt/homebrew/bin/pnpm run dev exited (1) ``` ### Description Verified happening on langgraph 0.2.53 ~ 0.2.60 The problem is in `graph/message.py`, line 2. There might be more instances throughout the code though, let's try to catch them all. There were similar issues in the past: https://github.com/langchain-ai/langgraph/issues/1856 https://github.com/langchain-ai/langgraph/issues/2198 Might be worthwhile to come up with a way to check that this remains compatible. I might be able to issue a PR for this myself over the coming days. ### System Info NA
yindo closed this issue 2026-02-20 17:39:14 -05:00
Author
Owner

@mariomeissner commented on GitHub (Dec 31, 2024):

There's a way to detect this with ruff too:
https://docs.astral.sh/ruff/settings/#lint_flake8-tidy-imports_ban-relative-imports
https://docs.astral.sh/ruff/rules/banned-api/

Might be useful to add.

@mariomeissner commented on GitHub (Dec 31, 2024): There's a way to detect this with ruff too: https://docs.astral.sh/ruff/settings/#lint_flake8-tidy-imports_ban-relative-imports https://docs.astral.sh/ruff/rules/banned-api/ Might be useful to add.
Author
Owner

@mariomeissner commented on GitHub (Dec 31, 2024):

Just raised a PR for this myself: #2910

@mariomeissner commented on GitHub (Dec 31, 2024): Just raised a PR for this myself: #2910
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#377