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

### InputFileResolver

```python
class roboto.action_runtime.action_input.file_resolver.InputFileResolver(
    roboto_client: Optional[roboto.http.RobotoClient] = None,
    roboto_search: Optional[roboto.roboto_search.RobotoSearch] = None,
)
```

`from roboto.action_runtime.action_input import InputFileResolver`

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

Resolver that fetches the files an action invocation's file selectors choose.

[`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) resolves an invocation's file selectors through it, so most code never calls it. Action code reads the resolved files from [`get_input()`](/docs/reference/python-sdk/roboto/action_runtime/invocation_context#roboto.action_runtime.invocation_context.InvocationContext.get_input) instead.

**Parameters**

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

**Attributes**

- **InputFileResolver.roboto_client** = `None`: Client this resolver makes requests to Roboto with.

  Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

- **InputFileResolver.roboto_search**: Search client that runs the RoboQL lookups for a selector's `query` and `names`.

  Defaults to one that sends its queries through `roboto_client`.

#### InputFileResolver.resolve()

```python
def resolve(
    selector: roboto.domain.actions.FileSelector,
) -> list[roboto.domain.files.File]
```

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

Fetch the files one selector chooses.

Files come back with those `paths` match first, then those `query` matches, then those named by `ids`, then those named by `names`. A file that more than one of these fields matches appears once for each.

- `paths` select files from the dataset `dataset_id` names, leaving out files beneath a top-level directory whose name starts with a dot. Without `dataset_id`, `paths` select nothing.
- A name in `names` matches a file whose whole path, not only its name, equals it: `"drive1.mcap"` matches `drive1.mcap` at the top of a dataset but not `logs/drive1.mcap`. A `%` or `_` in a name matches as a wildcard.
- `dataset_id` narrows only `paths`. When `query`, `ids` or `names` is also set, a warning is logged that it does not narrow them.

**Parameters**

- **selector** (`roboto.domain.actions.FileSelector`): Selector of the files to fetch.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No file has one of the IDs in the selector's `ids`, or no dataset has the selector's `dataset_id`.
- [`RobotoIllegalArgumentException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoIllegalArgumentException): The selector's `query` is not valid RoboQL.

**Returns**

- `list[roboto.domain.files.File]`

#### InputFileResolver.resolve_all()

```python
def resolve_all(
    file_selectors: collections.abc.Sequence[roboto.domain.actions.FileSelector],
) -> list[roboto.domain.files.File]
```

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

Fetch the files that any of the selectors choose, each file once.

Files come back in the order they are first found: selector by selector, and within one selector in the order `resolve` gives.

**Parameters**

- **file_selectors** (`collections.abc.Sequence[roboto.domain.actions.FileSelector]`): Selectors of the files to fetch.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No file has one of the IDs in a selector's `ids`, or no dataset has a selector's `dataset_id`.
- [`RobotoIllegalArgumentException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoIllegalArgumentException): A selector's `query` is not valid RoboQL.

**Returns**

- `list[roboto.domain.files.File]`

### log

```python
roboto.action_runtime.action_input.file_resolver.log
```

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

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