Documentation
¶
Overview ¶
Package profiles provides pure model-profile selection helpers — the part of the legacy cmd/speechkit model_selection_helpers.go that depends only on config and the model catalog (no *appState, no network, no Wails surface).
Functions that orchestrate the STT router or validate against provider credentials stay in package main for now because they pull in subsystems earmarked for later C2 PRs.
Index ¶
- func ConfiguredModeModelSelections(cfg *config.Config, _ models.Catalog) map[string]ModeModelSelectionSnapshot
- func EffectiveSelectedProfile(cfg *config.Config, catalog models.Catalog, mode string) (models.Profile, bool)
- func FindCatalogProfile(catalog models.Catalog, profileID string) (models.Profile, bool)
- func ModalityForMode(mode string) models.Modality
- func ModeSelectionForMode(cfg *config.Config, mode string) config.ModeModelSelection
- func NormalizeModeSelection(selection config.ModeModelSelection) config.ModeModelSelection
- func OrderedSelectionFromProfile(cfg *config.Config, profile models.Profile) (appai.OrderedModelSelection, bool)
- func SelectedModelIDForProfile(cfg *config.Config, profile models.Profile) string
- func SetModeSelectionForProfile(cfg *config.Config, profile models.Profile)
- func ValidateLocalProviderActivation(cfg *config.Config, modelPath string) error
- type ModeModelSelectionSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfiguredModeModelSelections ¶
func ConfiguredModeModelSelections(cfg *config.Config, _ models.Catalog) map[string]ModeModelSelectionSnapshot
ConfiguredModeModelSelections returns the snapshot for every runtime mode in a stable map suitable for serialization.
func EffectiveSelectedProfile ¶
func EffectiveSelectedProfile(cfg *config.Config, catalog models.Catalog, mode string) (models.Profile, bool)
EffectiveSelectedProfile returns the profile that should actually be used for the given mode, preferring the primary selection and falling back to the fallback if the primary is missing from the catalog.
func FindCatalogProfile ¶
FindCatalogProfile looks up a profile by ID in the catalog. The boolean is false for empty IDs and unknown profiles.
func ModalityForMode ¶
ModalityForMode maps a runtime mode name ("dictate", "assist", "voice_agent") to the corresponding model modality.
func ModeSelectionForMode ¶
func ModeSelectionForMode(cfg *config.Config, mode string) config.ModeModelSelection
ModeSelectionForMode returns the normalized profile selection stored in config for the given runtime mode.
func NormalizeModeSelection ¶
func NormalizeModeSelection(selection config.ModeModelSelection) config.ModeModelSelection
NormalizeModeSelection trims whitespace from both profile IDs and drops the fallback if it is identical to the primary.
func OrderedSelectionFromProfile ¶
func OrderedSelectionFromProfile(cfg *config.Config, profile models.Profile) (appai.OrderedModelSelection, bool)
OrderedSelectionFromProfile maps a profile to the Genkit-flavoured (provider, model) pair the AI runtime expects. Returns false for unsupported execution modes.
func SelectedModelIDForProfile ¶
SelectedModelIDForProfile resolves the actual model ID to run for a profile, accounting for user-configured local-LLM model overrides when the profile is a local built-in.
func SetModeSelectionForProfile ¶
SetModeSelectionForProfile writes the given profile as the primary selection for whichever runtime mode matches the profile's modality.
func ValidateLocalProviderActivation ¶
ValidateLocalProviderActivation checks that the local whisper.cpp model path is valid, the binary is present, and the model file is available. Returns a specific error describing what is missing so the caller can present an actionable hint.
Types ¶
type ModeModelSelectionSnapshot ¶
type ModeModelSelectionSnapshot struct {
PrimaryProfileID string `json:"primaryProfileId"`
FallbackProfileID string `json:"fallbackProfileId"`
}
ModeModelSelectionSnapshot is the JSON-friendly view of a mode's active profile selection (primary + optional fallback).