Expand description
Session-scoped LLM override resolution helpers.
This module centralizes the business logic for applying a per-session provider/model
override (see crate::agent_sessions::SessionLlmConfig) to an in-memory crate::config::AppConfig.
Goals:
- Keep GUI/CLI thin (they provide session data + platform-specific secret lookup).
- Ensure provider/model precedence and compatibility checks are consistent.
Structs§
- Effective
LlmConfig - The effective provider/model after applying session overrides.
Constants§
- KNOWN_
LLM_ PROVIDERS - Known LLM provider identifiers.
Functions§
- apply_
basic_ mode_ session_ llm_ overrides - Apply session-scoped LLM overrides (for basic/non-TUI CLI mode) and return a cloned config together with the effective provider/model.
- apply_
cli_ llm_ overrides - Apply CLI-provided provider and/or model overrides to an in-memory config.
- apply_
cli_ model_ arg_ overrides - Apply a CLI
--modelargument to the config. - apply_
cli_ provider_ arg_ override - Apply a CLI
--providerargument to the config. - apply_
cli_ session_ llm_ overrides - Apply session-style LLM overrides for CLI adapters.
- apply_
session_ llm_ overrides - Apply session-scoped LLM overrides to an in-memory config and return the effective provider/model.
- is_
known_ llm_ provider - Returns
truewhenprovidermatches one of theKNOWN_LLM_PROVIDERS(case-insensitive comparison). - normalize_
session_ llm_ override - Normalize and (optionally) migrate session-scoped LLM selection state.
- parse_
model_ selector_ legacy_ aware - Parse a legacy-aware selector string into a session override.
- resolve_
session_ llm_ override - Resolve the session-scoped LLM override from an
AgentSession. - session_
llm_ config_ from_ cli_ model_ arg - Parse a CLI-style model selector (e.g.
"provider:model"or"model") into aSessionLlmConfig.