Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Action Percakapan memungkinkan Anda memperluas Asisten Google dengan
antarmuka percakapan Anda sendiri yang memberi pengguna akses ke produk dan
layanan Anda. Tindakan memanfaatkan mesin natural language understanding (NLU)
yang canggih dari Asisten untuk memproses dan memahami input natural language,
serta melakukan tugas berdasarkan input tersebut.
Ringkasan
Action Percakapan adalah objek sederhana yang menentukan
titik entri (disebut sebagai pemanggilan) ke dalam percakapan:
Pemanggilan menentukan cara pengguna memberi tahu Asisten bahwa mereka ingin memulai
percakapan dengan salah satu Action Anda. Pemanggilan Action ditentukan oleh
satu intent yang cocok saat pengguna meminta Action tersebut.
Percakapan menentukan cara pengguna berinteraksi dengan Action setelah
dipanggil. Anda akan mem-build percakapan dengan intent, jenis,
adegan, dan perintah.
Selain itu, Action Anda dapat mendelegasikan pekerjaan tambahan ke fulfillment, yang
merupakan layanan web yang berkomunikasi dengan Action Anda melalui webhook. Hal ini memungkinkan Anda melakukan validasi data, memanggil layanan web lainnya, menjalankan logika bisnis, dan banyak lagi.
Anda menggabungkan satu atau beberapa Action, berdasarkan kasus penggunaan yang
penting bagi pengguna, ke dalam penampung logis yang disebut project Action.
Project Action Anda berisi seluruh model pemanggilan (kumpulan
semua pemanggilan), yang memungkinkan pengguna memulai dari tempat logis dalam
model percakapan (semua hal yang dapat dikatakan pengguna dan semua cara
yang dapat dilakukan untuk merespons pengguna).
Gambar 1. Kumpulan Action yang berfungsi sebagai titik entri
ke dalam model percakapan. Intent yang memenuhi syarat untuk pemanggilan
dianggap global.
Pemanggilan
Pemanggilan dikaitkan dengan nama tampilan yang mewakili merek,
nama, atau persona yang memungkinkan pengguna meminta Asisten untuk memanggil Action Anda.
Pengguna dapat menggunakan nama tampilan ini sendiri (yang disebut pemanggilan utama) atau dikombinasikan dengan frasa deep link opsional untuk memanggil Action.
Misalnya, pengguna dapat mengucapkan frasa berikut untuk memanggil tiga Action
terpisah dalam sebuah project dengan nama tampilan "Fakta tentang Google":
"Ok Google, bicara dengan Fakta tentang Google"
"Ok Google, bicara dengan Fakta tentang Google untuk mendapatkan fakta perusahaan"
"Ok Google, bicara dengan Fakta tentang Google untuk mendapatkan fakta sejarah"
Pemanggilan pertama dalam contoh tersebut adalah pemanggilan utama. Pemanggilan
ini dikaitkan dengan intent sistem khusus yang bernama
actions.intent.MAIN. Pemanggilan kedua dan ketiga adalah pemanggilan deep link yang memungkinkan Anda menentukan frasa tambahan yang memungkinkan pengguna meminta fungsi tertentu. Pemanggilan ini berkaitan dengan intent pengguna yang Anda
tetapkan sebagai global. Setiap pemanggilan dalam contoh ini memberikan titik entri ke dalam percakapan dan sesuai dengan satu Action.
Gambar 2. Contoh pemanggilan utama
Gambar 2 menjelaskan alur pemanggilan utama yang umum:
Saat meminta Action, pengguna biasanya meminta Action
berdasarkan nama tampilan Anda.
Asisten mencocokkan permintaan pengguna dengan intent
terkait yang cocok dengan permintaan tersebut. Dalam hal ini, nilainya adalah actions.intent.MAIN.
Action akan diberi tahu tentang kecocokan intent dan merespons dengan
perintah yang sesuai untuk memulai percakapan dengan pengguna.
Percakapan
Percakapan menentukan cara pengguna berinteraksi dengan Action setelah dipanggil. Anda
membangun interaksi ini dengan menentukan input pengguna yang valid untuk
percakapan Anda, logika untuk memproses input tersebut, dan perintah yang sesuai
untuk merespons kembali pengguna. Gambar dan penjelasan berikut menunjukkan
cara kerja pembalikan percakapan standar dengan komponen tingkat rendah
percakapan: intent, jenis, adegan, dan
perintah.
Gambar 3. Contoh percakapan
Gambar 3 menjelaskan arah percakapan yang umum:
Saat pengguna mengatakan sesuatu, NLU Asisten akan mencocokkan input dengan
intent yang sesuai. Intent dicocokkan jika model bahasa untuk
intent tersebut dapat mendekati atau sama persis dengan input pengguna. Anda menentukan model bahasa dengan menentukan frasa pelatihan, atau contoh hal yang mungkin ingin dikatakan pengguna. Asisten mengambil frasa pelatihan ini dan memperluasnya untuk
membuat model bahasa intent.
Saat NLU Asisten cocok dengan intent, NLU Asisten dapat mengekstrak parameter yang
Anda perlukan dari input. Parameter ini memiliki jenis yang terkait dengannya, seperti tanggal atau angka. Anda menganotasi bagian tertentu dari frasa pelatihan intent untuk menentukan parameter yang ingin diekstrak.
Adegan lalu memproses intent yang cocok. Anda dapat menganggap scene sebagai
eksekutor logika Action, melakukan tugas berat, dan menjalankan logika
yang diperlukan untuk memajukan percakapan. Scene berjalan dalam loop, yang menyediakan
siklus proses eksekusi fleksibel yang memungkinkan Anda melakukan berbagai hal seperti memvalidasi parameter
intent, melakukan pengisian slot, mengirim perintah kembali ke pengguna, dan banyak lagi.
Saat selesai dieksekusi, scene biasanya akan mengirimkan pesan kembali kepada pengguna
untuk melanjutkan percakapan atau dapat mengakhiri percakapan jika sesuai.
Pemenuhan pemesanan
Selama pemanggilan atau percakapan, Action Anda dapat memicu webhook yang
memberi tahu layanan fulfillment untuk melakukan beberapa tugas.
Gambar 4. Contoh percakapan
Gambar 4 menjelaskan cara menggunakan fulfillment untuk menghasilkan perintah, cara umum
untuk menggunakan fulfillment:
Pada titik tertentu eksekusi Action Anda dapat memicu webhook
yang mengirimkan permintaan ke pengendali webhook terdaftar (layanan
fulfillment Anda) dengan payload JSON.
Fulfillment akan memproses permintaan, seperti memanggil REST API untuk melakukan
pencarian data atau memvalidasi beberapa data dari payload JSON. Cara yang sangat umum
untuk menggunakan fulfillment adalah dengan membuat perintah dinamis saat runtime sehingga
percakapan Anda lebih disesuaikan dengan pengguna saat ini.
Fulfillment Anda menampilkan respons kembali ke Action Anda yang berisi payload
JSON. Layanan dapat menggunakan data dari payload untuk melanjutkan eksekusinya dan
merespons pengguna.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-26 UTC."],[[["\u003cp\u003eConversational Actions extend Google Assistant, letting you create conversational interfaces for your services using natural language understanding.\u003c/p\u003e\n"],["\u003cp\u003eActions are invoked by users through specific phrases, triggering a conversation flow defined by intents, types, scenes, and prompts.\u003c/p\u003e\n"],["\u003cp\u003eFulfillment webhooks can be used to enhance Actions by validating data, calling external services, and generating dynamic prompts during conversations.\u003c/p\u003e\n"],["\u003cp\u003eActions are grouped within an Actions project which manages the invocation model and overall conversation flow.\u003c/p\u003e\n"]]],["Conversational Actions enable interactions with Google Assistant via natural language. Users initiate these interactions through **invocations**, using a display name or deep links. **Conversations** follow, where Assistant's NLU matches user input to **intents**, extracting **parameters**. **Scenes** then process these intents, executing logic and sending **prompts**. **Fulfillment** services handle tasks like data validation or dynamic prompt generation through webhooks, allowing actions to interact with web services and tailor responses. An **Actions project** bundles actions together.\n"],null,["# Conversational Actions let you extend Google Assistant with your own\nconversational interfaces that give users access to your products and\nservices. Actions leverage Assistant's powerful natural language\nunderstanding (NLU) engine to process and understand natural language input\nand carry out tasks based on that input.\n\nOverview\n--------\n\nA Conversational Action is a simple object that defines an\nentry point (referred to as invocation) into a conversation:\n\n- An **invocation** defines how users tell Assistant they want to start a conversation with one of your Actions. An Action's invocation is defined by a single [intent](/assistant/conversational/intents) that gets matched when users request the Action.\n- A **conversation** defines how users interact with an Action after it's invoked. You build conversations with [intents](/assistant/conversational/intents), [types](/assistant/conversational/types), [scenes](/assistant/conversational/scenes), and [prompts](/assistant/conversational/prompts).\n- In addition, your Actions can delegate extra work to **fulfillment**, which are web services that communicate with your Actions via webhooks. This lets you do data validation, call other web services, carry out business logic, and more.\n\nYou bundle one or many Actions together, based on the use cases that are\nimportant for your users, into a logical container called an Actions project.\nYour Actions project contains your entire invocation model (the collection of\nall your invocations), which lets users start at logical places in your\nconversation model (all the possible things users can say and all the possible\nways you respond back to users).\n**Figure 1** . A collection of Actions that serve as entry points into a conversation model. Intents that are eligible for invocation are considered to be *global*.\n\nInvocation\n----------\n\nInvocation is associated with a **display name** that represents a brand,\nname, or persona that lets users ask Assistant to invoke your Actions.\nUsers can use this display name on its own (called the main invocation) or in\ncombination with optional, **deep link** phrases to invoke your Actions.\n\nFor example, users can say the following phrases to invoke three separate\nActions in an project with a display name of \"Facts about Google\":\n\n- *\"Ok Google, talk to Facts about Google\"*\n- *\"Ok Google, talk to Facts about Google to get company facts\"*\n- *\"Ok Google, talk to Facts about Google to get history facts\"*\n\nThe first invocation in the example is the **main invocation** . This\ninvocation is associated with a special system intent named\n`actions.intent.MAIN`. The second and third invocations are deep link\ninvocations that let you specify additional phrases that let users ask for\nspecific functionality. These invocations correspond to user intents that you\ndesignated as global. Each invocation in this example provides an entry point\ninto a conversation and corresponds to a single Action.\n**Figure 2**. Example of main invocation\n\nFigure 2 describes a typical main invocation flow:\n\n1. When users request an Action, they typically ask Assistant for it by your display name.\n2. Assistant matches the user's request with the corresponding intent that matches the request. In this case, it would be `actions.intent.MAIN`.\n3. The Action is notified of the intent match and responds with the corresponding prompt to start a conversation with the user.\n\nConversation\n------------\n\nConversation defines how users interact with an Action after it's invoked. You\nbuild these interactions by defining the valid user input for your\nconversation, the logic to process that input, and the corresponding prompts\nto respond back to the user with. The following figure and explanation shows\nyou how a typical conversation turn works with a conversation's low level\ncomponents: [intents](/assistant/conversational/intents), [types](/assistant/conversational/types), [scenes](/assistant/conversational/scenes), and\n[prompts](/assistant/conversational/prompts).\n**Figure 3**. Example of a conversation\n\nFigure 3 describes a typical conversation turn:\n\n1. When users say something, the Assistant NLU matches the input to an appropriate intent. An intent is matched if the *language model* for that intent can closely or exactly match the user input. You define the language model by specifying *training phrases*, or examples of things users might want to say. Assistant takes these training phrases and expands upon them to create the intent's language model.\n2. When the Assistant NLU matches an intent, it can extract *parameters* that you need from the input. These parameters have *types* associated with them, such as a date or number. You annotate specific parts of an intent's training phrases to specify what parameters you want to extract.\n3. A *scene* then processes the matched intent. You can think of scenes as the logic executors of an Action, doing the heavy lifting and carrying out logic necessary to drive a conversation forward. Scenes run in a loop, providing a flexible execution lifecycle that lets you do things like validate intent parameters, do slot filling, send prompts back to the user, and more.\n4. When a scene is done executing, it typically sends a prompt back to users to continue the conversation or can end the conversation if appropriate.\n\nFulfillment\n-----------\n\nDuring invocation or a conversation, your Action can trigger a webhook that\nnotifies a fulfillment service to carry out some tasks.\n**Figure 4**. Example of a conversation\n\nFigure 4 describes how you can use fulfillment to generate prompts, a common\nway to use fulfillment:\n\n1. At specific points of your Action's execution, it can trigger a webhook that sends a request to a registered webhook handler (your fulfillment service) with a JSON payload.\n2. Your fulfillment processes the request, such as calling a REST API to do some data lookup or validating some data from the JSON payload. A very common way to use fulfillment is to generate a dynamic prompt at runtime so your conversations are more tailored to the current user.\n3. Your fulfillment returns a response back to your Action containing a JSON payload. It can use the data from the payload to continue it's execution and respond back to the user."]]