---
sidebar:
  hidden: true
title: roboto.action_runtime.action_input.action_input
---
## Module Contents

### ActionInput

```python
class roboto.action_runtime.action_input.action_input.ActionInput
```

`from roboto.action_runtime import ActionInput`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/action_runtime/action_input/action_input.py#L52-L105)

Input data of an action invocation: the files, sessions, and topics its input selectors matched.

Inside an action, fetch it with [`get_input()`](/docs/reference/python-sdk/roboto/action_runtime/invocation_context#roboto.action_runtime.invocation_context.InvocationContext.get_input); actions do not build it directly.

**Attributes**

- **ActionInput.files** (`collections.abc.Sequence[tuple[roboto.domain.files.File, pathlib.Path | None]]`) = `[]`: Files the invocation's file selectors matched, as `(file, local_path)` tuples.

  `file` is a [`File`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File). `local_path` is where Roboto downloaded the file before the action started, or `None` when the action does not require downloaded inputs ([`requires_downloaded_inputs`](/docs/reference/python-sdk/roboto/domain/actions/action#roboto.domain.actions.action.Action.requires_downloaded_inputs)).

- **ActionInput.sessions** (`collections.abc.Sequence[roboto.experimental.sessions.Session]`) = `[]`: Sessions ([`Session`](/docs/reference/python-sdk/roboto/experimental/sessions/session#roboto.experimental.sessions.session.Session)) the invocation's session selectors matched.

- **ActionInput.topics** (`collections.abc.Sequence[roboto.domain.topics.Topic]`) = `[]`: Topics ([`Topic`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic)) the invocation's topic selectors matched.

#### ActionInput.from_record()

```python
@classmethod
def from_record(
    record: ActionInputRecord,
    roboto_client: roboto.http.RobotoClient,
) -> ActionInput
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/action_runtime/action_input/action_input.py#L76-L91)

Build an `ActionInput` from its record, wrapping each file, session, and topic record.

[`get_input()`](/docs/reference/python-sdk/roboto/action_runtime/invocation_context#roboto.action_runtime.invocation_context.InvocationContext.get_input) builds an action's input through it, so most code never calls it.

**Parameters**

- **record** (`ActionInputRecord`): Record of the invocation's input.
- **roboto_client** (`roboto.http.RobotoClient`): Client to make requests to Roboto with.

**Returns**

- `ActionInput`

#### ActionInput.get_topics_by_name()

```python
def get_topics_by_name(topic_name: str) -> list[roboto.domain.topics.Topic]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/action_runtime/action_input/action_input.py#L93-L105)

Return the input topics with this name.

Several input topics can share a name, such as the same topic recorded in two files.

**Parameters**

- **topic_name** (`str`): Name of the topics to return, such as `"/imu/data"`.

**Returns**

- `list[roboto.domain.topics.Topic]`: Topics in `topics` with this name, in their order there. Empty when no input topic has this name.

### ActionInputRecord

```python
class roboto.action_runtime.action_input.action_input.ActionInputRecord(/, **data: Any)
```

`from roboto.action_runtime.action_input import ActionInputRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/action_runtime/action_input/action_input.py#L28-L48)

Bases: `pydantic.BaseModel`

Data record of an action invocation's input: the files, sessions, and topics its input selectors matched.

Returned by [`resolve_input_spec()`](/docs/reference/python-sdk/roboto/action_runtime/action_input/input_resolver#roboto.action_runtime.action_input.input_resolver.ActionInputResolver.resolve_input_spec), which Roboto calls while it sets up an invocation. [`get_input()`](/docs/reference/python-sdk/roboto/action_runtime/invocation_context#roboto.action_runtime.invocation_context.InvocationContext.get_input) reads it back and wraps it in [`ActionInput`](/docs/reference/python-sdk/roboto/action_runtime/action_input/action_input#roboto.action_runtime.action_input.action_input.ActionInput).

**Parameters**

- **data** (`Any`)

**Attributes**

- **ActionInputRecord.files** (`collections.abc.Sequence[tuple[roboto.domain.files.FileRecord, pathlib.Path | None]]`) = `None`: Records of the files the invocation's file selectors matched, each paired with the file's local path.

  The path is `None` when the files were not downloaded.

- **ActionInputRecord.sessions** (`collections.abc.Sequence[roboto.experimental.sessions.SessionRecord]`) = `None`: Records of the sessions the invocation's session selectors matched.

- **ActionInputRecord.topics** (`collections.abc.Sequence[roboto.domain.topics.TopicRecord]`) = `None`: Records of the topics the invocation's topic selectors matched.

### DEFAULT_INPUT_FILE

```python
roboto.action_runtime.action_input.action_input.DEFAULT_INPUT_FILE
```

`from roboto.action_runtime.action_input import DEFAULT_INPUT_FILE`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/action_runtime/action_input/action_input.py#L21-L21)

Path of an `action_input.json` file in the working directory at the time this module is imported.

No SDK method reads it.
