Adding Chat message persistency

Hello everyone, first of all, thank you for the open source project, it's very good! I'm trying to build some sort of personal assistant and for that I'd need the chat history to be saved somehow, but I can't manage for some reason, I tried with ChatGPT but I'm getting some import functions errors. Did anyone do this already and could help me with creating this chat history persistency logic?
3 Replies
kapa.ai
kapa.ai3mo ago
Hi @ChilledGab. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. However, based on the information available, it seems you're trying to implement chat history persistency with Wasp and ChatGPT. While there's no direct information on how to do this in the provided sources, you might find it helpful to understand how Wasp handles data. In Wasp, you can use Entities to represent your core data model and Actions to update the database. This could potentially be used to save chat history. You can learn more about this in the Wasp tutorial on Actions (https://wasp-lang.dev/docs/tutorial/actions). There's also an open issue on GitHub about documenting how to use Wasp with ChatGPT embeddings (pgvector), which might be related to your question. You can follow this issue for updates here (https://github.com/wasp-lang/wasp/issues/1215). For the import functions errors you're encountering, it would be helpful if you could provide more details. You might also find it useful to ask for help in the Wasp Discord community, where you can share the specific errors you're encountering and get help from other Wasp users. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ChilledGab, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
ChilledGab
ChilledGab3mo ago
I don't have a lot of coding experience so I'm using chatgpt to be helped on this, and it advises to add a few things in action.ts , queries.ts, and main.wasp, and then it remakes the front end of the demoapppage, but always throwing some errors, like on this 'import { context } from 'wasp/types'; ' for example. Could you please direct me to the right source to understand how I could fix this?
martinsos
martinsos3mo ago
So you will likely want to have something like a Chat entity which has a list of Message entities, and each User would could have multiple Chats I assume. This would be similar to how ChatGPT is implemented. Unfortuinately Wasp does require coding experience, but we have good docs I believe: https://wasp-lang.dev/docs . Here is a nice tutorial to learn basic concepts: https://wasp-lang.dev/docs/tutorial/create . And you can also try playing with https://usemage.ai/ -> it will probably produce an app with errors, but it might give you some good ideas that you can copy over to your project.
Want results from more Discord servers?
Add your server