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 issues with login via CLI
``` ~/appwrite appwrite login --endpoint https://localhost/v1 --verbose ? Enter your email myvalidemai...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...