#Research Canvas demo wont work with Gemini

1 messages · Page 1 of 1 (latest)

tawny shell
#

Im currently following Research Canvas demo and I tried swapping in Gemini. For some reason Gemini causes a remove message return:

[ERROR] Background run failed. Exception: Unable to coerce message from array: only human, AI, system, developer, or tool message coercion is currently supported.

Received: {
"id": [
"langchain_core",
"messages",
"RemoveMessage"
],
"lc": 1,
"type": "constructor",
"kwargs": {
"id": "3e54d6ba-2dbf-4066-8b6b-44123fa63340",
"content": "",
"additional_kwargs": {},
"response_metadata": {}
}
}

Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/MESSAGE_COERCION_FAILURE/

this only happens when it uses a tool and I query it again. for some reason remove message messages are being included that causes coercion failure

Several modules in LangChain take MessageLike

timber pathBOT
#

@tawny shell I have passed this issue to the team, they will check and reply.

tawny shell
# timber path <@663720378023280660> I have passed this issue to the team, they will check and ...

Thanks. I also did some investigation and found some things that might help. The error occurs when I consecutively generate messages. Th first few messages did not cause an error, but when I do consecutive large messages, I get the error. This might be a built in thing where if the chat is getting long, messages are being removed from the thread or something. This causes a coercion error because Gemini is probably not built to intercept this remove message object when chat is getting cleaned

or some tool calls other messages are being filtered out causing the remove message