Hello everyone,
I've been struggling with this for hours and would greatly appreciate some assistance.
I'm working on creating an AI agent that generates a draft invoice from a simple voice command. Using the API I'm integrated with, after an invoice is initially created (as empty), a route is triggered to add articles. These articles are provided as a structured array, where each object in the lines
array represents an article. Here's an example of the request body:
{
"lines": [
{
"unitPrice": "{unitPrice}",
"quantity": "{quantity}",
"quantityUnit": "unit",
"designation": "{designation}",
"type": "sale_of_goods",
"vatCode": "FR_2000",
"isDeliveryOfGoods": true
}
]
}
As you can see, I've used placeholders ({}
) for values that the model is expected to populate. The objective is to be able to say something like “Add 40 books and 10 hats to the invoice”, and have the model correctly fill in the corresponding values.
The issue I'm facing is that while the data is populated correctly, the agent ends up calling the route twice. Each call includes a single article, rather than making a single call with both articles in the same payload.
I've attempted to generate a proper JSON containing both objects using the CodeTool and then feeding it into the HTTP Request node, but I haven't been able to make it work, or even confirm if it's feasible.
Here is the link to the workflow:
- callin.io version: 1.83.2
- Database (default: SQLite): In-memory
- callin.io EXECUTIONS_PROCESS setting (default: own, main):
- Running callin.io via (Docker, npm, callin.io cloud, desktop app): Cloud
- Operating system: macOS
I've also been attempting to utilize a {placeholder}
and guide the AI Agent to populate the correct JSON format, either through a system prompt or a placeholder definition. However, it's not functioning as expected, and the AI Agent returns the error: "Received tool input did not match expected schema."
Where are you my hero ?
Hi, I believe you might find value in using a tool like fromAI… You can explore their templates to see practical examples. These templates are an excellent resource for learning and can spark ideas for your testing.
Hi, I don't have a ready answer for you at the moment. What I observed is that your instructions for the model are quite restricted, both in the system message and within the tool configuration itself. I'm confident that with proper engineering, you might already find a solution to your problem. Simply by specifying in your system prompt or tool description, the tool requires an array of items, where each item must be in format x.
I haven't utilized this with HTTP requests, but it works exceptionally well with tools via MCP. Remember that everything you input there gets integrated into your agent, enabling it to "understand" its intended function.
Unfortunately, this is an iterative process.
Since I haven't tested it directly with HTTP requests as a tool, I'm uncertain how it compares to other methods.
Regards,
J.