brazley - Has anybody figured out CRUD function...
Has anybody figured out CRUD functions with the ai streaming to Flutterflow workflow? I can get it to recall old chats but it doesn't let me send new messages in it. Looking for the "saved chats" functionality and a way to let the users add a title to the chat.
3 Replies
Hi @brazley, did you tried out the FlutterFlow Streaming Firestore template? @Stu can share on more insights on this for "saved chats".
yes i have. i have that working already. i actually recently got the saved chats working. y biggest hurdle now is figuring out how to get the user reference added to it so that a user only views their chats. i have gotten it to add the user id field on firestore, but not actually pass the data. it always adds an empty string.
also, if i want to add the feature where it automatically creates a title for the chat thread based on the first message sent by the user, would you recommend that being done on the buildship side with a parallel node or on the flutterflow side as a separate api call?
Hey @brazley, when the threadId comes back from the BuildShip API call, I would add an Update Document action in FlutterFlow then to add the UID (since the document id in the "chats" collection will always be the threadId).
In terms of adding a title for the chat, in BuildShip, consider adding a parallel node containing the return node of your existing workflow AND the logic you want to use to create the title text and use a Firebase Update Document node to add the title. That way, BuildShip will return to FlutterFlow with everything it needs as per usual and the title creation will still occur.