#Custom sentences and Intents shipped as part of a component?

1 messages · Page 1 of 1 (latest)

thorn bobcat
#

hi - not sure if this belongs here or another channel, but I'm wondering if a component can ship custom sentences and intents as part of that component, and if there are examples of one that does that I could take a look at.

If not, it seems like it would be a desirable thing since curated and well tested dialog and intents could be evolved in the code with the component itself and save a lot of duplication of effort by users. Makes it easier to contribute to them too.

wanton canopy
#

Haven't seen them in terms of being part of the addon/integration itself, but people make blueprints to add sentences and such

thorn bobcat
#

thanks Nick - yeah, I think I've looked at a couple of blueprints, but it seems like being able to make it part of a component would be desirable. My personal use case is extending the voice commands for Lyrion Music Server, but this should apply widely.

wanton canopy
#

Yeah, the benefit of a blueprint is that it allows users to tweak/customize the intents. If it is part of a component there isn't a simple way to do that short of the user writing their own intents to try and work with the service. Maybe in the future the HA team could add something in the framework to directly support intents attached to an addon or integration, but doubt that would happen anytime soon (maybe a feature reqest to put out there?)

thorn bobcat
#

I'd seen references to MA in some posts but thought I'd seen that it was deprecated/broken..? If not, I'll go look into it

#

(or maybe it was some other tool with a similar name)

wanton canopy
#

There was a HACS integration but that was deprecated as MA moved to Core HA

#

the above supports the new core integration in HA

thorn bobcat
#

sounds like the HACS thing was what I read about. I'll look into it now, thanks!

fringe belfry
#

Are you asking as a user or as a (custom) integration developer?

thorn bobcat
#

currently a user, but I'd be interested in contributing to the integration if the core supported such an architecture. Seems like a 3-tier hierarchy (in terms of the way custom sentences and intents are loaded) would be needed where components could extend the ones shipped with core - as users do today - and users build on both.

I assume it would need a different approach to handling the intents.yaml - it would need to be split up and managed in a similar way to custom sentences files, though without the language discriminator. I'm kind of curious why it wasn't done that way already - looks somewhat inconsistent.

fringe belfry
#

I have proposed allowing integrations to register their own sentence matching templates a long time ago. I haven't completely given up on the idea, but the main 2 issues with that approach are these:

  1. There will be conflicts if more than one integration "fight" over the same sentence. In that case, troubleshooting will be nearly impossible. The preferred approach is to allow the user to define their own custom sentences and handle the logic (e.g. what Music Assistant is suggesting)
  2. HA has a rather numerous team of (volunteer) language leaders, who have dedicated communication channels at their disposal to ensure (at least some) sync between languages. Learning the "kinks" of defining good/usable/performant sentences is actually pretty tricky and hard to document, as there are a ton of gotchas. This sort of teaming is impossible to replicate outside the core integrations, which will mean that most custom integrations will register sentences in 1-2-3 languages at best, far from the promise of "controlling HA in your language"
    That said, please be aware that this is not an official viewpoint. I am just a guy who's been around since the beginning of voice functionality, contributing both code and sentences in 2 languages, and who is well aware of the hardship of what that entails