config

package
v0.22.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HotkeyBehaviorPushToTalk = "push_to_talk"
	HotkeyBehaviorToggle     = "toggle"

	VoiceAgentCloseBehaviorContinue = "continue"
	VoiceAgentCloseBehaviorNewChat  = "new_chat"

	DefaultLocalLLMBaseURL = "http://127.0.0.1:8082/v1"
)

Variables

This section is empty.

Functions

func ApplyLocalInstallDefaults added in v0.14.1

func ApplyLocalInstallDefaults(cfg *Config, state *InstallState) bool

ApplyLocalInstallDefaults configures a pending local install to wait for the onboarding download flow before enabling a local Whisper runtime.

func ApplyManagedIntegrationDefaults

func ApplyManagedIntegrationDefaults(cfg *Config) bool

func HuggingFaceTokenEnvName

func HuggingFaceTokenEnvName(cfg *Config) string

func HuggingFaceTokenStatus

func HuggingFaceTokenStatus(cfg *Config) (secrets.TokenStatus, error)

func IsFirstRun

func IsFirstRun() bool

IsFirstRun returns true if no install state file exists.

func ManagedHuggingFaceAvailableInBuild added in v0.14.6

func ManagedHuggingFaceAvailableInBuild() bool

func NormalizeHotkeyBehavior added in v0.21.1

func NormalizeHotkeyBehavior(value, fallback string) string

func NormalizeVoiceAgentCloseBehavior added in v0.21.1

func NormalizeVoiceAgentCloseBehavior(value, fallback string) string

func OverrideManagedHuggingFaceBuildForTests added in v0.14.6

func OverrideManagedHuggingFaceBuildForTests(value string) func()

func ResolveHuggingFaceToken

func ResolveHuggingFaceToken(cfg *Config) (string, secrets.TokenStatus, error)

func ResolveSecret

func ResolveSecret(envName string) string

ResolveSecret resolves a secret by name. Checks environment first, then Doppler CLI using either explicit DOPPLER_PROJECT/DOPPLER_CONFIG env vars or build-embedded managed Doppler defaults.

func ResolveSecretFromEnvironmentOrDoppler added in v0.14.8

func ResolveSecretFromEnvironmentOrDoppler(envName string) string

func Save

func Save(path string, cfg *Config) error

func SaveInstallState

func SaveInstallState(state *InstallState) error

SaveInstallState writes the install state to disk.

Types

type AudioConfig

type AudioConfig struct {
	Backend        string `toml:"backend"`
	DeviceID       string `toml:"device_id"`
	OutputDeviceID string `toml:"output_device_id"`
	SampleRate     int    `toml:"sample_rate"`
	Channels       int    `toml:"channels"`
	FrameSizeMs    int    `toml:"frame_size_ms"`
	LatencyHint    string `toml:"latency_hint"`
}

type Config

type Config struct {
	General        GeneralConfig        `toml:"general"`
	Audio          AudioConfig          `toml:"audio"`
	UI             UIConfig             `toml:"ui"`
	Vocabulary     VocabularyConfig     `toml:"vocabulary"`
	Shortcuts      ShortcutsConfig      `toml:"shortcuts"`
	ModelSelection ModelSelectionConfig `toml:"model_selection"`
	Local          LocalConfig          `toml:"local"`
	LocalLLM       LocalLLMConfig       `toml:"local_llm"`
	VPS            VPSConfig            `toml:"vps"`
	HuggingFace    HuggingFaceConfig    `toml:"huggingface"`
	Routing        RoutingConfig        `toml:"routing"`
	Feedback       FeedbackConfig       `toml:"feedback"` // legacy compat; prefer Store
	Store          StoreConfig          `toml:"store"`
	Providers      ProvidersConfig      `toml:"providers"`
	TTS            TTSConfig            `toml:"tts"`
	VoiceAgent     VoiceAgentConfig     `toml:"voice_agent"`
}

func Load

func Load(path string) (*Config, error)

Load reads config from the given path. Falls back to defaults if file not found.

func (*Config) LegacyAgentHotkey added in v0.19.0

func (cfg *Config) LegacyAgentHotkey() string

type FeedbackConfig

type FeedbackConfig struct {
	SaveAudio          bool   `toml:"save_audio"`
	AudioRetentionDays int    `toml:"audio_retention_days"`
	DBPath             string `toml:"db_path"`
	MaxAudioStorageMB  int    `toml:"max_audio_storage_mb"`
}

type GeneralConfig

