Q&A with Embeddings & GPT
Hello!
I'm looking to integrate a piece of code into my SaaS kit app.
This is the page in cause that I want to integrate into Wasp:
https://github.com/tsensei/QueryGPT/blob/main/completion.js
full repo here: https://github.com/tsensei/QueryGPT/tree/main
My code you can assume is the same as the SaaS kit as my changes were in other pages and rather small or just aesthetic.
Thing is, my app needs are even lower than that as I can just generate the embeddings locally and store them in the app itself (I'm only working with a few pages of simple text). So I'm looking to make a page (similar to the GPT page at the moment in the kit) but that integrates my generated embeddings (so I don't have to make an adda API call every time <or also integrate the embeddings code>, I only need to process the data once and I'm very okay with doing it locally).
How could I do that, for example, on the default SaaS Kit GPT page ? Please keep in mind that my coding skills are a tad limited and I got a bit confused and overwhelmed by what, exactly, I have to do to achieve that (eg. actions, types, jobs(??), etc.).
Greatly appreciated!
2 Replies
Hi @lazi !
If I understood correctly, you want to process some data using the above code, and store the results in your Wasp app on startup?
More or less yes. I'll be using the above code to process my documents locally (as I don't need to do the embedding call every time), obtain the embeddings file then store the embededFile.txt inside my app (is just public data so no need for any encryption or safety stuff).
I need to use this file that processes the completion - or to be more exact, its functions and logic - ( https://github.com/tsensei/QueryGPT/blob/main/completion.js ) inside a generic GptPage (like the one in the saas kit) and use the embeddings (already processed) in my gpt call.
I just have no idea how could I turn that .js file into actions or what steps I have to follow to integrate it properly. I've tried some stuff using GPT-4 but failed miserably. The code provided was meant to work in console.
GitHub
QueryGPT/completion.js at main · tsensei/QueryGPT
QnA with NodeJS & OpenAI GPT models on Personal / Business data using Embeddings and Completion - QueryGPT/completion.js at main · tsensei/QueryGPT