yera.cli.setup_handlers.mistral

Mistral provider setup handler.

Symbols

class MistralSetup — Handler for configuring Mistral provider connections.

MistralSetup

Handler for configuring Mistral provider connections.

This class implements the logic required to discover, prompt for, and validate the environment variables used to authenticate with Mistral's API.

Methods

detect_config — Detect and report a Mistral connection from the environment.
ask_for_config — Interactively prompts the user to configure a Mistral connection.
validate — Validate a Mistral connection through the reusable setup operation.

MistralSetup.detect_config

detect_config() → MistralConnection | None

Detect and report a Mistral connection from the environment.

Returns

type: MistralConnection | None

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

MistralSetup.ask_for_config

ask_for_config() → MistralConnection | None

Interactively prompts the user to configure a Mistral connection.

First asks the user for confirmation to proceed, then prompts for the name of the environment variable that holds the API key.

Returns

type: MistralConnection | None

A MistralConnection instance containing the user-specified environment variable name, or None if the user declines the setup.

MistralSetup.validate

validate(
    config: MistralConnection,
) → None

Validate a Mistral connection through the reusable setup operation.

Parameters

config
type: MistralConnection

Mistral connection to validate.

Raises

ValueError

If its API-key environment variable is absent or too short.