Skip to content

Commit

Permalink
Add device info to Google (#118074)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed May 25, 2024
1 parent da74ac0 commit 4b0f58e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from homeassistant.const import CONF_LLM_HASS_API, MATCH_ALL
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError, TemplateError
from homeassistant.helpers import intent, llm, template
from homeassistant.helpers import device_registry as dr, intent, llm, template
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import ulid

Expand Down Expand Up @@ -111,13 +111,20 @@ class GoogleGenerativeAIConversationEntity(
"""Google Generative AI conversation agent."""

_attr_has_entity_name = True
_attr_name = None

def __init__(self, entry: ConfigEntry) -> None:
"""Initialize the agent."""
self.entry = entry
self.history: dict[str, list[genai_types.ContentType]] = {}
self._attr_name = entry.title
self._attr_unique_id = entry.entry_id
self._attr_device_info = dr.DeviceInfo(
identifiers={(DOMAIN, entry.entry_id)},
name=entry.title,
manufacturer="Google",
model="Generative AI",
entry_type=dr.DeviceEntryType.SERVICE,
)

@property
def supported_languages(self) -> list[str] | Literal["*"]:
Expand Down

0 comments on commit 4b0f58e

Please sign in to comment.