I have an internal API where the input is a query, and it returns an ID, chunk, and URL. I wrote a function around this API that returns the output as a dictionary, which I use as a tool in an agent. The agent uses this information to return a summary with citations in the form [1][2]
.
I already instructed well in the prompt.
However, sometimes the model cites the wrong ID in the answer. How should I handle such scenarios? Which tool output format would be best for the agent to ensure correct citations? Can anyone suggest a good output format for the tool call so that citation issues can be avoided?