Hello Frappe Community,
I’m currently developing a chatbot integrated into my application, and I need help with storing and retrieving chatbot conversations within Frappe. The conversation flows dynamically based on user inputs, and the structure is something like this:
[
{
type: "bot",
text: "Please select the query you want help with",
inputType: "options",
options: [
"Medical Opinion Pending",
"VIL Pending",
"Pickup Details Required",
"MediSupport Portal Not Working"
],
nextSteps: {
"Medical Opinion Pending": 2,
"VIL Pending": 2,
"Pickup Details Required": 2,
"MediSupport Portal Not Working": 5
}
},
{ type: "user", text: "Medical Opinion Pending" },
{ type: "bot", text: "Please share patient TR ID", inputType: "text", nextSteps: 3 },
{ type: "user", text: "1234" },
{
type: "bot",
text: "Please confirm patient details",
inputType: "options",
options: ["Yes", "No"],
nextSteps: { "Yes": 4, "No": 2 }
}
]
My objective is to store these conversations in a way that I can easily retrieve them later for analysis, customer support, or further interaction.
Could you please guide me on the best approach to store and retrieve such chatbot conversations in Frappe? Should I create a new doctype, or is there an existing functionality that could be leveraged?
Any suggestions or code examples would be greatly appreciated!