Describe the problem/error/question
I'm encountering an issue where my AI agent, which uses the Gemini chat model, is failing. The setup involves a Telegram trigger and a memory table. Data from both is merged and then passed to the AI agent. The agent consistently sends two inputs to the model: Human: What do you know about me?
and Human: <span class="chcklst-box fa fa-square-o fa-fw"></span>
. This, along with the system prompt and a null value, causes the Google Gemini model to break. I'm unable to remove this null input. Even in the simplest scenario, with fixed user input and system prompt, the blank input is still passed, and this problem only occurs when using the merge node.
What is the error message (if any)?
The error message from Gemini is:
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:streamGenerateContent?alt=sse: [400 Bad Request] * GenerateContentRequest.contents[1].parts: contents.parts must not be empty.
Please share your workflow
Input ai agent is getting
json
[
{
“update_id”: 123,
“message”: {
“message_id”: 205,
“from”: {
“id”: 235,
“is_bot”: false,
“first_name”: “abc”,
“last_name”: “abc”,
“username”: “r_c”,
“language_code”: “en”
},
“chat”: {
“id”: 112,
“first_name”: “abc”,
“last_name”: “abc”,
“username”: “r_c”,
“type”: “private”
},
“date”: 1739112541,
“text”: “What do you know about me?”
},
“Memory”: [
“abc grew up in usa”,
“Name of the user is abc, he prefers to be called a.”
]
}
]
Information on your callin.io setup
- callin.io version: 1.76.3
- Database (default: SQLite):
- callin.io EXECUTIONS_PROCESS setting (default: own, main):
- Running callin.io via (Docker, npm, callin.io cloud, desktop app): docker, railways
- Operating system: N/a
I've encountered the same issue. I hope this problem gets resolved soon...
Thanks for reporting this issue! I was puzzled by it for days (including the latest callin.io 1.80.5) without realizing it’s related to the Merge Node!
To resolve it, I created a Set Node after the Merge Node (and before the AI Agent Node) and set the fields with those in Merge to feed into the AI Agent, which is now happy.
It is just a workaround, and the root cause (i.e., extra “Human: ”) needs to be resolved. On the other hand, I found that a Set node before an AI Node to be a nice-to-have to say the least, and this extra/workaround node is not that much of an eyesore by itself.
Thanks for sharing the workaround, it works!
I encountered a similar problem and resolved it by employing the Set Node workaround. Ensure you also map the sessionId; otherwise, the Memory step will encounter an error.
This discussion was automatically closed 90 days following the last response. New replies are no longer permitted.