My application makes use of OpenAI and I have to write a function that acts as a proxy, it would be great if there was a way to send realtime data over functions similar to how OpenAI uses SSE, I know there is realtime api however that would require writing to collection many, many times and it is really not efficient, it would also be abuse of ratelimit. Is there any other way of doing this? Or is Appwrite not suitable for this?
So you are looking for sort of streaming from a function right?
For this you can have a single document, which you can then update many times and use Real-time to catch those updates.
Considering you are in a function using an API key you don’t have to care about rate limits 👍🏻
Yes, I thought about it but wouldn't it be expensive performance wise?
When you consider openai streams new token every 0.3~ second it would write a lot.
maybe you can create/update document after n seconds
Recommended threads
- AI feature by functions?
I'm creating a website where, in short, users can index certain genealogical content. In connection with the development of AI, I was thinking about introducing...
- Next js 16 is not deploying on appwrite.
i am facing this issue: 'Adapter mismatch. Detected: static does not match the set adapter: ssr' in Next.js 16 on a self-hosted Appwrite instance.
- Unknown usage from one of my database
I need support help. For more than 2 weeks, i didn't make any requests to my database, but I have noticed huge amount of reads and writes requests: Around 8000...