mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-28 01:54:00 +08:00
refactor: Phase 0 — extract utils.py and providers.py, centralize provider dispatch
- Create utils.py: normalize_name, get_file_hash, safe_log_data - Create providers.py: PROVIDER_REGISTRY with get_default_endpoint, get_default_model, build_auth_headers - Add DEFAULT_ANTHROPIC_MODEL constant (was incorrectly using gpt-4o-mini) - Replace all inline dispatch tables in config_flow.py and __init__.py - Fix circular import: coordinator.py now imports from utils, not config_flow - Fix NameError in error paths: replace bare constant refs with provider functions - Raise ValueError for unknown providers instead of silent OpenAI fallback
This commit is contained in:
@@ -76,6 +76,7 @@ ICONS_SUBDOMAIN = "icons"
|
||||
|
||||
# Default values
|
||||
DEFAULT_MODEL: Final = "gpt-4o-mini"
|
||||
DEFAULT_ANTHROPIC_MODEL: Final = "claude-3-5-sonnet"
|
||||
DEFAULT_DEEPSEEK_MODEL: Final = "deepseek-chat"
|
||||
DEFAULT_GEMINI_MODEL: Final = "gemini-2.0-flash"
|
||||
DEFAULT_TEMPERATURE: Final = 0.1
|
||||
|
||||
Reference in New Issue
Block a user