#Correct path for custom Speech-to-phrase sentences?

1 messages ยท Page 1 of 1 (latest)

dim blaze
#

Hi everyone, while starting to experiment with custom sentences for STP, I saw that the existing documentation mentions two different places for where to store those yaml files.

  1. https://github.com/OHF-voice/speech-to-phrase?tab=readme-ov-file#custom-sentences links to https://www.home-assistant.io/voice_control/custom_sentences_yaml/#setting-up-sentences-in-the-config-directory where I'm being told to put things into the config directory
  2. the documentation within the addon in HA mentions the share directory, so /share/speech-to-phrase/custom_sentences/<language>/sentences.yaml

Which one is the correct one? Or are both taken into account? And if it's the latter: is there a priority? ๐Ÿ™‚

Thanks in advance

GitHub

Fast and personalized local speech-to-text. Contribute to OHF-Voice/speech-to-phrase development by creating an account on GitHub.

Home Assistant

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

dawn marsh
#

These are different things, just a coincidence in names. Use the information from the add-on documentation.

dim blaze
dawn marsh
dim blaze
#

The information provided across various places is simply not conclusive. And now that I looked into it again: even within the addon itself it sends me in 2 different directions:

#

...which shows this link for custom sentences:

#

But if I stay on the addon page in HA and click on "Documentation", I get this text which mentions the /share/ URL

#

And to make it more complicated, the "custom sentences" link in that same line again links to the documentation that ends at the config directory

dim blaze
#

Ohhhhh, I think we had a missunderstanding. You meant "custom sentences" as being two things with the same name, right? I thought it was about "speech to phrase" in general ๐Ÿ™‚

With that in mind I'm puzzling this here together:

  • I need to add custom sentences to the /share/ folder to enable STP to even detect a new phrase at all
  • I can add the same custom sentence to the config folder if I want to create a dedicated intent for it as well
  • if I don't need a full-blown intent, but just want to trigger something based on a new sentence, then adding it to the /share/ folder is enough to make it available to e.g. use it in an automation directly
#

is that correct?

dawn marsh
#

first, add a standard set to work with the built-in intents.https://github.com/OHF-Voice/speech-to-phrase/blob/main/speech_to_phrase/sentences/en.yaml . These are not custom sentences, just a list of possible requests that can be recognized. If you create your own intents (custom sentences) in the GUI or via YAML, you must add their trigger phrases to the list for the StP to recognize them. This is exactly what the phrase "You can add custom sentences to /share/speech-to-phrase/custom_sentences/<language>/sentences.yaml" should tell you. I agree - it can be confusing for beginners.

dim blaze
#

Thanks for bearing with me on this. Do you by any chance have a good example file for the sentences yaml, so without intents?

dim blaze
#

Okay, scratch that, your link was already there. thanks again ๐Ÿ™‚