Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.conversation.default_agent Namespace Reference

Classes

class  DefaultAgent
 
class  IntentCache
 
class  IntentCacheKey
 
class  IntentCacheValue
 
class  IntentMatchingStage
 
class  LanguageIntents
 
class  SentenceTriggerResult
 
class  TriggerData
 

Functions

None _collect_list_references (Expression expression, set[str] list_names)
 
Iterable[str] _get_language_variations (str language)
 
tuple[ErrorKey, dict[str, Any]] _get_match_error_response (core.HomeAssistant hass, intent.MatchFailedError match_error)
 
tuple[ErrorKey, dict[str, Any]] _get_unmatched_response (RecognizeResult result)
 
ConversationResult _make_error_result (str language, intent.IntentResponseErrorCode error_code, str response_text, str|None conversation_id=None)
 
None async_setup_default_agent (core.HomeAssistant hass, EntityComponent[ConversationEntity] entity_component, dict[str, Any] config_intents)
 
JsonObjectType json_load (IO[str] fp)
 

Variables

string _DEFAULT_ERROR_TEXT = "Sorry, I couldn't understand that"
 
list _ENTITY_REGISTRY_UPDATE_FIELDS = ["aliases", "name", "original_name"]
 
 _LOGGER = logging.getLogger(__name__)
 
 ERROR_SENTINEL = object()
 
string METADATA_CUSTOM_FILE = "hass_custom_file"
 
string METADATA_CUSTOM_SENTENCE = "hass_custom_sentence"
 
 REGEX_TYPE = type(re.compile(""))
 
 TRIGGER_CALLBACK_TYPE
 

Detailed Description

Standard conversation implementation for Home Assistant.

Function Documentation

◆ _collect_list_references()

None homeassistant.components.conversation.default_agent._collect_list_references ( Expression  expression,
set[str]  list_names 
)
private
Collect list reference names recursively.

Definition at line 1551 of file default_agent.py.

◆ _get_language_variations()

Iterable[str] homeassistant.components.conversation.default_agent._get_language_variations ( str  language)
private
Generate language codes with and without region.

Definition at line 185 of file default_agent.py.

◆ _get_match_error_response()

tuple[ErrorKey, dict[str, Any]] homeassistant.components.conversation.default_agent._get_match_error_response ( core.HomeAssistant  hass,
intent.MatchFailedError  match_error 
)
private
Return key and template arguments for error when target matching fails.

Definition at line 1417 of file default_agent.py.

◆ _get_unmatched_response()

tuple[ErrorKey, dict[str, Any]] homeassistant.components.conversation.default_agent._get_unmatched_response ( RecognizeResult  result)
private
Get key and template arguments for error when there are unmatched intent entities/slots.

Definition at line 1369 of file default_agent.py.

◆ _make_error_result()

ConversationResult homeassistant.components.conversation.default_agent._make_error_result ( str  language,
intent.IntentResponseErrorCode  error_code,
str  response_text,
str | None   conversation_id = None 
)
private
Create conversation result with error code and text.

Definition at line 1357 of file default_agent.py.

◆ async_setup_default_agent()

None homeassistant.components.conversation.default_agent.async_setup_default_agent ( core.HomeAssistant  hass,
EntityComponent[ConversationEntity entity_component,
dict[str, Any]  config_intents 
)
Set up entity registry listener for the default agent.

Definition at line 200 of file default_agent.py.

◆ json_load()

JsonObjectType homeassistant.components.conversation.default_agent.json_load ( IO[str]  fp)
Wrap json_loads for get_intents.

Definition at line 81 of file default_agent.py.

Variable Documentation

◆ _DEFAULT_ERROR_TEXT

string homeassistant.components.conversation.default_agent._DEFAULT_ERROR_TEXT = "Sorry, I couldn't understand that"
private

Definition at line 68 of file default_agent.py.

◆ _ENTITY_REGISTRY_UPDATE_FIELDS

list homeassistant.components.conversation.default_agent._ENTITY_REGISTRY_UPDATE_FIELDS = ["aliases", "name", "original_name"]
private

Definition at line 69 of file default_agent.py.

◆ _LOGGER

homeassistant.components.conversation.default_agent._LOGGER = logging.getLogger(__name__)
private

Definition at line 67 of file default_agent.py.

◆ ERROR_SENTINEL

homeassistant.components.conversation.default_agent.ERROR_SENTINEL = object()

Definition at line 78 of file default_agent.py.

◆ METADATA_CUSTOM_FILE

string homeassistant.components.conversation.default_agent.METADATA_CUSTOM_FILE = "hass_custom_file"

Definition at line 76 of file default_agent.py.

◆ METADATA_CUSTOM_SENTENCE

string homeassistant.components.conversation.default_agent.METADATA_CUSTOM_SENTENCE = "hass_custom_sentence"

Definition at line 75 of file default_agent.py.

◆ REGEX_TYPE

homeassistant.components.conversation.default_agent.REGEX_TYPE = type(re.compile(""))

Definition at line 71 of file default_agent.py.

◆ TRIGGER_CALLBACK_TYPE

homeassistant.components.conversation.default_agent.TRIGGER_CALLBACK_TYPE
Initial value:
1 = Callable[
2  [str, RecognizeResult, str | None], Awaitable[str | None]
3 ]

Definition at line 72 of file default_agent.py.