Wysyła zapytanie tekstowe do działania konwersacyjnego.
Parametry
textQuery
string
Zapytanie, które ma zostać wysłane do działania konwersacyjnego.
state
string
Jedna z tych wartości:
READY: Prośby mogą być akceptowane przez platformę.
BLOCKED: jest w trakcie wyświetlania zapytanie, w związku z czym nowe zostanie usunięte.
UNKNOWN: Nie udało się określić bieżącego stanu zapytania.
getHeaderHeightPx
getHeaderHeightPx() returns Promise<height>
Określa wysokość nagłówka na górze wyświetlacza.
Parametry
height
number
Wysokość w pikselach.
InteractiveCanvasCallbacks
Dzięki tym wywołaniem możesz odpowiadać na informacje lub prośby
od działań konwersacyjnych, a metody umożliwiają wysyłanie
informacji lub żądań związanych z działaniem konwersacyjnym.
onUpdate
onUpdate(data) returns undefined
Wywoływana, gdy z czynności konwersacyjnej zostanie wysłane żądanie HtmlResponse. Po
na koniec wywołania funkcji, zamiana tekstu na mowę rozpocznie się natychmiast.
Parametry
data
Object
Zaktualizowane dane wysłane przez webhooka.
onTtsMark
onTtsMark(markName) returns undefined
Wywołanie zwrotne wywoływane podczas odtwarzania zamiany tekstu na mowę.
Znaki specjalne, które są zawsze aktywowane:
START wskazuje początek TTS.
END oznacza koniec TTS.
ERROR oznacza błąd zamiany tekstu na mowę.
Znaczniki niestandardowe możesz też zdefiniować za pomocą funkcji
SSML
i tag <mark>, np. <mark name="custom"/>.
[null,null,["Ostatnia aktualizacja: 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. |"]]