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

Namespaces

 agent_manager
 
 const
 
 default_agent
 
 entity
 
 http
 
 models
 
 trace
 
 trigger
 
 util
 

Functions

AgentInfo|None async_get_agent_info (HomeAssistant hass, str|None agent_id=None)
 
set[str]|Literal["*"] async_get_conversation_languages (HomeAssistant hass, str|None agent_id=None)
 
intent.IntentResponse|None async_handle_intents (HomeAssistant hass, ConversationInput user_input)
 
str|None async_handle_sentence_triggers (HomeAssistant hass, ConversationInput user_input)
 
None async_prepare_agent (HomeAssistant hass, str|None agent_id, str language)
 
None async_set_agent (HomeAssistant hass, ConfigEntry config_entry, AbstractConversationAgent agent)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 
None async_unset_agent (HomeAssistant hass, ConfigEntry config_entry)
 

Variables

list __all__
 
 _LOGGER = logging.getLogger(__name__)
 
 CONFIG_SCHEMA
 
 REGEX_TYPE = type(re.compile(""))
 
 SERVICE_PROCESS_SCHEMA
 
 SERVICE_RELOAD_SCHEMA
 

Detailed Description

Support for functionality to have conversations with Home Assistant.

Function Documentation

◆ async_get_agent_info()

AgentInfo | None homeassistant.components.conversation.async_get_agent_info ( HomeAssistant  hass,
str | None   agent_id = None 
)
Get information on the agent or None if not found.

Definition at line 173 of file __init__.py.

◆ async_get_conversation_languages()

set[str] | Literal["*"] homeassistant.components.conversation.async_get_conversation_languages ( HomeAssistant  hass,
str | None   agent_id = None 
)
Return languages supported by conversation agents.

If an agent is specified, returns a set of languages supported by that agent.
If no agent is specified, return a set with the union of languages supported by
all conversation agents.

Definition at line 127 of file __init__.py.

◆ async_handle_intents()

intent.IntentResponse | None homeassistant.components.conversation.async_handle_intents ( HomeAssistant  hass,
ConversationInput   user_input 
)
Try to match input against registered intents and return response.

Returns None if no match occurred.

Definition at line 223 of file __init__.py.

◆ async_handle_sentence_triggers()

str | None homeassistant.components.conversation.async_handle_sentence_triggers ( HomeAssistant  hass,
ConversationInput   user_input 
)
Try to match input against sentence triggers and return response text.

Returns None if no match occurred.

Definition at line 210 of file __init__.py.

◆ async_prepare_agent()

None homeassistant.components.conversation.async_prepare_agent ( HomeAssistant  hass,
str | None  agent_id,
str   language 
)
Prepare given agent.

Definition at line 198 of file __init__.py.

◆ async_set_agent()

None homeassistant.components.conversation.async_set_agent ( HomeAssistant  hass,
ConfigEntry  config_entry,
AbstractConversationAgent  agent 
)
Set the agent to handle the conversations.

Definition at line 107 of file __init__.py.

◆ async_setup()

bool homeassistant.components.conversation.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Register the process service.

Definition at line 236 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.conversation.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up a config entry.

Definition at line 296 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.conversation.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 301 of file __init__.py.

◆ async_unset_agent()

None homeassistant.components.conversation.async_unset_agent ( HomeAssistant  hass,
ConfigEntry  config_entry 
)
Set the agent to handle the conversations.

Definition at line 118 of file __init__.py.

Variable Documentation

◆ __all__

list homeassistant.components.conversation.__all__
private
Initial value:
1 = [
2  "DOMAIN",
3  "HOME_ASSISTANT_AGENT",
4  "OLD_HOME_ASSISTANT_AGENT",
5  "ConversationEntity",
6  "ConversationEntityFeature",
7  "ConversationInput",
8  "ConversationResult",
9  "ConversationTraceEventType",
10  "async_conversation_trace_append",
11  "async_converse",
12  "async_get_agent_info",
13  "async_set_agent",
14  "async_setup",
15  "async_unset_agent",
16 ]

Definition at line 53 of file __init__.py.

◆ _LOGGER

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

Definition at line 70 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.conversation.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(DOMAIN): vol.Schema(
4  {
5  vol.Optional("intents"): vol.Schema(
6  {cv.string: vol.All(cv.ensure_list, [cv.string])}
7  )
8  }
9  )
10  },
11  extra=vol.ALLOW_EXTRA,
12 )

Definition at line 91 of file __init__.py.

◆ REGEX_TYPE

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

Definition at line 72 of file __init__.py.

◆ SERVICE_PROCESS_SCHEMA

homeassistant.components.conversation.SERVICE_PROCESS_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(ATTR_TEXT): cv.string,
4  vol.Optional(ATTR_LANGUAGE): cv.string,
5  vol.Optional(ATTR_AGENT_ID): agent_id_validator,
6  vol.Optional(ATTR_CONVERSATION_ID): cv.string,
7  }
8 )

Definition at line 74 of file __init__.py.

◆ SERVICE_RELOAD_SCHEMA

homeassistant.components.conversation.SERVICE_RELOAD_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(ATTR_LANGUAGE): cv.string,
4  vol.Optional(ATTR_AGENT_ID): agent_id_validator,
5  }
6 )

Definition at line 84 of file __init__.py.