secret_from_env#
- langchain_core.utils.utils.secret_from_env(
- key: str | Sequence[str],
- /,
- langchain_core.utils.utils.secret_from_env(
- key: str,
- /,
- *,
- default: str,
- langchain_core.utils.utils.secret_from_env(
- key: str | Sequence[str],
- /,
- *,
- default: None,
- langchain_core.utils.utils.secret_from_env(
- key: str,
- /,
- *,
- error_message: str,
Secret from env.
- Parameters:
key – The environment variable to look up.
default – The default value to return if the environment variable is not set.
error_message – the error message which will be raised if the key is not found and no default value is provided. This will be raised as a ValueError.
- Returns:
factory method that will look up the secret from the environment.