---
sidebar:
  label: roboto.env
  order: 9
title: roboto.env
---
## Module Contents

### ROBOTO_ENV_VAR_PREFIX

```python
roboto.env.ROBOTO_ENV_VAR_PREFIX = 'ROBOTO_'
```

`from roboto.env import ROBOTO_ENV_VAR_PREFIX`

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

### RobotoEnv

```python
class roboto.env.RobotoEnv(
    _case_sensitive: bool | None = None,
    _nested_model_default_partial_update: bool | None = None,
    _env_prefix: str | None = None,
    _env_prefix_target: pydantic_settings.sources.EnvPrefixTarget | None = None,
    _env_file: pydantic_settings.sources.DotenvType | None = ENV_FILE_SENTINEL,
    _env_file_encoding: str | None = None,
    _env_ignore_empty: bool | None = None,
    _env_nested_delimiter: str | None = None,
    _env_nested_max_split: int | None = None,
    _env_parse_none_str: str | None = None,
    _env_parse_enums: bool | None = None,
    _cli_prog_name: str | None = None,
    _cli_parse_args: bool | list[str] | tuple[str, ...] | None = None,
    _cli_settings_source: pydantic_settings.sources.CliSettingsSource[Any] | None = None,
    _cli_parse_none_str: str | None = None,
    _cli_hide_none_type: bool | None = None,
    _cli_avoid_json: bool | None = None,
    _cli_enforce_required: bool | None = None,
    _cli_use_class_docs_for_groups: bool | None = None,
    _cli_show_env_vars: bool | None = None,
    _cli_exit_on_error: bool | None = None,
    _cli_prefix: str | None = None,
    _cli_flag_prefix_char: str | None = None,
    _cli_implicit_flags: bool | Literal['dual', 'toggle'] | None = None,
    _cli_ignore_unknown_args: bool | None = None,
    _cli_kebab_case: bool | Literal['all', 'no_enums'] | None = None,
    _cli_shortcuts: collections.abc.Mapping[str, str | list[str]] | None = None,
    _secrets_dir: pydantic_settings.sources.PathType | None = None,
    _build_sources: tuple[tuple[pydantic_settings.sources.PydanticBaseSettingsSource, ...], dict[str, Any]] | None = None,
    **values: Any,
)
```

`from roboto import RobotoEnv`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/env.py#L93-L185)

Bases: `pydantic_settings.BaseSettings`

Enivronment within an action invocation runtime

**Parameters**

- **`_case_sensitive`** (`bool | None`)
- **`_nested_model_default_partial_update`** (`bool | None`)
- **`_env_prefix`** (`str | None`)
- **`_env_prefix_target`** (`pydantic_settings.sources.EnvPrefixTarget | None`)
- **`_env_file`** (`pydantic_settings.sources.DotenvType | None`)
- **`_env_file_encoding`** (`str | None`)
- **`_env_ignore_empty`** (`bool | None`)
- **`_env_nested_delimiter`** (`str | None`)
- **`_env_nested_max_split`** (`int | None`)
- **`_env_parse_none_str`** (`str | None`)
- **`_env_parse_enums`** (`bool | None`)
- **`_cli_prog_name`** (`str | None`)
- **`_cli_parse_args`** (`bool | list[str] | tuple[str, ...] | None`)
- **`_cli_settings_source`** (`pydantic_settings.sources.CliSettingsSource[Any] | None`)
- **`_cli_parse_none_str`** (`str | None`)
- **`_cli_hide_none_type`** (`bool | None`)
- **`_cli_avoid_json`** (`bool | None`)
- **`_cli_enforce_required`** (`bool | None`)
- **`_cli_use_class_docs_for_groups`** (`bool | None`)
- **`_cli_show_env_vars`** (`bool | None`)
- **`_cli_exit_on_error`** (`bool | None`)
- **`_cli_prefix`** (`str | None`)
- **`_cli_flag_prefix_char`** (`str | None`)
- **`_cli_implicit_flags`** (`bool | Literal['dual', 'toggle'] | None`)
- **`_cli_ignore_unknown_args`** (`bool | None`)
- **`_cli_kebab_case`** (`bool | Literal['all', 'no_enums'] | None`)
- **`_cli_shortcuts`** (`collections.abc.Mapping[str, str | list[str]] | None`)
- **`_secrets_dir`** (`pydantic_settings.sources.PathType | None`)
- **`_build_sources`** (`tuple[tuple[pydantic_settings.sources.PydanticBaseSettingsSource, ...], dict[str, Any]] | None`)
- **values** (`Any`)

**Attributes**

- **RobotoEnv.action_inputs_manifest_file** (`pathlib.Path | None`) = `None`

- **RobotoEnv.action_parameters_file** (`str | None`) = `None`

- **RobotoEnv.action_runtime_config_dir** (`str | None`) = `None`

- **RobotoEnv.action_timeout** (`str | None`) = `None`

- **RobotoEnv.api_key** (`str | None`) = `None`

- **RobotoEnv.cache_dir** (`str | None`) = `None`

