roboto.env#
Module Contents#
- roboto.env.ROBOTO_ENV_VAR_PREFIX = 'ROBOTO_'#
- class roboto.env.RobotoEnv(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=ENV_FILE_SENTINEL, _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _cli_shortcuts=None, _secrets_dir=None, **values)#
Bases:
pydantic_settings.BaseSettingsEnivronment within an action invocation runtime
- Parameters:
_case_sensitive (bool | None)
_nested_model_default_partial_update (bool | None)
_env_prefix (str | 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, Ellipsis] | 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_exit_on_error (bool | None)
_cli_prefix (str | None)
_cli_flag_prefix_char (str | None)
_cli_implicit_flags (bool | 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)
values (Any)
- action_inputs_manifest_file: pathlib.Path | None = None#
- action_parameters_file: str | None = None#
- action_runtime_config_dir: str | None = None#
- action_timeout: str | None = None#
- api_key: str | None = None#
- cache_dir: str | None = None#
- 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)
- dataset_id: str | None = None#
- dataset_metadata_changeset_file: str | None = None#
- 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
Noneto wait indefinitely.
- 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.
- file_metadata_changeset_file: str | None = None#
- get_env_var(var_name, default_value=None)#
- Parameters:
var_name (str)
default_value (Optional[str])
- Return type:
Optional[str]
- input_dir: str | None = None#
- invocation_id: str | None = None#
- log_level: str | None = None#
- org_id: str | None = None#
- output_dir: str | None = None#
- profile: str | None = None#
The profile name to use if getting RobotoConfig from a config file.
- roboto_env: str | None = None#
- roboto_service_endpoint: str | None = None#
//api.roboto.ai
- Type:
A Roboto Service API endpoint to send requests to, typically https
- 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.
- class roboto.env.RobotoEnvKey#
Bases:
roboto.compat.StrEnumEnvironment variable keys available within an action invocation runtime
- ActionInputsManifest = 'ROBOTO_ACTION_INPUTS_MANIFEST'#
- ActionParametersFile = 'ROBOTO_ACTION_PARAMETERS_FILE'#
- ActionRuntimeConfigDir = 'ROBOTO_ACTION_RUNTIME_CONFIG_DIR'#
- ActionTimeout = 'ROBOTO_ACTION_TIMEOUT'#
- ApiKey = 'ROBOTO_API_KEY'#
- BearerToken = 'ROBOTO_BEARER_TOKEN'#
Interchangable with ApiKey
- CacheDir = 'ROBOTO_CACHE_DIR'#
- ConfigFile = 'ROBOTO_CONFIG_FILE'#
- DatasetId = 'ROBOTO_DATASET_ID'#
- DatasetMetadataChangesetFile = 'ROBOTO_DATASET_METADATA_CHANGESET_FILE'#
- DryRun = 'ROBOTO_DRY_RUN'#
- FileMetadataChangesetFile = 'ROBOTO_FILE_METADATA_CHANGESET_FILE'#
- InputDir = 'ROBOTO_INPUT_DIR'#
- InvocationId = 'ROBOTO_INVOCATION_ID'#
- LogLevel = 'ROBOTO_LOG_LEVEL'#
- OrgId = 'ROBOTO_ORG_ID'#
- OutputDir = 'ROBOTO_OUTPUT_DIR'#
- Profile = 'ROBOTO_PROFILE'#
- RobotoEnv = 'ROBOTO_ENV'#
- RobotoServiceEndpoint = 'ROBOTO_SERVICE_ENDPOINT'#
- 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.
- static for_parameter(param_name)#
- Parameters:
param_name (str)
- Return type:
str
- type roboto.env.Timeout = Optional[Union[float, NotSetType]]#
Timeout in seconds.
NotSet: Use the client’s default timeout None: No timeout (wait indefinitely) float: Explicit timeout in seconds
- roboto.env.resolve_env_variables(value)#
Given any input string, resolves any environment variables in the string against the current environment.
- Parameters:
value (str)