#Intent Script for input_number

1 messages ยท Page 1 of 1 (latest)

solid inlet
#

I am trying to make custom_sentences and intent_scripts for increment/decrement/set them through voice.
Till now i have been able to increase/decrease them by step size ๐Ÿ™‚

How to add increment by 'X' command ( docs arent super clear about all those brackets () [] <> )

here are the files:

input_number_IncrementInputNumber.yaml

language: "en"
intents:
  IncrementInputNumber:
    data:
      - sentences:
          - "(increment|increase|raise) <name>"
        requires_context:
          domain: input_number

IncrementInputNumber.yaml

action:
  - service: input_number.increment
    target:
      entity_id: "{{ targets.entities }}"

speech:
  text: >
    {% set verbs = ['Incremented', 'Increased', 'Raised'] %}
    {% set verb = verbs | random %}
    {% if targets.entities | length == 1 %}
      {{ verb }} It!
    {% elif targets.entities | length == 2 %}
          {{ verb }} both
    {% else %}
      {{ verb }} {{ targets.entities | length }} entities
    {% endif %}

Similar for decrement.

ornate crescent
#

Seems to look correct, what problem are you having?

solid inlet
ornate crescent
#

Oh using speech to phrase, I haven't touched that as I run whisper locally, so not sure how to help there ๐Ÿ˜…

#

but as far as your first question, you'd probably need to create a slot/list for the {x} part

solid inlet
ornate crescent
#

Why run both? ๐Ÿ˜ฎ

solid inlet
#

STP trains on current HA data, so it straight away rejects other contextual commands. ( Returning no text )

#

And pipeline stop, meaning LLM isn't invoked since there is no text.

solid inlet
ornate crescent
#

huh, thing is setting prefer local first on your pipeline achieves this same effect

#

so I have LLM and I have prefer local, so if I say "turn on the lights" that just goes to HASSIL and not my LLM. But if I say "Turn on the lights and tell me the weather" then that gets forwarded to the LLM since there's no intent like that to match.

solid inlet
#

Yeah but key difference being local agent is HA(using HASSIL) it will not use STP(trained for my exact home) in its place.

#

๐Ÿ˜… Also that locally handle will not have any effect when you use STP for STT as there will be no output text ( refer diagram) hence pipeline is broken

solid inlet
ornate crescent
#

Yeah, I assume you'd want it to fallback to the LLM..? I guess my confusion was that if you are running whisper there's not much reason to run STP. But maybe the part I am missing is, are you running whisper with GPU acceleration or on CPU? If it's CPU it makes more sense why you would want to use STP since it would be considerably faster and more precise than running something like the medium whisper model on CPU.

solid inlet
#

Yeah what you are saying is correct about the cpu situation. I am running on cpu so whisper takes ~3sec and STP is in mili-sec range. But i am not sure what you mean by this Yeah, I assume you'd want it to fallback to the LLM..? , are you refering to whisper as LLM ? bcz if we consider layer 1, 2 & 3 as STT, LLM and TTS resp.. I am talking about fallback in Layer 1.

ornate crescent
#

so I mean I assume if your local intent isn't recognized, you'd want your request to go to the LLM next

#

the only thing that has fallback is intent vs LLM ๐Ÿ˜…

#

LLM being your large language model, whisper isn't an LLM

#

I think i get where you are coming from, I guess I didn't really think about it when you said you are running whisper because I am running whisper locally with GPU acceleration and get 150-200ms responses with the large-v3 model ๐Ÿ˜…

#

so no need for STP from that perspective

#

And yeah based on how STP doesn't return anything if there's no match, that of course will never fall back to LLM, since all the STP phrases are basically direct intent phrase matches that should always be caught by local processing.