poll()
method handles this by automatically checking the task’s status at regular intervals until it transitions out of the Starting
or Processing
states.
After polling completes, it’s important to verify the final task status, which will be one of:
Succeeded
: Task completed successfullyFailed
: Task encountered an errorCancelled
: Task was manually cancelledTaskResponse
object, you can poll it.
Look at creating and getting a task for more information on how to get a TaskResponse
object.
await
:
task.status == "Failed"
will not raise exceptions. You can configure this behavior using the raise_on_failure
parameter when initializing the client: