yera.cli.setup_handlers.openrouter

OpenRouter provider setup handler.

Symbols

class OpenRouterSetup — Handler for configuring OpenRouter provider connections.

OpenRouterSetup

Handler for configuring OpenRouter provider connections.

Methods

detect_config — Detect and report an OpenRouter connection from the environment.
ask_for_config — Prompt for an OpenRouter connection configuration.
validate — Validate an OpenRouter connection through the reusable setup operation.

OpenRouterSetup.detect_config

detect_config() → OpenRouterConnection | None

Detect and report an OpenRouter connection from the environment.

Returns

type: OpenRouterConnection | None

A detected connection, or None when the conventional API-key environment variable is absent.

OpenRouterSetup.ask_for_config

ask_for_config() → OpenRouterConnection | None

Prompt for an OpenRouter connection configuration.

Returns

type: OpenRouterConnection | None

The configured connection, or None when setup is declined.

OpenRouterSetup.validate

validate(
    config: OpenRouterConnection,
) → None

Validate an OpenRouter connection through the reusable setup operation.

Parameters

config
type: OpenRouterConnection

OpenRouter connection to validate.

Raises

ValueError

If its API-key environment variable is absent or malformed.