yera.setup.base
Define the common result and interfaces used during interactive setup.
Symbols
ModelSetup
ABC, Generic[TConnection]MistralModelSetup, AnthropicModelSetup, OllamaModelSetup, AzureModelSetup, OpenAIModelSetup, OpenRouterModelSetup, AWSModelSetup, LlamaCppModelSetup, GeminiModelSetupObtain and validate model configuration for one provider connection.
A model setup is bound to a configured provider connection. Implementations contain provider-specific discovery and validation but perform no prompting, rendering, or persistence. Expected client, credential, and service failures are returned as diagnostics.
Attributes
Configuration key identifying the provider.
Python import paths required by the integration.
Name of the provider connection used for setup.
Typed provider connection used to obtain model configuration.
Methods
ModelSetup.get_config
get_config() → SetupResult[list[BaseModelConfig]]Obtain model configuration from the bound provider connection.
Returns
Discovered model configuration and associated diagnostics. An empty model list is valid when discovery completed successfully without finding supported models.
ModelSetup.validate
validate(
config: list[BaseModelConfig],
) → SetupResult[list[BaseModelConfig]]Validate model configuration without persisting it.
Typed model configuration has already passed schema validation. This default implementation therefore accepts it unchanged. Implementations may override the method when a provider has additional semantic constraints.
Parameters
Model configuration obtained or supplied during setup.
Returns
A valid result containing the supplied model configuration.
ProviderSetup
ABC, Generic[TConnection]MistralProviderSetup, AnthropicProviderSetup, OllamaProviderSetup, AzureProviderSetup, OpenAIProviderSetup, OpenRouterProviderSetup, AWSProviderSetup, LlamaCppProviderSetup, GeminiProviderSetupObtain and validate configuration for one provider integration.
Provider setup implementations contain no prompting, rendering, or persistence. Expected environmental, credential, and connectivity failures are returned as diagnostics so callers can decide whether to retry, edit, skip, or display the failure.
Attributes
Configuration key identifying the provider.
Python import paths required by the integration.
Methods
ProviderSetup.get_config
get_config() → SetupResult[tuple[TConnection, ...]]Obtain provider configuration candidates from the environment.
Discovery may produce multiple usable connections, such as AWS profiles or Azure OpenAI accounts. Expected discovery failures are returned as errors rather than raised.
Returns
Detected provider connection candidates and associated diagnostics. An empty tuple means discovery completed without finding a candidate. None means discovery could not produce a result.
ProviderSetup.validate
validate(
config: TConnection,
) → SetupResult[TConnection]Validate provider configuration without persisting it.
Expected credential, configuration, and connectivity failures are returned as errors. Invalid configuration is retained in the result so an interactive caller can present or edit it.
Parameters
Provider connection configuration to validate.
Returns
The supplied configuration and its validation diagnostics.
SetupResult
Generic[TConfig]Describe configuration and diagnostics produced during setup.
Setup operations return expected environmental and configuration failures through this type rather than raising exceptions. A result may retain invalid configuration so an interactive caller can display or edit it.
Attributes
Configuration obtained or validated by the operation.
Problems that prevent the configuration from being used.
Recoverable problems that do not prevent configuration.
Number of items intentionally omitted while obtaining configuration.