Creating a wildcard intent for all sentences?

I’m creating my own chatGPT based voice assistant in node red, and I want to connect it to assist.
I was able to trigger it using the sentence node in node red with “{question}” as the sentence template, so it triggers for all assist sentences, but there is no way to send a response once it is done running.
I tried to create the same sentence intent in the configuration.yaml, so I can maybe use the intent script to wait for chatGPT to respond and relay the answer back to assist, but it did not work.

Any idea on how to achieve that?

It can be done in the HA config like so.
Sentence:

language: "en"
intents:
  AskTheRobot:
    data:
      - sentences:
          - "{question}"
lists:
  question:
    wildcard: true

Then for an intent script do the following:

AskTheRobot:
  action:
    - service: conversation.process
      data:
        agent_id: <your conversation agent id>
        text: '{{question}}'
        language: en
      response_variable: answer
    - stop: ""
      response_variable: answer
  speech:
    text: "{{ action_response.response.speech.plain.speech }}"

This worked for me when I tested it just now. Not sure if this will help you since I don’t use Node Red and never have, but this at least works in HA.

1 Like

It worked!
I tried it but messed up the wildcard definition.

Thanks!

Hey glad it works!

While I was messing with mine (previously the sentence had been prefaced with ‘Ask the robot {question}’ and just left it at {question} it initially appeared that my assistant would use the Home Assistant agent for sentences that I configured in yaml, then fall back to my local LLM for everything else. But after testing it more that does not seem to be the case, it just sends everything to the local LLM, which is not quite there yet in terms of controlling everything in my home.

Now I’m looking for a way to have it try Home Assistant first, then fall back for all others.

Can you share an example of your node red nodes for this? I’ve been trying to get this to work, but I don’t quite understand how the intent script works to create the node red part correctly.