type GeneralConfig struct {
	Language                 string `toml:"language"`
	Hotkey                   string `toml:"hotkey"` // Deprecated: legacy single-hotkey field kept for config file compat. Use DictateHotkey.
	DictateHotkey            string `toml:"dictate_hotkey"`
	AssistHotkey             string `toml:"assist_hotkey"`
	VoiceAgentHotkey         string `toml:"voice_agent_hotkey"`
	DictateHotkeyBehavior    string `toml:"dictate_hotkey_behavior"`
	AssistHotkeyBehavior     string `toml:"assist_hotkey_behavior"`
	VoiceAgentHotkeyBehavior string `toml:"voice_agent_hotkey_behavior"`
	DictateEnabled           bool   `toml:"dictate_enabled"`
	AssistEnabled            bool   `toml:"assist_enabled"`
	VoiceAgentEnabled        bool   `toml:"voice_agent_enabled"`
	AutoStartOnLaunch        bool   `toml:"auto_start_on_launch"`
	AgentHotkey              string `toml:"agent_hotkey"`
	AgentMode                string `toml:"agent_mode"`  // "assist" or "voice_agent" — determines what agent_hotkey triggers
	ActiveMode               string `toml:"active_mode"` // legacy compat
	HotkeyMode               string `toml:"hotkey_mode"` // legacy compat for single behavior setting
	AutoStopSilenceMs        int    `toml:"auto_stop_silence_ms"`
	FastModeSilenceMs        int    `toml:"fast_mode_silence_ms"` // silence threshold for Quick Capture auto-stop
}

func (GeneralConfig) LegacyAgentHotkey added in v0.19.0

func (g GeneralConfig) LegacyAgentHotkey() string

type GoogleProviderConfig

type GoogleProviderConfig struct {
	Enabled      bool   `toml:"enabled"`
	APIKeyEnv    string `toml:"api_key_env"`
	STTModel     string `toml:"stt_model"`
	UtilityModel string `toml:"utility_model"`
	AssistModel  string `toml:"assist_model"`
	AgentModel   string `toml:"agent_model"`
}

type GroqProviderConfig

type GroqProviderConfig struct {
	Enabled      bool   `toml:"enabled"`
	APIKeyEnv    string `toml:"api_key_env"`
	STTModel     string `toml:"stt_model"`
	UtilityModel string `toml:"utility_model"`
	AssistModel  string `toml:"assist_model"`
	AgentModel   string `toml:"agent_model"`
}

type HuggingFaceConfig

type HuggingFaceConfig struct {
	Enabled      bool   `toml:"enabled"`
	Model        string `toml:"model"`
	UtilityModel string `toml:"utility_model"`
	AssistModel  string `toml:"assist_model"`
	AgentModel   string `toml:"agent_model"`
	TokenEnv     string `toml:"token_env"`
}

type InstallMode

type InstallMode string

InstallMode defines whether SpeechKit runs locally or connected to kombify Cloud.

const (
	InstallModeLocal  InstallMode = "local"
	InstallModeCloud  InstallMode = "cloud"
	InstallModeNotSet InstallMode = ""
)

type InstallState

type InstallState struct {
	Mode      InstallMode `toml:"mode"`
	SetupDone bool        `toml:"setup_done"`
	DeviceID  string      `toml:"device_id"`
}

InstallState persists the user's install mode choice and device identity. Stored in %APPDATA%/SpeechKit/install.toml, separate from config.toml.

func LoadInstallState

func LoadInstallState() (*InstallState, error)

LoadInstallState reads the install state from disk. Returns a default (empty mode) if the file doesn't exist.

type LocalConfig

type LocalConfig struct {
	Enabled   bool   `toml:"enabled"`
	Model     string `toml:"model"`
	ModelPath string `toml:"model_path"`
	Port      int    `toml:"port"`
	GPU       string `toml:"gpu"`
}

type LocalLLMConfig added in v0.22.1

type LocalLLMConfig struct {
	Enabled      bool   `toml:"enabled"`
	BaseURL      string `toml:"base_url"`
	Model        string `toml:"model"`
	ModelPath    string `toml:"model_path"`
	Port         int    `toml:"port"`
	GPU          string `toml:"gpu"`
	UtilityModel string `toml:"utility_model"`
	AssistModel  string `toml:"assist_model"`
	AgentModel   string `toml:"agent_model"`
}

type ModeModelSelection added in v0.21.1

type ModeModelSelection struct {
	PrimaryProfileID  string `toml:"primary_profile_id"`
	FallbackProfileID string `toml:"fallback_profile_id"`
}

