Hello! We are using the auto-embedding feature wit...
# community-help
l
Hello! We are using the auto-embedding feature with an OpenAI compatible API. We have realized that when we import documents (doing
upsert
), the API requests take from 5 seconds to almost 2 minutes (if we send around 100docs). We suspect that this is because the embedding generation using the embeddings API is being done Synchronously on Typesense before returning a success, is that right? If that's the case, how should our system behave in this case? We don't want to keep that thread waiting for the response. We have considered doing fire and forget, but how would we know that the documents were correctly indexed? Thanks! ty
j
We suspect that this is because the embedding generation using the embeddings API is being done Synchronously on Typesense before returning a success, is that right?
That's correct. You could terminate the connection on your side after you've determined that all the data has been uploaded and network activity is zero, but then you won't be able to receive status updates / validation issues etc. Holding on to the HTTP connection is the only way to receive a status about the updates.
j
Thanks Jason. Is there any plan to make this asynchronous in the future? It is not ideal for us to be blocking a thread for so many seconds.
j
No plans at the moment. Could you open a github issue with a feature request so we can track interest?
j
Sure. Done: https://github.com/typesense/typesense/issues/2278 Not sure if I did it correctly. I don't seem to be able add any LAbels or anything like that. Let me know if I missed anything, or I can help in any way. Thank you.