sensai
¶
SensAIDeps
dataclass
¶
SensAIDeps(
job_status: JobStatus | None,
column_manifest: ColumnManifest,
current_plot_config: PlotConfig | None,
)
Runtime context available to the SensAI chat agent and every domain agent it delegates to.
job_status
instance-attribute
¶
job_status: JobStatus | None
The current job, or None if no job is loaded.
column_manifest
instance-attribute
¶
column_manifest: ColumnManifest
Signal column names available in the current trial's telemetry data.
current_plot_config
instance-attribute
¶
current_plot_config: PlotConfig | None
The plot config currently active in the trial viewer, or None if not set.
build_fallback_model
¶
Builds the FallbackModel shared by every SensAI agent from SensAISettings.models, in the priority order the user configured there - the first (provider, model name) pair is tried first, and each later one is only used if every earlier one errors.
Each entry's Model comes from ModelProvider.build_model, which builds that entry's provider exactly as Agent('provider:model') would - reading whatever environment variable that provider looks for by default (see ModelProvider.env_var_name) - except for an OLLAMA entry, which gets SensAISettings.base_url explicitly: unlike most providers, pydantic_ai's OllamaProvider has no built-in localhost default and raises without one. Only OLLAMA gets this - passing it to a provider that also happens to accept base_url (e.g. Google) would silently redirect that provider's real endpoint to Ollama's URL instead.
Raises:
| Type | Description |
|---|---|
ValueError
|
If |