---
sidebar:
  hidden: true
title: roboto.domain.actions.action_record
---
## Module Contents

### Accessibility

```python
class roboto.domain.actions.action_record.Accessibility
```

`from roboto import Accessibility`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L24-L31)

Bases: `roboto.compat.StrEnum`

Accessibility of an action: who can find and invoke it.

**Attributes**

- **Accessibility.ActionHub** = `'action_hub'`: Every Roboto user, through the Action Hub.
- **Accessibility.Organization** = `'organization'`: Members of the organization that owns the action.

### ActionParameter

```python
class roboto.domain.actions.action_record.ActionParameter(/, **data: Any)
```

`from roboto import ActionParameter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L34-L81)

Bases: `pydantic.BaseModel`

A named value that an invocation passes to an action, so one action can run with different settings.

Roboto rejects an action whose parameters share a name, or that has a parameter that is both required and has a default. It rejects an invocation that gives no value for a required parameter, and gives each optional parameter the invocation leaves out its default.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ActionParameter.default** (`Any | None`) = `None`: Value an invocation gets when it gives none, or `None` for no default.

  Accepts any value, but stores it as a string: a string is kept as given, and any other value is written as JSON, so `False` becomes `"false"` and `["a", "b"]` becomes `'["a", "b"]'`.

- **ActionParameter.description** (`str | None`) = `None`: Human-readable description of the parameter.

- **ActionParameter.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **ActionParameter.name** (`str`): Name of the parameter, unique among the action's parameters.

- **ActionParameter.required** (`bool`) = `False`: Whether an invocation must give a value for the parameter.

#### ActionParameter.validate_default()

```python
@classmethod
def validate_default(v: Optional[Any]) -> Optional[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L73-L81)

Convert a `default` that is not a string to JSON, or to `str(v)` when JSON cannot encode it.

**Parameters**

- **v** (`Optional[Any]`)

**Returns**

- `Optional[str]`

### ActionParameterChangeset

```python
class roboto.domain.actions.action_record.ActionParameterChangeset(/, **data: Any)
```

`from roboto import ActionParameterChangeset`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L84-L123)

Bases: `pydantic.BaseModel`

Changes to an action's parameters, for [`update()`](/docs/reference/python-sdk/roboto/domain/actions/action#roboto.domain.actions.action.Action.update).

**Parameters**

- **data** (`Any`)

**Attributes**

- **ActionParameterChangeset.put_parameters** (`list[ActionParameter]`) = `None`: Parameters to add, each replacing any parameter of the same name. Defaults to none.
- **ActionParameterChangeset.remove_parameters** (`list[str]`) = `None`: Names of parameters to remove. Defaults to none.

#### ActionParameterChangeset.Builder

```python
class Builder
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L93-L119)

Builder that collects parameters to put and to remove into an `ActionParameterChangeset`.

##### ActionParameterChangeset.Builder.build()

```python
def build() -> ActionParameterChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L113-L119)

Return a changeset of the parameters this builder collected.

**Returns**

- `ActionParameterChangeset`

##### ActionParameterChangeset.Builder.put_parameter()

```python
def put_parameter(parameter: ActionParameter) -> ActionParameterChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L103-L106)

Add a parameter to put, and return this builder.

**Parameters**

- **parameter** (`ActionParameter`)

**Returns**

- `ActionParameterChangeset`

##### ActionParameterChangeset.Builder.remove_parameter()

```python
def remove_parameter(parameter_name: str) -> ActionParameterChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L108-L111)

Add the name of a parameter to remove, and return this builder.

**Parameters**

- **parameter_name** (`str`)

**Returns**

- `ActionParameterChangeset`

#### ActionParameterChangeset.is_empty()

```python
def is_empty() -> bool
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L121-L123)

Return whether the changeset has no parameters to put or remove.

**Returns**

- `bool`

### ActionRecord

```python
class roboto.domain.actions.action_record.ActionRecord(**kwargs)
```

`from roboto import ActionRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L299-L418)

Bases: `pydantic.BaseModel`

Data record of an action, as the Roboto API returns it.

An action is a reusable function to process, transform or analyze data in Roboto. [`Action`](/docs/reference/python-sdk/roboto/domain/actions/action#roboto.domain.actions.action.Action) wraps this record with methods that act on the action, and exposes it as [`record`](/docs/reference/python-sdk/roboto/domain/actions/action#roboto.domain.actions.action.Action.record).

**Attributes**

- **ActionRecord.accessibility** (`Accessibility`): Who can find and invoke the action.

- **ActionRecord.compute_requirements** (`ComputeRequirements | None`) = `None`: CPU, memory and storage for each invocation of the action, or `None` if none were set.

  An invocation can override them.

- **ActionRecord.container_parameters** (`ContainerParameters | None`) = `None`: How to run the action's container image. An invocation can override them.

- **ActionRecord.created** (`datetime.datetime`): Time the action was created.

- **ActionRecord.created_by** (`str`): ID of the user who created the action.

- **ActionRecord.description** (`str | None`) = `None`: Human-readable description of the action, or `None` if it has none.

- **ActionRecord.digest** (`str | None`) = `None`: Digest that identifies this version of the action.

  When a record is constructed without one, it is set to the result of `compute_digest`.

- **ActionRecord.inherits** (`ActionReference | None`) = `None`: Deprecated. Action this action inherits its configuration from.

  Roboto rejects a request to create or update an action that sets it.

- **ActionRecord.metadata** (`dict[str, Any]`) = `None`: Key-value metadata on the action.

  Values must be strings, numbers or booleans; serializing the record fails on any other value.

- **ActionRecord.modified** (`datetime.datetime`): Time the action was last modified.

- **ActionRecord.modified_by** (`str`): ID of the user who last modified the action.

- **ActionRecord.name** (`str`): Human-readable name of the action, unique within its organization.

- **ActionRecord.org_id** (`str`): ID of the organization that owns the action.

- **ActionRecord.parameters** (`list[ActionParameter]`) = `None`: Parameters that an invocation of the action can give values for.

- **ActionRecord.published** (`datetime.datetime | None`) = `None`: Time the action was published to the Action Hub, or `None` if it is not in the Action Hub.

- **ActionRecord.requires_downloaded_inputs** (`bool | None`) = `None`: Whether Roboto downloads an invocation's input files before the action runs. `None` means `True`.

- **ActionRecord.short_description** (`str | None`) = `None`: Brief description of the action, or `None` if it has none.

  At most 140 characters ([`SHORT_DESCRIPTION_LENGTH`](/docs/reference/python-sdk/roboto/domain/actions/action#roboto.domain.actions.action.SHORT_DESCRIPTION_LENGTH)).

- **ActionRecord.tags** (`list[str]`) = `None`: Tags on the action.

- **ActionRecord.timeout** (`int | None`) = `None`: Maximum time an invocation of the action may run, in minutes, or `None` if the action sets none.

- **ActionRecord.uri** (`str | None`) = `None`: URI of the container image the action runs, or `None` if none was set.

**Properties**

- **ActionRecord.reference** (`ActionReference`): Reference to this version of the action, by its name, digest and owning organization.

#### ActionRecord.compute_digest()

```python
def compute_digest() -> str
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L386-L400)

Compute a digest of the fields set on this record.

The digest is a 32-character hexadecimal BLAKE2b hash of the fields given at construction or assigned since, written as JSON with sorted keys. Construction assigns `digest` when it is not given, so calling this method afterwards hashes `digest` as well and returns a different value from it.

**Returns**

- `str`

#### ActionRecord.serialize_metadata()

```python
def serialize_metadata(metadata: dict[str, Any]) -> roboto.types.UserMetadata
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L412-L418)

Serialize `metadata` as a dictionary of strings, numbers and booleans.

Converts `decimal.Decimal` values to `float`. Pydantic calls this when the record is serialized; use `model_dump` or `model_dump_json` instead.

**Parameters**

- **metadata** (`dict[str, Any]`)

**Returns**

- `roboto.types.UserMetadata`

### ActionReference

```python
class roboto.domain.actions.action_record.ActionReference(/, **data: Any)
```

`from roboto import ActionReference`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L126-L145)

Bases: `pydantic.BaseModel`

Reference to an action by name, optionally pinned to one version and to the organization that owns it.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ActionReference.digest** (`str | None`) = `None`: Digest of the version of the action to use, or `None` for its latest version.
- **ActionReference.name** (`str`): Name of the action, unique within the organization that owns it.
- **ActionReference.owner** (`str | None`) = `None`: ID of the organization that owns the action, or `None` for the organization that uses the reference.

### ComputeRequirements

```python
class roboto.domain.actions.action_record.ComputeRequirements(/, **data: Any)
```

`from roboto import ComputeRequirements`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L173-L267)

Bases: `pydantic.BaseModel`

CPU, memory and storage for the container that runs an action.

Construction raises `pydantic.ValidationError` for a value or a `vCPU` and `memory` combination that is not allowed. The organization's plan can also cap each value below the largest one allowed here.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ComputeRequirements.gpu** (`Literal[False]`) = `False`: Whether to give the container a GPU. Only `False` is accepted.

- **ComputeRequirements.memory** (`int`) = `None`: Memory for the container, in MiB. Defaults to 1024.

  The allowed values depend on `vCPU`:

  - 256: 512, 1024 or 2048.
  - 512: 1024 to 4096, in steps of 1024.
  - 1024: 2048 to 8192, in steps of 1024.
  - 2048: 4096 to 16384, in steps of 1024.
  - 4096: 8192 to 30720, in steps of 1024.
  - 8192: 16384 to 61440, in steps of 4096.
  - 16384: 32768 to 122880, in steps of 8192.

  Also accepted under the keys `memory_MiB` and `memory_mib`.

- **ComputeRequirements.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **ComputeRequirements.storage** (`int`) = `None`: Storage for the container, in GiB. Defaults to 21, the minimum.

  Also accepted under the keys `storage_GiB` and `storage_gib`.

- **ComputeRequirements.vCPU** (`int`) = `512`: CPU units for the container, where 1024 units are one vCPU. Defaults to 512.

  One of 256, 512, 1024, 2048, 4096, 8192 or 16384.

#### ComputeRequirements.validate_storage_limit()

```python
def validate_storage_limit()
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L212-L216)

Reject compute requirements that set `storage` below 21 GiB.

#### ComputeRequirements.validate_vcpu_mem_combination()

```python
def validate_vcpu_mem_combination() -> ComputeRequirements
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L219-L249)

Reject compute requirements whose `vCPU` is not an allowed value, or whose `memory` it does not allow.

**Returns**

- `ComputeRequirements`

### ContainerParameters

```python
class roboto.domain.actions.action_record.ContainerParameters(/, **data: Any)
```

`from roboto import ContainerParameters`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L270-L296)

Bases: `pydantic.BaseModel`

How to run an action's container image.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ContainerParameters.command** (`list[str] | None`) = `None`: Command to run in the container, in place of the image's `CMD`, or `None` to keep the image's.
- **ContainerParameters.entry_point** (`list[str] | None`) = `None`: Entry point of the container, in place of the image's `ENTRYPOINT`, or `None` to keep the image's.
- **ContainerParameters.env_vars** (`dict[str, str] | None`) = `None`: Environment variables to set in the container, keyed by name.
- **ContainerParameters.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- **ContainerParameters.workdir** (`str | None`) = `None`: Working directory of the container, in place of the image's `WORKDIR`, or `None` to keep the image's.

### ExecutorContainer

```python
class roboto.domain.actions.action_record.ExecutorContainer(*args, **kwds)
```

`from roboto import ExecutorContainer`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_record.py#L148-L170)

Bases: `enum.Enum`

Container of an invocation that wrote a log line, as [`process`](/docs/reference/python-sdk/roboto/domain/actions/invocation_record#roboto.domain.actions.invocation_record.LogRecord.process).

The containers run together for each invocation of an action, and are listed here in the order they start.

**Attributes**

- **ExecutorContainer.Action** = `'action'`: Container that runs the action's container image.

- **ExecutorContainer.LogRouter** = `'firelens_log_router'`: Container that forwards the invocation's logs.

- **ExecutorContainer.Monitor** = `'monitor'`: Container that enforces the invocation's timeout.

- **ExecutorContainer.OutputHandler** = `'output_handler'`: Container that uploads the files the action wrote to its output directory, once the action succeeds.

- **ExecutorContainer.Setup** = `'setup'`: Container that prepares the action's input before the action runs.

  Downloads the input files unless the action sets `requires_downloaded_inputs` to `False`.
