-
# langgraph/graph/state.py
# class StateGraph(Graph):
def add_node(
self, node: Union[str, RunnableLike], action: Optional[RunnableLike] = None
) -> None: ...
# langchain-core
RunnableLike = Union[
Runnable[Input, Output],
Callable[[Input], Output],
Callable[[Input], Awaitable[Output]],
Callable[[Iterator[Input]], Iterator[Output]],
Callable[[AsyncIterator[Input]], AsyncIterator[Output]],
Mapping[str, Any],
] This is missing the cases for two arguments function forms such as This is showing up as an error in PyCharm and pyright. |
Beta Was this translation helpful? Give feedback.
Answered by
Glinte
Jul 14, 2024
Replies: 1 comment
-
Nevermind, I guess Callable is weird and you should just not annotate optional keyword parameters. i.e. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Glinte
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind, I guess Callable is weird and you should just not annotate optional keyword parameters. i.e.
def f(input: X, *, config: RunnableConfig) -> Y
is justCallable[[X], Y]