- **RobotoEnv.config_file** (`str | None`) = `None`: An override for the location of a roboto config file. If not provided, the default \~/.roboto/config.json will be used (subject to RobotoConfig's implementation)

- **RobotoEnv.dataset_id** (`str | None`) = `None`

- **RobotoEnv.dataset_metadata_changeset_file** (`str | None`) = `None`

- **RobotoEnv.default_http_timeout** (`Timeout`) = `None`: Give up on Roboto Platform HTTP requests that take longer than this many seconds to complete. If the request is known to be idempotent, it will be automatically retried. Set to `None` to wait indefinitely.

- **RobotoEnv.dry_run** (`bool | None`) = `None`: Flag that action developers should use to gate side effects during local invocation.

  When set to True, actions should skip operations that have side effects, such as: - Uploading files to Roboto datasets - Modifying metadata - Making external API calls that are not idempotent

  This enables safe local testing and development without affecting production resources.

- **RobotoEnv.file_metadata_changeset_file** (`str | None`) = `None`

- **RobotoEnv.input_dir** (`str | None`) = `None`

- **RobotoEnv.invocation_id** (`str | None`) = `None`

- **RobotoEnv.log_level** (`str | None`) = `None`

- **RobotoEnv.org_id** (`str | None`) = `None`

- **RobotoEnv.output_dir** (`str | None`) = `None`

- **RobotoEnv.profile** (`str | None`) = `None`: The profile name to use if getting RobotoConfig from a config file.

- **RobotoEnv.roboto_env** (`str | None`) = `None`

- **RobotoEnv.roboto_service_endpoint** (`str | None`) = `None`: A Roboto Service API endpoint to send requests to, typically [https://api.roboto.ai](https://api.roboto.ai)

- **RobotoEnv.roboto_service_url** (`str | None`) = `None`: Deprecated, use roboto_service_endpoint instead. Left here until 0.3.3 is released so we can migrate existing actions to use the new env var.

#### RobotoEnv.default()

```python
@classmethod
def default() -> RobotoEnv
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/env.py#L97-L103)

**Returns**

- `RobotoEnv`

#### RobotoEnv.get_env_var()

```python
def get_env_var(var_name: str, default_value: Optional[str] = None) -> Optional[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/env.py#L184-L185)

**Parameters**

- **var_name** (`str`)
- **default_value** (`Optional[str]`)

**Returns**

- `Optional[str]`

### RobotoEnvKey

```python
class roboto.env.RobotoEnvKey
```

`from roboto.env import RobotoEnvKey`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/env.py#L54-L84)

Bases: `roboto.compat.StrEnum`

Environment variable keys available within an action invocation runtime

**Attributes**

- **RobotoEnvKey.ActionInputsManifest** = `'ROBOTO_ACTION_INPUTS_MANIFEST'`
- **RobotoEnvKey.ActionParametersFile** = `'ROBOTO_ACTION_PARAMETERS_FILE'`
- **RobotoEnvKey.ActionRuntimeConfigDir** = `'ROBOTO_ACTION_RUNTIME_CONFIG_DIR'`
- **RobotoEnvKey.ActionTimeout** = `'ROBOTO_ACTION_TIMEOUT'`
- **RobotoEnvKey.ApiKey** = `'ROBOTO_API_KEY'`
- **RobotoEnvKey.BearerToken** = `'ROBOTO_BEARER_TOKEN'`: Interchangable with ApiKey
- **RobotoEnvKey.CacheDir** = `'ROBOTO_CACHE_DIR'`
- **RobotoEnvKey.ConfigFile** = `'ROBOTO_CONFIG_FILE'`
- **RobotoEnvKey.DatasetId** = `'ROBOTO_DATASET_ID'`
- **RobotoEnvKey.DatasetMetadataChangesetFile** = `'ROBOTO_DATASET_METADATA_CHANGESET_FILE'`
- **RobotoEnvKey.DryRun** = `'ROBOTO_DRY_RUN'`
- **RobotoEnvKey.FileMetadataChangesetFile** = `'ROBOTO_FILE_METADATA_CHANGESET_FILE'`
- **RobotoEnvKey.InputDir** = `'ROBOTO_INPUT_DIR'`
- **RobotoEnvKey.InvocationId** = `'ROBOTO_INVOCATION_ID'`
- **RobotoEnvKey.LogLevel** = `'ROBOTO_LOG_LEVEL'`
- **RobotoEnvKey.OrgId** = `'ROBOTO_ORG_ID'`
- **RobotoEnvKey.OutputDir** = `'ROBOTO_OUTPUT_DIR'`
- **RobotoEnvKey.Profile** = `'ROBOTO_PROFILE'`
- **RobotoEnvKey.RobotoEnv** = `'ROBOTO_ENV'`
- **RobotoEnvKey.RobotoServiceEndpoint** = `'ROBOTO_SERVICE_ENDPOINT'`
- **RobotoEnvKey.RobotoServiceUrl** = `'ROBOTO_SERVICE_URL'`: Deprecated, use RobotoServiceEndpoint instead. Left here until 0.3.3 is released so we can migrate existing actions to use the new env var.

#### RobotoEnvKey.for_parameter()

```python
@staticmethod
def for_parameter(param_name: str) -> str
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/env.py#L83-L84)

**Parameters**

- **param_name** (`str`)

**Returns**

- `str`

### Timeout

```python
type roboto.env.Timeout = typing.Optional[typing.Union[float, NotSetType]]
```

`from roboto.env import Timeout`

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

Timeout in seconds.

NotSet: Use the client's default timeout None: No timeout (wait indefinitely) float: Explicit timeout in seconds

### resolve_env_variables()

```python
def roboto.env.resolve_env_variables(value: str)
```

`from roboto.env import resolve_env_variables`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/env.py#L29-L51)

Given any input string, resolves any environment variables in the string against the current environment.

**Parameters**

- **value** (`str`)
