Use "Capture Information" as a variable in code
# 🤝help
d
I was wondering if there was a functionality where I could use what the user inputs from the "Capture Information", and assign it to a variable with code.
also
how would I be able to loop the chat with the ai and the user
after capturing the needed information for the AI to perform
r
@dry-doctor-40460 assuming you saved the Capture card to a variable, you can access those variables in your execute code cards with « workflow.nameOfTheVar »
e
You could also make your capture card not store the input in no variable. And then you can set what the user typed to any variable you want. Simply do
workflow.my_variable = event.preview
What do you mean? You want to reset the conversation and start the captures from the start? If so, after the Send message, 1 - add a Transition with the condition true (to always go) to a new node called Clear-Conversation, which contains a Execute Code card with the following label - "Empty all the variables from the workflow" (2 - use AI to generate the code). 3 - Then in this node add a transition with code true, to always go to the Standard node (maybe rename it to Extract-Values or something) That will allow the user go always inform new values. You could also ask for a confirmation if they want to start again, if yes, go to the clear-conv node, if no, go to a end-talk node. Hope that helps! 👍
d
Sorry, not what I meant. I meant like after capturing the information, the user can just keep talking to the AI without the program ending.
e
Oh I see, and it should include the context from the previous messages, right?
f
We can use the Summary Agent to help with that 💪
e
I know it's possible to do that, just not sure what's the best approach. You could save all the the AI generated responses and event.preview's in an array and always pass that array to another AI card.
Alright!! 🚀
f
Let me send something then we can see how we can use the new Agents to include in it
Well, this needs further complex logic. Basically, you need to pass to the AI Task what was said previously so it is aware of the history: 1) Create a workflow variable of type Array: 2) Set it with what the user said and what the bot replied 3) Send it to the AI Task and instruct the AI Task to "Take User's History into consideration." 4) Connect the node to itself so it loops. The full product will look like this
Okay, now we can use the new Summary agent to replace step 1 & 2, and send the value in step 3 instead of the userHistory variable
I hope those are clear instructions
e
So we would use this variable in the third step? User input: conversation.... This is nice!
r
Yup you can skip those steps and simply use
conversation.SummaryAgent.summary
which does exactly that job for you in the background 🙂
d
thank you!
f
Anytime. Happy Bot Building 🚀 😎
75 Views