Not sure this will work completely in developer tools, because it comes in two parts - the slot value { question } is passed from the custom sentence (given above) to the intent script.
The full intent script is:
CustomGoogle:
action:
- choose:
- conditions: "{{ is_state('binary_sensor.online', 'off') }}"
sequence:
- action: script.tts_response
data:
tts_sentence: "Sorry. There's no internet at the moment."
- conditions: "{{ is_state('binary_sensor.online', 'on') }}"
sequence:
- action: script.tts_response
data:
tts_sentence: "I'll check with Google."
- action: conversation.process
data:
agent_id: conversation.google_ai_conversation
text: "{{ question }}"
response_variable: api_response
- variables:
answer: "{{ api_response.response.speech.plain.speech }}"
- action: script.tts_response
data:
tts_sentence: "{{ answer }}"
The first block (“Sorry…” ) allows the script to stop gracefully if there’s no internet and the second block (“I’ll check with Google”) is there because there’s often a long pause before Google responds.
The third block (action.conversation.process) sends the question received from the custom sentence to Google, receives the response and extracts the text part from the api.
script.tts_response plays responses on loudspeakers in whichever room I’m in, rather than on the voice assistant device.
In Developer Tools Action (yaml mode):
action: conversation.process
data:
text: What happened in 1066
language: en
agent_id: conversation.google_ai_conversation
Produces:
response:
speech:
plain:
speech: >-
The year 1066 was a pivotal year in English history, marked by a
succession crisis and the Norman Conquest.
Key events include:
* **January 5th**: Edward the Confessor, King of England, died without
an heir, leaving the succession unclear.
* **January 6th**: Harold Godwinson, Earl of Wessex, was crowned King
Harold the Second of England.
* William, Duke of Normandy, who claimed Edward had promised him the
throne, began preparations for an invasion of England.
* Halley's Comet appeared in February and March, which was seen as a
bad omen by the Anglo-Saxons.
…and a good deal more.
Docs on custom sentences and intents are a bit scattered, but there’s a writeup with examples here:
Custom sentences and intent scripts