---
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#L37-L98)

Resolved references to input data an Action was given to operate on.

To use, access via [`get_input()`](/reference/python-sdk/roboto/action_runtime/invocation_context#roboto.action_runtime.invocation_context.InvocationContext.get_input).

**Usage**

From within an Action, list files passed as input and check their size:

```python
context = InvocationContext.from_env()
action_input = context.get_input()
for file, local_path in action_input.files:
    print(f"{file.file_id} is {local_path.stat().st_size} bytes")
```

**Attributes**

- **ActionInput.files** (`collections.abc.Sequence[tuple[roboto.domain.files.File, pathlib.Path | None]]`) = `[]`: Files passed as input data to an action invocation.

  A file is represented as a tuple of (File, Optional[Path]) where: - File exposes metadata about the file and useful file operations - Optional[Path] is the local file path if the file has been downloaded

- **ActionInput.sessions** (`collections.abc.Sequence[roboto.experimental.sessions.Session]`) = `[]`: Sessions passed as input data to an action invocation.

- **ActionInput.topics** (`collections.abc.Sequence[roboto.domain.topics.Topic]`) = `[]`: Topics passed as input data to an action invocation.

#### 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#L75-L82)

Create an ActionInput instance from its serialized representation.

**Parameters**

- **record** (`ActionInputRecord`)
- **roboto_client** (`roboto.http.RobotoClient`)

**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#L84-L98)

Return any topics in this `ActionInput` that have the provided name.

**Parameters**

- **topic_name** (`str`): Topic name to look for.

**Returns**

- `list[roboto.domain.topics.Topic]`: A list of matching `Topic` instances from `self.topics`. If no topics have the provided name, the list will be empty. Otherwise, there will be one or more topics in the list, depending on the topic selectors provided to the action invocation.

### 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#L24-L33)

Bases: `pydantic.BaseModel`

Serializable representation of an `ActionInput`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ActionInputRecord.files** (`collections.abc.Sequence[tuple[roboto.domain.files.FileRecord, pathlib.Path | None]]`) = `None`
- **ActionInputRecord.sessions** (`collections.abc.Sequence[roboto.experimental.sessions.SessionRecord]`) = `None`
- **ActionInputRecord.topics** (`collections.abc.Sequence[roboto.domain.topics.TopicRecord]`) = `None`

### 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)
