Closed desaxce closed 5 months ago
[image.png](https://uploads.linear.app/6a41a374-76e1-40c2-a405-51050761590c/6ffa64f7-f38d-4403-a1bd-cdc30804194e/ed4a3c0a-3914-4a4c-8c41-1314dd7473fa) client.step()
@willydouhard As much as I tried it with my sample RAG application, I'm not confident the "separate thread" bit doesn't impact some other part of the app that's unknown to me.
In this pull request, we launch API calls in separate threads with try/except blocks which log the raised exception.
I tried a couple of use cases with the
examples/Graceful SDK.ipynb
notebook (Github wouldn't let me upload it on the PR directly), I had to commit it. To remove before mergingIt's a RAG application which has attempts to perform
with literal_client.step ... as step
and awith literal_client.thread ... as thread
. I added atime(1)
in each so that I could stop the server in the middle of the clause. I timed the whole application so that I could ensure the application still runs in the same overall time when Literal cannot be reached.The one thing we can notice in Threads is that the non-closed ones appear with their UUID:
And without the full sequence:
This change is