core/homeassistant/components/conversation/agent.py

33 lines
852 B
Python
Raw Normal View History

"""Agent foundation for conversation integration."""
2021-03-17 22:43:55 +00:00
from __future__ import annotations
from abc import ABC, abstractmethod
from homeassistant.core import Context
from homeassistant.helpers import intent
class AbstractConversationAgent(ABC):
"""Abstract conversation agent."""
@property
def attribution(self):
"""Return the attribution."""
return None
async def async_get_onboarding(self):
"""Get onboard data."""
2021-09-18 11:52:59 +00:00
# pylint: disable=no-self-use
return None
async def async_set_onboarding(self, shown):
"""Set onboard data."""
2021-09-18 11:52:59 +00:00
# pylint: disable=no-self-use
return True
@abstractmethod
async def async_process(
2021-03-17 22:43:55 +00:00
self, text: str, context: Context, conversation_id: str | None = None
) -> intent.IntentResponse:
"""Process a sentence."""