Describe the problem/error/question
I’m trying to pass my chat history correctly to the node. My question is how to pass dynamic number of variables to each chat message. The chat history can be any number. The example below shows how I can pass 3 chat messages, but let’s say the next time it will have 4 messages, how to automatically pass those messages to new prompt section.
The only way that I can think of now is to check the length of chat history and have predefined nodes for every length. But that seems excessive and repetitive. Is there any better way of achieving this?
Please share your workflow
This workflow shows how I can pass 1 system message, 2 user messages and 1 ai response.