Partial functions as tools not possible? #3023
Unanswered
MiningMyBusiness
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
-
I've been trying to use partial functions as tools or pass methods of objects as tools. But I am not able to do this...
This is especially useful if I want to programmatically route a RAG agent to look in a specific collection within my vector database. I can create a search function with two inputs 1) the user query and 2) the collection_name. I'd like to set the collection name and create a partial function and pass this as a tool but LangGraph does not accept this. I also tried creating a class with methods for search and tried to pass an instantiated class that would search within a specific collection with a method but this essentially amounts to the same thing and LangGraph does not accept this.
Has anyone been able to pass partial functions or object methods as tools to LangGraph agents? Or has anyone found a good way to programmatically instantiate LangGraph agents with specific tools based on user input (that is not a long wrapper function with if/else statements)?
Beta Was this translation helpful? Give feedback.
All reactions