Hello, I have been reading about error handling f...
# agents
b
Hello, I have been reading about error handling from the docs Our use case requires that in the event that any error occurs (from our client code) or from the inference API, we shutdown and notify another component of our system about this error. From the example code in the documentation, it is not exactly care how we can achieve this. Ideally, we would like to be able to trigger the shutdown_hook method if possible if an error occurs (this includes both recoverable and non-recoverable errors). I'd appreciate any examples or pointers to implementing this functionality P.S: We're exclusively using Realtime models for conversations
l
You can call
shutdown
on the JobContext: https://docs.livekit.io/agents/worker/job/#disconnecting-the-agent which will trigger the
shutdown_hook
explicitly.
🙌 1