Skip to main content

base

Unified response models for all Datalayer services.

class BaseResponse(*, success: bool, message: str | None = None) -> None

Unified base response model for all Datalayer services.

class DataResponse(success: bool, message: str | None = None, data: Any = None, key: str | None = None, **kwargs: Any) -> None

Generic response model that includes data payload flattened at top level.

__init__(success: bool, message: str | None = None, data: Any = None, key: str | None = None, **kwargs: Any) -> None

Initialize DataResponse with optional data flattening.

Parameters

  • success : bool

    Whether the operation was successful.

  • message : Optional[str], optional

    Human-readable response message.

  • data : Any, optional

    Data payload to include in response.

  • key : Optional[str], optional

    Key under which to nest the data.

  • **kwargs : Any

    Additional fields to include in the response.

Config()

Pydantic configuration for DataResponse.

extra

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

class ListResponse(*, success: bool, message: str | None = None, items: List[~T] = <factory>, count: int | None = None, page: int | None = None, page_size: int | None = None) -> None

Response model for endpoints that return lists of items.

class ErrorResponse(*, success: bool = False, message: str | None = None, errors: List[str] = <factory>, error_code: str | None = None, exception: str | None = None) -> None

Response model for error cases.

class ExecutionResponse(*, success: bool, message: str | None = None, execute_response: List[Dict[str, Any]] = <factory>) -> None

Response model for code execution results (legacy compatibility).

stdout

Get the standard output of the code execution.

Returns

  • str

    The standard output as a string.

stderr

Get the standard error of the code execution.

Returns

  • str

    The standard error as a string.