Variables
# 🤝help
m
we have {{event.preview}} variable, which is very comfortable in creating a loop cause it changes all the time, but for bot's response i do have to create a new variable each time, and when im looping node it always shows me the first response bot created in that variable. how to fix this? ❤️
f
Could you share some more details about what you are doing. Like a screenshot of your workflow
m
im creating a chat bot that suppose to be able to have fluent conversation and to suggest my products according to customer's needs, so i always use {{event.preview}} to store user's answers, but i created different variables for bot's responses. now when im looping those nodes, i get the first message was saved in that variable.
f
Does it work with event.preview?
m
yes, in all the nodes i also added to AI Task Input summary of the chat, on the screen shot you dont see it cause its the first question
f
Is there a reason why you decided to use a self made variable instead of event.preview?
m
no reason, i dont need to capture any message at this point of conversation, its suppose to be just a fluent talk
you mean that i can use event.preview also for storing the result?
as event.preview is a variable where i can find last user's answer, im trying to figure out is there any variable like this for bot's message. o how i can create a loop, if when im connecting node to the previous one to create a loop, it shows me in the chat the first version of content that was saved in this variable
f
You could use event.preview to store the users latest message. I am not sure if there is one but you could do it from the summary agents variable conversation.SummaryAgent.transcript. From that variable you would just find the latest bot: and then store the message
4 Views