BLOCKED: Ada kueri yang sedang diproses dan kueri baru tersebut akan dihapus.
UNKNOWN: Status kueri saat ini tidak dapat ditentukan.
getHeaderHeightPx
getHeaderHeightPx() returns Promise<height>
Menentukan tinggi {i>header<i} di bagian atas tampilan.
Parameter
height
number
Tinggi dalam piksel.
InteractiveCanvasCallbacks
Callback ini memberikan cara bagi Anda untuk merespons informasi atau permintaan
dari tindakan percakapan Anda sementara metode tersebut menyediakan cara untuk
informasi atau permintaan
untuk tindakan percakapan Anda.
onUpdate
onUpdate(data) returns undefined
Dipanggil saat HtmlResponse dikirim dari tindakan percakapan. Sesudah
akhir panggilan fungsi, TTS akan segera dimulai.
Parameter
data
Object
Data yang diperbarui dikirim oleh webhook.
onTtsMark
onTtsMark(markName) returns undefined
Callback yang dipanggil selama pemutaran TTS.
Tanda khusus yang selalu dipicu:
START menunjukkan awal TTS.
END menunjukkan akhir TTS.
ERROR menunjukkan error saat memutar TTS.
Anda juga bisa menentukan tanda khusus menggunakan
SSML
dan tag <mark>, seperti <mark name="custom"/>.
[null,null,["Terakhir diperbarui pada 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. |"]]