https://discord.gg/botpress logo
AI Task card to break after collection of informat...
# 🤝help
d
I was trying to make an AI task card to collect certain information. I used Raw input to obtain user input and send it to the AI task card again in a loop. I need to break the flow once all the information is collected but it seems like it gives me the latest message again and again as I set it in a loop. I have used expression as always . Only way is I have a choice in Raw input card to break . But the choices appear in all the reply response of the bot. https://cdn.discordapp.com/attachments/1387409998828671107/1387409998975602718/image.png?ex=685d3dc0&is=685bec40&hm=75ea657e1023f0cd8e3efe571f55ecbedbb914da5c7d59d59c56d39a9c6ce0a0&
p
Can you show the expression entered in your transition card? Can you also share what the Ai tasks instructions are? Is your problem related to the exiting this loop or the workings of the loop?
d
The problem is exiting the loop. The expression entered is Always. Here is the AI task instruction provided in the text file The major information to be collected and AI task to be ended is, Leave type, Start date, End date, Duration and Reason for leave. https://cdn.discordapp.com/attachments/1387409998828671107/1389933560089153566/Chat_instruction.txt?ex=68666c00&is=68651a80&hm=a1a31bab912bbbf5f35e863a66043c094601c65bb5812498b5d6dea35f76985f&
p
If there is a variable that is always collected last you can use it to transition out. e.g {{workflow.lastVar.length > 0}}
d
The response from AI task card is stored in workflow.Aisummary . I tried to provide 2 expression cards after rich text card with a condition that if (if workflow.Aisummary does not contain Leave dates, leave type, duration and Reason.) loop back and (if workflow.Aisummary contains Leave dates, leave type, duration and Reason.) flow to the next card but it seems to not work. If i try to swap the user response at the end the AI task card fails and doesn't provide output. https://cdn.discordapp.com/attachments/1387409998828671107/1390177409147605116/image.png?ex=68674f1a&is=6865fd9a&hm=b17ab5f5553f9826244c7991a820a9b9141413a41488980ba1762f69f928724e&
p
Expression cards need an expression aka code. You can use an Ai transition if you prefer writing natural language. Hope this helps!
d
Is it required to have a separate variable for Leave dates, leave type, duration and reason in this case.
If AI transition card needs to be used how can it be used in this case?
p
The AI transition is not needed, but if you want to keep your expression as is then paste them in the options section of the card. The variables you pick depend on you assignment process, I don't think there any problems with your method except that it could be cleaner. Hope this heps!
3 Views