Export useful class in order to Create my custom ToolNode #120

Closed
opened 2026-02-15 17:15:58 -05:00 by yindo · 3 comments
Owner

Originally created by @msalafia on GitHub (Oct 17, 2024).

I wanted to develop my own ToolNode with some custom logic but i could not do this because some utility classes and types (like RunnableCallable) are not exposed by @langchain/langgraph.

I cannot even extend ToolNode behaviour because the run method of ToolNode is private.

Can such classes and types be exported? Or maybe provide some guides on how define a custom ToolNode?

Originally created by @msalafia on GitHub (Oct 17, 2024). I wanted to develop my own ToolNode with some custom logic but i could not do this because some utility classes and types (like `RunnableCallable`) are not exposed by @langchain/langgraph. I cannot even extend ToolNode behaviour because the `run` method of `ToolNode` is private. Can such classes and types be exported? Or maybe provide some guides on how define a custom ToolNode?
yindo closed this issue 2026-02-15 17:15:58 -05:00
Author
Owner

@jacoblee93 commented on GitHub (Oct 17, 2024):

Hey @msalafia, I can export the additional types to allow for this - to date folks have generally implemented their own executor logic but I don't see any reason why subclassing should be difficult.

We should have a guide for custom tool executors as well.

@jacoblee93 commented on GitHub (Oct 17, 2024): Hey @msalafia, I can export the additional types to allow for this - to date folks have generally implemented their own executor logic but I don't see any reason why subclassing should be difficult. We should have a guide for custom tool executors as well.
Author
Owner

@jacoblee93 commented on GitHub (Oct 17, 2024):

Ok, so actually just checked in and we want to keep RunnableCallable an implementation detail. You should just extend Runnable in your own code for now.

Will keep the change making run protected for subclassing though

@jacoblee93 commented on GitHub (Oct 17, 2024): Ok, so actually just checked in and we want to keep `RunnableCallable` an implementation detail. You should just extend `Runnable` in your own code for now. Will keep the change making `run` `protected` for subclassing though
Author
Owner

@msalafia commented on GitHub (Oct 17, 2024):

@jacoblee93 yeah i can imagine you want keep RunnableCallable hidden because of the AsyncLocalStorage used, am i correct? So do you think it's ok just extend Runnable avoiding all the fancy stuff RunnableCallable does?

@msalafia commented on GitHub (Oct 17, 2024): @jacoblee93 yeah i can imagine you want keep `RunnableCallable` hidden because of the AsyncLocalStorage used, am i correct? So do you think it's ok just extend Runnable avoiding all the fancy stuff `RunnableCallable` does?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#120