Repository navigation
Replies: 1 comment 1 reply
|
The real constraint here is that the structure you are designing is not permitted at the LLM level and burn tokens just to get an error. Neuron chat history just alert you before calling the LLM. The history must start with a user message, and continuing alternate the two user and assistant. As you said, you can eventually merge multiple user messages in one message with multiple TextContent blocks. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello, have a good day.
I'm working on a project where we have a group chat, and an agent is part of it. We save the messages in a custom history, where the first message can be either an assistant or a user message. We can also have, for example, three consecutive user messages followed by an assistant response, because the agent was tagged or activated at that point.
Now I'm running into a bug:
This is the message sequence that triggers it:
[ NeuronAI\Chat\Messages\UserMessage, NeuronAI\Chat\Messages\AssistantMessage, NeuronAI\Chat\Messages\UserMessage, NeuronAI\Chat\Messages\UserMessage, ]It seems NeuronAI requires messages to strictly alternate between user and assistant, but our use case (a group chat) naturally produces consecutive user messages.
Is there a recommended way to handle non-alternating histories, or should I merge consecutive user messages before passing them to the agent?
@ilvalerione
All reactions