Skip to content

Commit 749ed7d

Browse files
committed
fix(core): correct Callable import and return annotation in as_message_state
1 parent 63e81ef commit 749ed7d

File tree

1 file changed

+3
-2
lines changed
  • libs/core/langchain_core/messages

1 file changed

+3
-2
lines changed

libs/core/langchain_core/messages/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
import json
1515
import logging
1616
import math
17-
from collections.abc import Callable, Iterable, Sequence
17+
from collections.abc import Iterable, Sequence
1818
from functools import partial
1919
from typing import (
2020
TYPE_CHECKING,
2121
Annotated,
2222
Any,
23+
Callable,
2324
Literal,
2425
cast,
2526
overload,
@@ -1794,7 +1795,7 @@ def to_message_state(obj: Any) -> dict[str, list[BaseMessage]]:
17941795
raise TypeError(msg)
17951796

17961797

1797-
def as_message_state() -> callable:
1798+
def as_message_state() -> Callable[[Any], dict[str, list[BaseMessage]]]:
17981799
"""Return an LCEL-friendly wrapper that normalizes outputs into message state.
17991800
18001801
Returns:

0 commit comments

Comments
 (0)