Sendet eine Textabfrage an die Unterhaltungsaktion.
Parameter
textQuery
string
Die Abfrage, die an die Unterhaltungsaktion gesendet werden soll.
state
string
Eines der folgenden Betriebssysteme:
READY: Anfragen können von der Plattform akzeptiert werden.
BLOCKED: Eine Abfrage ist aktiv und die neue Abfrage wird gelöscht.
UNKNOWN: Der aktuelle Abfragestatus konnte nicht ermittelt werden.
getHeaderHeightPx
getHeaderHeightPx() returns Promise<height>
Legt die Höhe der Kopfzeile oben auf einer Anzeige fest.
Parameter
height
number
Die Höhe in Pixeln.
InteractiveCanvasCallbacks
Mit diesen Callbacks kannst du auf Informationen oder Anfragen
aus Ihrer Konversation, während die Methoden eine Möglichkeit bieten,
Informationen oder Anfragen zu Ihrem Gesprächsstil.
onUpdate
onUpdate(data) returns undefined
Wird aufgerufen, wenn eine HtmlResponse aus der Unterhaltungsaktion gesendet wird. Nachher
am Ende des Funktionsaufrufs beginnt, wird die Sprachausgabe sofort gestartet.
Parameter
data
Object
Aktualisierte Daten, die vom Webhook gesendet wurden.
onTtsMark
onTtsMark(markName) returns undefined
Callback, der während der Text-in-Sprache-Wiedergabe aufgerufen wird.
Sonderzeichen, die immer ausgelöst werden:
START gibt den Beginn der Sprachausgabe an.
END kennzeichnet das Ende der Sprachausgabe.
ERROR zeigt einen Fehler bei der Sprachausgabe an.
Sie können benutzerdefinierte Markierungen auch definieren, indem Sie
SSML
und das <mark>-Tag, z. B. <mark name="custom"/>.
Parameter
markName
string
Kennzeichnet den Namen, der während der Sprachausgabe-Wiedergabe aufgerufen wird.
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003eConditional logic in scenes uses values from intent, scene, session, user, home, device, canvas, and resource objects.\u003c/p\u003e\n"],["\u003cp\u003eSupported operations include logical (&&, ||, !), numerical (+, -, *, /), comparison (==, !=, <, <=, >, >=), and operations on lists and maps.\u003c/p\u003e\n"],["\u003cp\u003eBoolean constants \u003ccode\u003etrue\u003c/code\u003e, \u003ccode\u003efalse\u003c/code\u003e, and \u003ccode\u003e!false\u003c/code\u003e are available, and string operations support double or single quotes, substring checks, concatenation, lexicographical comparison, and size calculation.\u003c/p\u003e\n"],["\u003cp\u003eData model objects like \u003ccode\u003eintent\u003c/code\u003e, \u003ccode\u003esession\u003c/code\u003e, and others provide access to various data points for conditional checks, and these values can also be referenced in static prompts.\u003c/p\u003e\n"]]],[],null,["# InteractiveCanvas (Dialogflow)\n\nThe `interactiveCanvas` object is the interface to your conversational action\nthat is made available within your web app.\n| **Note:** The `interactiveCanvas` object is attached to the `window` object. If you are using a front-end framework to develop your web app, you need to ensure that you have access to `window` to set up the API.\n\nMethods\n-------\n\n### ready\n\n ready(callbacks) returns undefined\n\nCalled by the Interactive Canvas web app once it has loaded to register callbacks.\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------|\n| `callbacks` | ` `[InteractiveCanvasCallbacks](#interactivecanvascallbacks)` ` An object that contains method callbacks. |\n\n| **Note:** You must invoke the `ready` API in the web app as soon as the page is loaded. Otherwise, the Action will close.\n\n### sendTextQuery\n\n sendTextQuery(textQuery) returns Promise\u003cstate\u003e\n\nSends a text query to the conversational action.\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `textQuery` | `string` The query to send to the conversational action. |\n| `state` | `string` One of the following: `READY:` Requests can be accepted by the platform. `BLOCKED:` There is a query in flight and the new query will be dropped. `UNKNOWN:` The current query state couldn't be determined. \u003cbr /\u003e |\n\n| **Caution:** `textQuery` must be 640 characters or less.\n\n### getHeaderHeightPx\n\n getHeaderHeightPx() returns Promise\u003cheight\u003e\n\nDetermines the height of the header at the top of a display.\n\n| Parameters ||\n|----------|--------------------------------|\n| `height` | `number` The height in pixels. |\n\nInteractiveCanvasCallbacks\n--------------------------\n\nThese callbacks provide a way for you to respond to information or requests\nfrom your conversational action while the methods provide a way to send\ninformation or requests to your conversational action.\n\n### onUpdate\n\n onUpdate(data) returns undefined\n\nCalled when an `HtmlResponse` is sent from the conversational action. After\nthe end of the function call, the TTS will start immediately.\n\n| Parameters ||\n|--------|--------------------------------------------|\n| `data` | `Object` Updated data sent by the webhook. |\n\n### onTtsMark\n\n onTtsMark(markName) returns undefined\n\nCallback that is invoked during TTS playback.\n\nSpecial marks that always are triggered:\n\n- `START` indicates the start of the TTS.\n- `END` indicates the end of the TTS.\n- `ERROR` indicates an error playing the TTS.\n\nYou can also define custom marks by using\n[SSML](/assistant/actions/reference/ssml)\nand the `\u003cmark\u003e` tag, like `\u003cmark name=\"custom\"/\u003e`.\n| **Note:** SSML marks are not invoked when the following occurs:\n|\n| - Before TTS begins, the user taps the microphone, or the Interactive Canvas client invokes `sendTextQuery`. The TTS is cancelled and any SSML marks in the TTS are ignored.\n| - During TTS, the user taps the microphone, or the Interactive Canvas client invokes `sendTextQuery`. The TTS is interrupted and any remaining SSML marks in the TTS are ignored.\n\n| Parameters ||\n|------------|-------------------------------------------------|\n| `markName` | `string` Mark name invoked during TTS playback. |"]]