I'm seeing some kind of weird behavior when working with Agents. I have an agent that has access to a few custom tools (mainly interact with a DB). During execution of the agent, it all goes according to plan and the right tools get executed. One specific tool that has a function that creates records in my DB. The records get created but all the data is NULL.
If I try to test the function with the same exact input manually, the data gets inserted properly.
There also isn't really a place to monitor the execution of the activities within a function called by the agent. Does anybody have any clues as to what's going on and how I can try and track/debug this?
you can try telling it to 'output any errors' or 'before using a tool ensure all parameters are not null and if you can not respond as to why' or something. the idea is to give it an 'out' or the equivalent of try/catch like 'try doing this task a specific way and if you can not then respond with debug information'. finding a way to add an example of calling the function with proper parameters might help it figure out how to call it properly. I've also provided the JSON object describing the tools/functions and their parameters as well as their type and if they are required or not in the prompt then telling it to refer to that for how to use each tool.
Thanks @bobthebear! This actually led me to the solution. I was specifying what the params should be and it actually was doing a good job at keeping the structure but it wasn't formatted as proper JSON as it would be in the result of a function call to an LLM.
I needed an array of objects and the input the agent was passing in was an array of JSON strings. All i had to do to get this to work was parse the structure and convert to a proper array of objects before doing anything else in the tool!