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

### InputTopicResolver

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

`from roboto.action_runtime.action_input import InputTopicResolver`

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

Resolver that fetches the topics an action invocation's topic 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 input's topic selectors through it, so most code never calls it. Action code reads the resolved topics 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**

- **InputTopicResolver.roboto_client** = `None`: Client to make 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).

- **InputTopicResolver.roboto_search**: Search client that runs the selectors' RoboQL queries.

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

#### InputTopicResolver.resolve()

```python
def resolve(
    topic_selector: roboto.domain.actions.DataSelector,
) -> list[roboto.domain.topics.Topic]
```

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

Fetch the topics one selector chooses.

Looks up the selector's `ids`, then its `names`, then its `query`, and returns every match in that order, so a topic that more than one of them matches appears more than once. A name matches every topic with exactly that name, in any dataset. A `dataset_id` on the selector does not narrow the lookup; it is ignored, with a logged warning.

**Parameters**

- **topic_selector** (`roboto.domain.actions.DataSelector`): Selector that chooses topics by ID, by name, or with a RoboQL query.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No topic has one of the selector's IDs.
- [`RobotoIllegalArgumentException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoIllegalArgumentException): The selector's `query` is not valid RoboQL.

**Returns**

- `list[roboto.domain.topics.Topic]`

#### InputTopicResolver.resolve_all()

```python
def resolve_all(
    topic_selectors: collections.abc.Sequence[roboto.domain.actions.DataSelector],
) -> list[roboto.domain.topics.Topic]
```

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

Fetch the topics that any of the selectors choose, each topic once.

Topics come back in the order `resolve` finds them, selector by selector. Fails as `resolve` does.

**Parameters**

- **topic_selectors** (`collections.abc.Sequence[roboto.domain.actions.DataSelector]`): Topic selectors to resolve.

**Returns**

- `list[roboto.domain.topics.Topic]`

### log

```python
roboto.action_runtime.action_input.topic_resolver.log
```

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

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