Don't fully understand how to use tools and why I cant get them to work #1162
-
Hey Yall! I am trying to create an agent with Langgraph. One thing I cannot figure out is that my tools never work. I first started with using langchain and those agents with the @tool decorator, the issue I encountered is that tools with the decorator and even with more custom tools the only tools I can get to work are ones with both single string inputs and outputs. I then moves to langgraph and am now encountering the same issue. Detail below.
this code outputs this
when creating the react agent in langchain with these, the only way to make it work is if the input to the tool is string and the tool's output is also a string. Now, when I switched to langgraph and followed the examples in Quickstart and Tool Calling, I switched their tools for mine and it worked the first I ran them, it was successful in using the add tool and doing the math. But now when I run it, here's the error and I have no clue what changed since it worked.
Big questions is, do I not know how to do this correctly? Or is just having string input and output for tools the intended functionality??I am on m2 mac with python 3.11, in a conda env |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@cekcreator you don't need agent executor with langgraph! you can just call |
Beta Was this translation helpful? Give feedback.
ah i see. i don't see any issues with the examples you pasted, and both types of tool definitions that you show work perfectly fine for me: