Skip to main content

base

Unified response models for all Datalayer services.

class BaseResponse(*, success: bool, message: Optional[str] = None) -> None​

Unified base response model for all Datalayer services.

class DataResponse(success: bool, message: Optional[str] = None, data: Any = None, key: Optional[str] = None, **kwargs: Any) -> None​

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

__init__(success: bool, message: Optional[str] = None, data: Any = None, key: Optional[str] = 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()​

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 sys.getdefaultencoding(). errors defaults to 'strict'.

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

Response model for endpoints that return lists of items.

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

Response model for error cases.

class ExecutionResponse(*, success: bool, message: Optional[str] = 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.