type ModelSelectionConfig added in v0.21.1

type ModelSelectionConfig struct {
	Dictate    ModeModelSelection `toml:"dictate"`
	Assist     ModeModelSelection `toml:"assist"`
	VoiceAgent ModeModelSelection `toml:"voice_agent"`
}

type OllamaProviderConfig

type OllamaProviderConfig struct {
	Enabled      bool   `toml:"enabled"`
	BaseURL      string `toml:"base_url"`
	STTModel     string `toml:"stt_model"`
	UtilityModel string `toml:"utility_model"`
	AssistModel  string `toml:"assist_model"`
	AgentModel   string `toml:"agent_model"`
}

type OpenAIProviderConfig

type OpenAIProviderConfig struct {
	Enabled       bool   `toml:"enabled"`
	APIKeyEnv     string `toml:"api_key_env"`
	STTModel      string `toml:"stt_model"`
	UtilityModel  string `toml:"utility_model"`
	AssistModel   string `toml:"assist_model"`
	AgentModel    string `toml:"agent_model"`
	TTSModel      string `toml:"tts_model"`
	TTSVoice      string `toml:"tts_voice"`
	RealtimeModel string `toml:"realtime_model"`
}

type OpenRouterProviderConfig added in v0.15.0

type OpenRouterProviderConfig struct {
	Enabled      bool   `toml:"enabled"`
	APIKeyEnv    string `toml:"api_key_env"`
	UtilityModel string `toml:"utility_model"`
	AssistModel  string `toml:"assist_model"`
	AgentModel   string `toml:"agent_model"`
}

type OverlayFreePosition added in v0.19.0

type OverlayFreePosition struct {
	X int `toml:"x"`
	Y int `toml:"y"`
}

type ProvidersConfig

type ProvidersConfig struct {
	OpenAI     OpenAIProviderConfig     `toml:"openai"`
	Groq       GroqProviderConfig       `toml:"groq"`
	Google     GoogleProviderConfig     `toml:"google"`
	Ollama     OllamaProviderConfig     `toml:"ollama"`
	OpenRouter OpenRouterProviderConfig `toml:"openrouter"`
}

ProvidersConfig groups all external provider configurations.

type RoutingConfig

type RoutingConfig struct {
	Strategy                string  `toml:"strategy"`
	PreferLocalUnderSeconds float64 `toml:"prefer_local_under_seconds"`
	ParallelCloud           bool    `toml:"parallel_cloud"`
	ReplaceOnBetter         bool    `toml:"replace_on_better"`
}

type ShortcutLocaleConfig added in v0.18.0

type ShortcutLocaleConfig struct {
	LeadingFillers []string `toml:"leading_fillers"`
	CopyLast       []string `toml:"copy_last"`
	InsertLast     []string `toml:"insert_last"`
	Summarize      []string `toml:"summarize"`
	QuickNote      []string `toml:"quick_note"`
}

type ShortcutsConfig added in v0.18.0

type ShortcutsConfig struct {
	Locale map[string]ShortcutLocaleConfig `toml:"locale"`
}

type StoreConfig

type StoreConfig struct {
	Backend            string `toml:"backend"` // "sqlite" | "postgres" | registered name
	SQLitePath         string `toml:"sqlite_path"`
	PostgresDSN        string `toml:"postgres_dsn"`
	SaveAudio          bool   `toml:"save_audio"`
	AudioRetentionDays int    `toml:"audio_retention_days"`
	MaxAudioStorageMB  int    `toml:"max_audio_storage_mb"`
}

type TTSConfig

type TTSConfig struct {
	Enabled     bool           `toml:"enabled"`
	Strategy    string         `toml:"strategy"` // "cloud-first", "local-first", "cloud-only", "local-only"
	Voice       string         `toml:"voice"`    // Global default voice override
	Speed       float64        `toml:"speed"`    // Global speed 0.25-4.0, default 1.0
	Format      string         `toml:"format"`   // "mp3", "wav", "opus", "pcm"
	OpenAI      TTSOpenAI      `toml:"openai"`
	Google      TTSGoogle      `toml:"google"`
	HuggingFace TTSHuggingFace `toml:"huggingface"`
	Local       TTSLocal       `toml:"local"`
}

TTSConfig configures text-to-speech for Assist Mode.

type TTSGoogle

type TTSGoogle struct {
	Enabled bool   `toml:"enabled"`
	Voice   string `toml:"voice"` // e.g. "de-DE-Neural2-B"
}

