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

### InputSessionResolver

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

`from roboto.action_runtime.action_input import InputSessionResolver`

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

Service that looks up the sessions an action invocation takes as input, from its session selectors.

[`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 session selectors through it, so most code never calls it. Action code reads the sessions it found through [`get_input()`](/docs/reference/python-sdk/roboto/action_runtime/invocation_context#roboto.action_runtime.invocation_context.InvocationContext.get_input).

A selector names sessions by ID, by name, or with a RoboQL query.

**Parameters**

- **roboto_client** (`Optional[roboto.http.RobotoClient]`): 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).
- **roboto_search** (`Optional[roboto.roboto_search.RobotoSearch]`): Search client that runs the name and RoboQL lookups. `None` builds one that sends its queries through `roboto_client`.

**Attributes**

- **InputSessionResolver.roboto_client** = `None`: Client this service makes requests to Roboto with.
- **InputSessionResolver.roboto_search**: Search client that runs the name and RoboQL lookups.

#### InputSessionResolver.resolve()

```python
def resolve(
    session_selector: roboto.domain.actions.DataSelector,
) -> list[roboto.experimental.sessions.Session]
```

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

Fetch the sessions one selector names.

Sessions come back with those named by `ids` first, then those named by `names`, then those `query` matches. A session that more than one of these fields matches appears once for each. The selector's `dataset_id` is ignored, and the warning logged for it gives the `query` condition to use instead.

**Parameters**

- **session_selector** (`roboto.domain.actions.DataSelector`): Selector of the sessions to fetch.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No session has one of the IDs in the selector's `ids`.

**Returns**

- `list[roboto.experimental.sessions.Session]`

#### InputSessionResolver.resolve_all()

```python
def resolve_all(
    session_selectors: collections.abc.Sequence[roboto.domain.actions.DataSelector],
) -> list[roboto.experimental.sessions.Session]
```

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

Fetch the sessions that any of several selectors names, each session once.

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

**Parameters**

- **session_selectors** (`collections.abc.Sequence[roboto.domain.actions.DataSelector]`): Selectors of the sessions to fetch.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No session has one of the IDs in a selector's `ids`.

**Returns**

- `list[roboto.experimental.sessions.Session]`

### log

```python
roboto.action_runtime.action_input.session_resolver.log
```

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

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