yera.cli.setup_handlers.ollama
Ollama provider setup handler.
Symbols
OllamaSetup
Inherits:
BaseProviderSetupHandler 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() → OllamaConnectionDetect 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 | NoneInteractively 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,
) → NoneValidate 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.