type TTSHuggingFace

type TTSHuggingFace struct {
	Enabled bool   `toml:"enabled"`
	Model   string `toml:"model"` // e.g. "parler-tts/parler-tts-mini-multilingual-v1.1"
}

type TTSLocal

type TTSLocal struct {
	Enabled   bool   `toml:"enabled"`
	Model     string `toml:"model"`
	ModelPath string `toml:"model_path"`
	Port      int    `toml:"port"`
}

type TTSOpenAI

type TTSOpenAI struct {
	Enabled bool   `toml:"enabled"`
	Model   string `toml:"model"` // "tts-1" or "tts-1-hd"
	Voice   string `toml:"voice"` // alloy, echo, fable, onyx, nova, shimmer
}

type UIConfig

type UIConfig struct {
	OverlayEnabled          bool                           `toml:"overlay_enabled"`
	OverlayPosition         string                         `toml:"overlay_position"` // "top", "bottom", "left", "right"
	OverlayMovable          bool                           `toml:"overlay_movable"`
	OverlayFreeX            int                            `toml:"overlay_free_x"`
	OverlayFreeY            int                            `toml:"overlay_free_y"`
	OverlayMonitorPositions map[string]OverlayFreePosition `toml:"overlay_monitor_positions"`
	Visualizer              string                         `toml:"visualizer"`
	Design                  string                         `toml:"design"`
}

type VPSConfig

type VPSConfig struct {
	Enabled   bool   `toml:"enabled"`
	URL       string `toml:"url"`
	APIKeyEnv string `toml:"api_key_env"`
}

type VocabularyConfig added in v0.14.6

type VocabularyConfig struct {
	Dictionary string `toml:"dictionary"`
}

type VoiceAgentConfig

type VoiceAgentConfig struct {
	Enabled                         bool   `toml:"enabled"`
	Model                           string `toml:"model"`             // Real-time model ID (e.g. "gemini-2.5-flash-native-audio-preview-12-2025")
	FallbackModel                   string `toml:"fallback_model"`    // Fallback real-time model
	Voice                           string `toml:"voice"`             // Voice name for real-time model
	FrameworkPrompt                 string `toml:"framework_prompt"`  // Durable host/framework instruction that defines the Voice Agent behavior
	RefinementPrompt                string `toml:"refinement_prompt"` // User-specific refinement appended to the framework prompt
	Instruction                     string `toml:"instruction"`       // Legacy alias for FrameworkPrompt
	AutoStartOnLaunch               bool   `toml:"auto_start_on_launch"`
	CloseBehavior                   string `toml:"close_behavior"` // "continue" keeps the conversation window in the taskbar; "new_chat" ends the current chat on close
	ReminderAfterIdleSec            int    `toml:"reminder_after_idle_sec"`
	DeactivateAfterIdleSec          int    `toml:"deactivate_after_idle_sec"`
	PipelineFallback                bool   `toml:"pipeline_fallback"` // Deprecated compatibility flag; Voice Agent V2 remains realtime-only
	ShowPrompter                    bool   `toml:"show_prompter"`     // Show live transcript prompter window
	EnableInputTranscript           bool   `toml:"enable_input_transcript"`
	EnableOutputTranscript          bool   `toml:"enable_output_transcript"`
	EnableAffectiveDialog           bool   `toml:"enable_affective_dialog"`
	ThinkingEnabled                 bool   `toml:"thinking_enabled"`
	IncludeThoughts                 bool   `toml:"include_thoughts"`
	ThinkingBudget                  int    `toml:"thinking_budget"`
	ThinkingLevel                   string `toml:"thinking_level"`
	ContextCompressionEnabled       bool   `toml:"context_compression_enabled"`
	ContextCompressionTriggerTokens int64  `toml:"context_compression_trigger_tokens"`
	ContextCompressionTargetTokens  int64  `toml:"context_compression_target_tokens"`
	AutomaticActivityDetection      bool   `toml:"automatic_activity_detection"`
	ActivityHandling                string `toml:"activity_handling"`
	TurnCoverage                    string `toml:"turn_coverage"`
	VADStartSensitivity             string `toml:"vad_start_sensitivity"`
	VADEndSensitivity               string `toml:"vad_end_sensitivity"`
	VADPrefixPaddingMs              int    `toml:"vad_prefix_padding_ms"`
	VADSilenceDurationMs            int    `toml:"vad_silence_duration_ms"`
}

VoiceAgentConfig configures the real-time Voice Agent Mode.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL