yera.cli.setup_handlers.anthropic
Anthropic provider setup handler.
Symbols
AnthropicSetup
BaseProviderSetupHandler for configuring Anthropic provider connections.
This class implements the logic required to discover, prompt for, and validate the environment variables used to authenticate with Anthropic's API.
Methods
AnthropicSetup.detect_config
detect_config() → AnthropicConnection | NoneDetect and report an Anthropic connection from the environment.
Returns
A detected connection, or None when the conventional API-key environment variable is absent.
AnthropicSetup.ask_for_config
ask_for_config() → AnthropicConnection | NoneInteractively prompts the user to configure an Anthropic connection.
First asks the user for confirmation to proceed, then prompts for the name of the environment variable that holds the API key.
Returns
An AnthropicConnection instance containing the user-specified environment variable name, or None if the user declines the setup.
AnthropicSetup.validate
validate(
config: AnthropicConnection,
) → NoneValidate an Anthropic connection through the reusable setup operation.
Parameters
Anthropic connection to validate.
Raises
If its API-key environment variable is absent or malformed.