
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
- Having errors migrating to cloud
Project will not migrate compeltely
- Appwrite realtime stopped working all of...
In our production environment, Appwrite Realtime suddenly stopped working and no updates are coming through , can you confirm if there are any known issues?
- Realtime Feature Not Working on Custom S...
I have added a custom domain api1.nextsaimon.top for my project. My website is hosted on a1.nextsaimon.top. All features are working correctly, except the Realt...
