yera.cli.setup_handlers.ollama

Ollama provider setup handler.

Symbols

class OllamaSetup — Handler for configuring Ollama provider connections.

OllamaSetup

Handler for configuring Ollama provider connections.

This class manages the setup of the connection to a local or remote Ollama server, primarily focusing on the base URL configuration and connectivity verification.

Methods

detect_config — Detect and report the resolved Ollama connection.
ask_for_config — Interactively prompts the user for the Ollama server URL.
validate — Validate an Ollama connection through the reusable setup operation.

OllamaSetup.detect_config

detect_config() → OllamaConnection

Detect and report the resolved Ollama connection.

Returns

type: OllamaConnection

A normalized connection using the configured host or local default.

OllamaSetup.ask_for_config

ask_for_config() → OllamaConnection | None

Interactively prompts the user for the Ollama server URL.

Returns

type: OllamaConnection | None

An OllamaConnection instance containing the user-provided URL, or None if the user declines the setup.

OllamaSetup.validate

validate(
    config: OllamaConnection,
) → None

Validate an Ollama connection through the reusable setup operation.

Parameters

config
type: OllamaConnection

Ollama connection to validate.

Raises

ValueError

If the configured server cannot be reached.