Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rfc] langgraph: check if model passed as runnable binding with tools in create_react_agent #1647

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vbarda
Copy link
Collaborator

@vbarda vbarda commented Sep 6, 2024

This should allow users to customize models they pass to create_react_agent, including enabling/disabling parallel tool calling on the model.

If a model is passed as RunnableBinding with tools, we'll validate that the tools match the list of tools in create_react_agent and use the bound tools instead of binding inside create_react_agent

@vbarda vbarda marked this pull request as draft September 6, 2024 22:24
@@ -426,7 +465,9 @@ class Agent,Tools otherClass
else:
tool_classes = tools
tool_node = ToolNode(tool_classes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this but thoughts on getting the tool_classes from the tool node here too so we can let you pass in raw functions ?

        tool_classes = tools.tools_by_name.values()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think in tools_by_name it will also be a tool as we're calling create_tool under the hood https://github.com/langchain-ai/langgraph/blob/main/libs/langgraph/langgraph/prebuilt/tool_node.py#L95

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh nevermind, i misread first, yes, we can definitely do that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants