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

### ActionConfig

```python
class roboto.domain.actions.action_config.ActionConfig(/, **data: Any)
```

`from roboto.domain.actions import ActionConfig`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_config.py#L40-L140)

Bases: `pydantic.BaseModel`

Configuration of an action, as an `action.json` file holds it.

`roboto actions create --from-file` reads the file to create or update an action, `roboto actions invoke-local` reads it to run the action in a local directory, and `roboto actions init` generates one for a new action.

Unlike [`ActionRecord`](/docs/reference/python-sdk/roboto/domain/actions/action_record#roboto.domain.actions.action_record.ActionRecord), it has no fields that Roboto sets, such as `created`, `org_id` and `digest`, and none that are set after the action is created, such as `published` and `accessibility`. Keys it does not define are ignored. A configuration that sets both `docker_config` and `image_uri` raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ActionConfig.compute_requirements** (`roboto.domain.actions.action_record.ComputeRequirements | None`) = `None`: CPU, memory and storage for each invocation of the action.

  `None` uses the defaults of [`ComputeRequirements`](/docs/reference/python-sdk/roboto/domain/actions/action_record#roboto.domain.actions.action_record.ComputeRequirements).

- **ActionConfig.container_parameters** (`roboto.domain.actions.action_record.ContainerParameters | None`) = `None`: Command, entry point, environment variables and working directory for the action's container.

  `None` sets none of them.

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

- **ActionConfig.docker_config** (`DockerImageConfig | None`) = `None`: How to build the action's container image from a local Dockerfile. Cannot be set with `image_uri`.

  `roboto actions create` does not build images, and exits with an error when this is set. Build the image with `docker`, push it with `roboto images push`, and set `image_uri` instead. `roboto actions invoke-local` ignores this field and builds the `Dockerfile` in the action's directory.

- **ActionConfig.image_uri** (`str | None`) = `None`: URI of the container image the action runs, already pushed to a registry Roboto can pull from.

  Becomes the action's [`uri`](/docs/reference/python-sdk/roboto/domain/actions/action_record#roboto.domain.actions.action_record.ActionRecord.uri). Cannot be set with `docker_config`.

- **ActionConfig.inherits** (`roboto.domain.actions.action_record.ActionReference | None`) = `None`: Deprecated. Action this action inherits its configuration from.

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

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

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

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

- **ActionConfig.parameters** (`list[roboto.domain.actions.action_record.ActionParameter]`) = `None`: Parameters that an invocation of the action can give values for. Defaults to none.

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

- **ActionConfig.short_description** (`str | None`) = `None`: Brief description of the action.

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

- **ActionConfig.tags** (`list[str]`) = `None`: Tags to set on the action. Defaults to none.

- **ActionConfig.timeout** (`int | None`) = `None`: Maximum time an invocation of the action may run, in minutes. `None` uses Roboto's default.

#### ActionConfig.enforce_invariants()

```python
def enforce_invariants(values: dict) -> dict
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_config.py#L129-L138)

Reject a configuration that sets both `docker_config` and `image_uri`.

**Parameters**

- **values** (`dict`)

**Returns**

- `dict`

#### ActionConfig.from_file()

```python
@classmethod
def from_file(path: pathlib.Path) -> ActionConfig
```

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

Read an action configuration from a JSON file, such as `action.json`.

**Parameters**

- **path** (`pathlib.Path`): Path to the JSON file.

**Raises**

- `FileNotFoundError`: No file exists at `path`.
- `pydantic.ValidationError`: The file is not valid JSON, does not match this model, or sets both `docker_config` and `image_uri`.

**Returns**

- `ActionConfig`

### DockerImageConfig

```python
class roboto.domain.actions.action_config.DockerImageConfig(/, **data: Any)
```

`from roboto.domain.actions.action_config import DockerImageConfig`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/action_config.py#L21-L37)

Bases: `pydantic.BaseModel`

Settings for building an action's container image from a Dockerfile.

Carried in `ActionConfig.docker_config`. Import it from `roboto.domain.actions.action_config`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DockerImageConfig.build_args** (`dict[str, str]`) = `None`: Build arguments, keyed by name, as `docker build --build-arg` takes them.

- **DockerImageConfig.context** (`pathlib.Path`): Build context directory. Defaults to the directory the process was in when `roboto` was imported.

- **DockerImageConfig.dockerfile** (`pathlib.Path`): Path to the Dockerfile.

  Defaults to `Dockerfile` in the directory the process was in when `roboto` was imported.
