mirror of
https://github.com/acon96/home-llm.git
synced 2026-01-09 21:58:00 -05:00
gate startup to prevent loading of broken config entries
This commit is contained in:
@@ -17,6 +17,7 @@ from custom_components.llama_conversation.utils import MalformedToolCallExceptio
|
||||
|
||||
from .entity import LocalLLMEntity, LocalLLMClient, LocalLLMConfigEntry
|
||||
from .const import (
|
||||
CONF_CHAT_MODEL,
|
||||
CONF_PROMPT,
|
||||
CONF_REFRESH_SYSTEM_PROMPT,
|
||||
CONF_REMEMBER_CONVERSATION,
|
||||
@@ -39,6 +40,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: LocalLLMConfigEntry, asy
|
||||
if subentry.subentry_type != conversation.DOMAIN:
|
||||
continue
|
||||
|
||||
if CONF_CHAT_MODEL not in subentry.data:
|
||||
_LOGGER.warning("Conversation subentry %s missing required config key %s, You must delete the model and re-create it.", subentry.subentry_id, CONF_CHAT_MODEL)
|
||||
continue
|
||||
|
||||
# create one agent entity per conversation subentry
|
||||
agent_entity = LocalLLMAgent(hass, entry, subentry, entry.runtime_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user