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

### ActionInputResolver

```python
class roboto.action_runtime.action_input.input_resolver.ActionInputResolver(
    file_resolver: roboto.action_runtime.action_input.file_resolver.InputFileResolver,
    session_resolver: roboto.action_runtime.action_input.session_resolver.InputSessionResolver,
    topic_resolver: roboto.action_runtime.action_input.topic_resolver.InputTopicResolver,
    file_service: roboto.storage.FileService,
)
```

`from roboto.action_runtime import ActionInputResolver`

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

Resolves the action invocation input spec to concrete Roboto entities.

The entities are packaged together in an ActionInput instance, which is available to action code via ActionRuntime.

**Parameters**

- **file_resolver** (`roboto.action_runtime.action_input.file_resolver.InputFileResolver`)
- **session_resolver** (`roboto.action_runtime.action_input.session_resolver.InputSessionResolver`)
- **topic_resolver** (`roboto.action_runtime.action_input.topic_resolver.InputTopicResolver`)
- **file_service** (`roboto.storage.FileService`)

#### ActionInputResolver.from_env()

```python
@classmethod
def from_env(
    roboto_client: Optional[roboto.http.RobotoClient] = None,
    roboto_search: Optional[roboto.roboto_search.RobotoSearch] = None,
) -> ActionInputResolver
```

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

**Parameters**

- **roboto_client** (`Optional[roboto.http.RobotoClient]`)
- **roboto_search** (`Optional[roboto.roboto_search.RobotoSearch]`)

**Returns**

- `ActionInputResolver`

#### ActionInputResolver.resolve_input_spec()

```python
def resolve_input_spec(
    input_spec: roboto.domain.actions.InvocationInput,
    download: bool = False,
    download_path: Optional[pathlib.Path] = None,
) -> roboto.action_runtime.action_input.action_input.ActionInputRecord
```

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

Resolve the input spec's file, session, and topic selectors to the entities they match.

When the spec asks for files, sessions, or topics and none match, that category comes back empty with a logged warning rather than an error.

**Parameters**

- **input_spec** (`roboto.domain.actions.InvocationInput`): Input specification containing data selectors. See [`InvocationInput`](/reference/python-sdk/roboto/domain/actions/invocation_record#roboto.domain.actions.invocation_record.InvocationInput) for more detail.
- **download** (`bool`): If True, download all resolved files to local disk. Defaults to False.
- **download_path** (`Optional[pathlib.Path]`): Directory path where files should be downloaded. If not provided and download=True, a temporary directory will be created. Ignored if download=False.

**Returns**

- `roboto.action_runtime.action_input.action_input.ActionInputRecord`: ActionInputRecord containing:

  - files: List of (FileRecord, Optional[Path]) tuples. Path is None if download=False, otherwise contains the local path where the file was downloaded.
  - sessions: List of SessionRecord instances.
  - topics: List of TopicRecord instances.

**Usage**

Resolve files using a RoboQL query without downloading:

```python
input_spec = InvocationInput.file_query('dataset_id = "ds_abc123" AND path LIKE "%.mcap"')
result = resolver.resolve_input_spec(input_spec)
# result.files contains (FileRecord, None) tuples
# result.topics is empty
```

Resolve and download files to a specific directory:

```python
input_spec = InvocationInput.file_query('dataset_id = "ds_abc123" AND path LIKE "%.mcap"')
result = resolver.resolve_input_spec(input_spec, download=True, download_path=Path("/tmp/data"))
# result.files contains (FileRecord, Path) tuples with local paths
```

Resolve both files and topics:

```python
input_spec = InvocationInput(
    files=FileSelector(query='dataset_id = "ds_abc123" AND path LIKE "%.mcap"'),
    topics=DataSelector(names=["battery_status", "gps"]),
)
result = resolver.resolve_input_spec(input_spec)
# result.files contains file records
# result.topics contains topic records
```

### OptionallyDownloadedFile

```python
type roboto.action_runtime.action_input.input_resolver.OptionallyDownloadedFile = tuple[File, pathlib.Path | None]
```

`from roboto.action_runtime.action_input.input_resolver import OptionallyDownloadedFile`

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

### log

```python
roboto.action_runtime.action_input.input_resolver.log
```

`from roboto.action_runtime.action_input.input_resolver import log`

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