bayesline.apiclient.PydanticTaskClient

bayesline.apiclient.PydanticTaskClient#

class bayesline.apiclient.PydanticTaskClient(model_class: type[P], client: ApiClient, task_id: str, tqdm_progress: bool = False, exc_types: list[Type] | None = None) None#

Bases: TaskClient[P], Generic[P]

Methods

__init__(model_class, client, task_id[, ...])

get_progress()

Get the current progress status of the task.

get_result()

Get the result of the completed task.

is_ready()

Check if the task has completed and the result is ready.

raise_for_status(response)

wait_ready([timeout, check_interval])

Wait for the task to be ready.

wait_result([timeout, check_interval])

Wait for the task to complete and return its result.

Attributes

task_id

Returns str The unique identifier for this task.

__init__(model_class: type[P], client: ApiClient, task_id: str, tqdm_progress: bool = False, exc_types: list[Type] | None = None) None#
get_result() P#

Get the result of the completed task.

Returns#

T

The result of the task.

Raises#

TaskError

If the task failed or is not yet complete.