DreamServerError
class DreamServerError(DreamError, RuntimeError)
Importable as dream.DreamServerError.
A refusal, carried with the answer’s code and reason; whether to call again is retryable.
The codes come in two families:
- From get_action(), the model’s status codes:
DA-2000(the call cannot be taken right now:reasonpool_warmingmeans the model is starting,rate_limitedthat the calls came too fast,pool_fullandqueue_timeoutthat it is at max capacity,max_servesthat it is at max capacity and no more copies of it may start: notretryable, but withretry_after_sset a call after that wait may find a seat freed),DA-5000(the model failed the call) andDA-6000(a fault on the Dream Labs side;cannot_scalemeans the model cannot be started, and the message says why). - From the embodiment, dataset, fine-tuning and model calls, the service’s own lowercase codes, with
reasonNone:not_found(no such embodiment, dataset or job on this account),conflict(a name in use, a dataset notprocessed, a job already finished, the account at its limit of active jobs),invalid_request(a name, suffix or fine-tuning knob out of range; the message names it),validation(a value of the wrong type), and the HTTP 5xx ones, which areretryable.
When retryable is True, wait retry_after_s seconds (a moment when it is None) and make the same call again; otherwise the same call gets the same answer, so change it first.
Attributes
code(str | None): The code, e.g."DA-2000"from get_action() or"not_found"from the other calls; None when the answer carried none.reason(str | None): Why, e.g."pool_warming"; None when the answer carried none (always None outside get_action()).retryable(bool): Whether the same call may be made again: as the model’s answer says for get_action(), and True for an HTTP 5xx answer of the other calls.retry_after_s(float | None): Seconds to wait before calling again, or None.message(str): The message; also whatstr(error)returns.
Raised by
dream.datasets.add_embodiment()dream.datasets.list_embodiments()dream.datasets.upload_dataset()dream.datasets.get_dataset()dream.datasets.list_datasets()dream.datasets.retry_dataset()dream.datasets.delete_dataset()dream.fine_tuning.create()dream.fine_tuning.check_eef()dream.fine_tuning.list()dream.fine_tuning.get()dream.fine_tuning.cancel()dream.fine_tuning.queue()dream.fine_tuning.training_data()dream.models.list_models()DreamClient.add_embodiment()DreamClient.get_embodiments()DreamClient.get_models()DreamClient.upload_dataset()DreamClient.get_dataset_status()DreamClient.get_datasets()DreamClient.retry_dataset()DreamClient.delete_dataset()DreamClient.finetune()DreamClient.get_finetuning_status()DreamClient.get_action()
Subclasses: DreamBadRequest, DreamAuthError, DreamSessionExpired
Constructor
Section titled “Constructor”DreamServerError( message: str, code: str | None = None, reason: str | None = None, retryable: bool = False, retry_after_s: float | None = None, )
Stores the answer’s fields as they came; the client raises it, a caller never needs to construct one.
Parameters
message(str): Human-readable text, shown verbatim to the caller.code(str | None, defaultNone): The answer’s code.reason(str | None, defaultNone): The answer’s reason.retryable(bool, defaultFalse): Whether the same call may be made again.retry_after_s(float | None, defaultNone): Seconds to wait before calling again.