Passing runtime value args to a tool created by subclassing BaseTool: tool.invoke doesn't see the runtime arg even when provided #29411
Unanswered
shruthiR-fauna
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked other resources
Commit to Help
Example Code
Description
I'm trying to use the LangChain library to create an agent that can serve as the coding system for a robot dog. The minimal example provided above provides a toy example of the model I'm using.
I've created a tool
go_to_object
that can be bound to an LLM that supports tool calling. Two arguments to the tool can only be provided at runtime so they are annotated with theInjectedToolArg
in the_run
method.However, when I call this tool with
go_to_object_tool.invoke
where I supply all the required args, I see the following error*** TypeError: GoToObjectTool._run() missing 1 required positional argument: 'robot_state'
I've spent a lot of time digging through the API and the docs. I think this exposes a bug in how
tool_args
andtool_kwargs
are parsed.System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
Beta Was this translation helpful? Give feedback.
All reactions