Beberapa produk dan fitur sedang dalam proses penggantian nama. Fitur playbook dan alur generatif juga dimigrasikan ke satu konsol gabungan. Lihat detailnya.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Panduan ini menunjukkan cara mem-build dan menguji agen pemesanan kemeja sederhana menggunakan playbook.
Saat berinteraksi dengan agen ini,
Anda dapat menanyakan lokasi toko,
mendapatkan jam buka toko,
atau melakukan pemesanan kemeja.
Sebelum memulai
Anda harus melakukan hal berikut sebelum membaca panduan ini:
Jika Anda belum melakukannya, ikuti petunjuk
penyiapan.
Tentang playbook
Agen terdiri dari satu atau beberapa playbook.
Setiap playbook memiliki cakupan yang jelas dan terbatas.
Playbook memiliki data berikut:
X
Item
Nama
Nama yang digunakan untuk mengidentifikasi playbook.
Sasaran
Sasaran adalah deskripsi tingkat tinggi tentang hal yang harus dicapai playbook.
Petunjuk
Petunjuk adalah langkah-langkah tingkat tinggi yang harus dilakukan untuk mencapai sasaran playbook.
Contoh
Contoh adalah contoh percakapan antara pengguna akhir dan agen. Contoh ini secara efektif merupakan contoh perintah few-shot untuk LLM.
Antarmuka pengguna akan mengarahkan Anda ke playbook default
yang bernama Default Generative Playbook.
Klik tombol kembali untuk melihat daftar playbook.
Membuat playbook pesanan
Playbook Pesanan menangani pesanan kaos.
Untuk membuat playbook ini:
Klik Buat.
Pilih opsi Playbook tugas.
Masukkan nama playbook: Order.
Masukkan sasaran berikut:
You are a shirt store ordering assistant. Help customers purchase shirts.
Help the customer choose a size and color.
The shirts come in small, medium, and large.
The shirts can be red, green, or blue.
Masukkan petunjuk berikut:
- If the customer has not provided a size, ask them to choose a size.
- If the customer has not provided a color, ask them to choose a color.
- Once the customer has selected a size and color for the shirt,
repeat the selection to the customer, and ask them to confirm the selection.
- Once the customer has confirmed their selection,
let them know that the shirt is now ordered.
- Do not provide prices or collect payment.
- Do not collect the customer's name or address.
Klik Simpan.
Klik tombol kembali untuk kembali ke daftar playbook.
Membuat playbook informasi
Playbook Informasi menangani pertanyaan tentang toko.
Untuk membuat playbook ini:
Klik Buat.
Pilih opsi Playbook tugas.
Masukkan nama playbook: Information.
Masukkan sasaran berikut:
You provide information about a shirt store.
The store is open between 8 AM and 6 PM every day.
The store is located at 1007 Mountain Drive, Gotham City, NJ.
Masukkan petunjuk berikut:
- If the customer asks for the store location, provide them with the address.
- If the customer asks for the store hours, provide them with the hours.
Klik Simpan.
Klik tombol kembali untuk kembali ke daftar playbook.
Memperbarui playbook default
Saat pertama kali membuat aplikasi,
playbook default telah dibuat untuk Anda.
Playbook ini harus mengarahkan percakapan
ke playbook yang sesuai dengan sasaran tertentu.
Dalam petunjuk di bawah,
Anda dapat melihat cara playbook default mereferensikan playbook lainnya.
Untuk memperbarui playbook ini:
Klik playbook default. Playbook ini memiliki bintang yang ditandai.
Masukkan sasaran berikut:
You are an assistant for a shirt store.
Your name is "Samantha".
Your job is to direct customers to other playbooks based on the customer's questions.
Masukkan petunjuk berikut:
- If the customer hasn't been greeted yet, greet the customer,
introduce yourself, and ask the user how you can help.
- If the customer wants information about the store,
route them to ${PLAYBOOK: Information}
- If the customer wants to purchase a shirt,
route them to ${PLAYBOOK: Order}
Klik Simpan.
Perhatikan bahwa referensi playbook ditandai karena belum ada contoh.
Keduanya akan ditambahkan di bagian berikutnya.
Klik tombol kembali untuk kembali ke daftar playbook.
Memberikan contoh
Pada tahap ini,
playbook Anda sudah berfungsi.
Namun, Anda harus memberikan
contoh
untuk memastikan respons yang berkualitas.
Anda dapat memberikan contoh secara manual dari tab Contoh saat playbook terbuka.
Namun, sering kali lebih mudah untuk melakukan percakapan dengan
playbook yang berfungsi dan menyimpan percakapan tersebut sebagai contoh.
Contoh percakapan dengan playbook default bersifat singkat.
Playbook ini hanya perlu mengarahkan Anda ke playbook lain.
Untuk melakukan percakapan dengan playbook default:
Menutup atau membatalkan panel apa pun yang mungkin ada di sisi kanan layar.
Klik tombol question_answer simulator di navigasi baris atas.
Untuk resource, pilih playbook default.
Gunakan model default atau pilih alternatif.
Di kotak teks yang bertuliskan Enter user input,
ketikkan Hello, lalu tekan enter.
Playbook akan merespons dengan sapaan.
Untuk menyimpan percakapan ini sebagai contoh:
Pilih playbook default di dropdown Invocations.
Klik tombol Simpan sebagai contoh di dekat kanan atas antarmuka.
Panel editor contoh akan terbuka.
Anda dapat menggunakan editor ini untuk menambahkan, mengedit, menghapus, atau mengurutkan ulang tindakan.
Berikan nama contoh: Greeting.
Perbarui respons playbook sesuai kebutuhan.
Scroll ke bawah ke Contoh akhir dengan informasi output
dan masukkan The user is greeted. di bagian Ringkasan.
Klik ikon simpan.
Tambahkan contoh lokasi untuk playbook informasi:
Menutup atau membatalkan panel apa pun yang mungkin ada di sisi kanan layar.
Jika perlu, reset percakapan dengan
tombol reset restart_alt.
Pilih playbook informasi di dropdown Start Resource simulator.
Masukkan pesan: Where are you located?.
Playbook akan merespons dengan lokasi.
Pilih playbook informasi di dropdown Invocations.
Klik tombol Simpan sebagai contoh.
Berikan nama contoh: Location.
Sebelum menyimpan percakapan ini sebagai contoh,
Anda harus menghapus tindakan yang berisi "Di mana Anda berada".
Hanya contoh playbook default yang dapat dimulai dengan tindakan pengguna.
Untuk memberikan contoh dengan konteks yang memulai percakapan,
luaskan bagian Ringkasan percakapan sebelumnya...
dan masukkan kode berikut
di kolom Memulai contoh dengan informasi input:
The customer asked "Where are you located?".
Untuk memberikan contoh dengan konteks yang melengkapi percakapan,
luaskan bagian Ringkasan eksekusi playbook...
dan masukkan kode berikut
di kolom Akhiri contoh dengan informasi output:
The store is located at 1007 Mountain Drive, Gotham City, NJ..
Klik ikon simpan.
Tambahkan contoh jam buka untuk playbook informasi:
Serupa dengan langkah-langkah di atas,
tetapi masukkan pesan: What are your hours? dan
beri nama contoh: Hours.
Tambahkan contoh pilihan untuk playbook urutan:
Mirip dengan langkah-langkah di atas,
tetapi beri nama contoh Selection,
pilih playbook urutan,
dan kirim pesan berikut:
I want to buy a shirt
Large
Green
Yes
Menguji agen
Agen Anda kini siap diuji.
Buka panel simulator
dan lakukan percakapan dengan agen.
Anda tidak perlu melakukan percakapan yang sama seperti di atas.
Misalnya,
Anda dapat bertanya kepada agen ini warna apa yang tersedia untuk kemeja.
Jika Anda tidak mendapatkan perilaku yang diinginkan,
meningkatkan kualitas contoh dan membuat contoh baru akan meningkatkan respons.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-18 UTC."],[[["\u003cp\u003eThis guide provides instructions on how to create a shirt ordering agent using playbooks, enabling it to handle requests for store information and shirt orders.\u003c/p\u003e\n"],["\u003cp\u003ePlaybooks are defined by their name, goal, instructions, and examples, and they allow for a structured approach to handling specific tasks within the agent's scope.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating separate playbooks for ordering (Order), providing information (Information), and directing conversations (Default Generative Playbook), and each of these playbooks are to be configured with specific goals and instructions.\u003c/p\u003e\n"],["\u003cp\u003eExamples, which are sample conversations, are crucial for improving the quality of the agent's responses and can be added manually or by saving conversations from the simulator.\u003c/p\u003e\n"],["\u003cp\u003eThe agent can be tested within the simulator interface, and the ability to improve the responses are done through refining the provided examples.\u003c/p\u003e\n"]]],[],null,["# Build an agent using playbooks\n\nThis guide shows you how to build and test a simple shirt ordering\nagent using playbooks.\nWhen interacting with this agent,\nyou can ask for the store location,\nget store hours,\nor make a shirt order.\n\nBefore you begin\n----------------\n\nYou should do the following before reading this guide:\n\n1. If you have not already, follow the [setup](/dialogflow/cx/docs/quick/setup) instructions.\n\nAbout playbooks\n---------------\n\nAn agent is composed of one or more playbooks.\nEach playbook has a clearly defined and limited scope.\nA playbook has the following data:\n\nCreate the agent\n----------------\n\nTo create the agent:\n\n1. Go to the Conversational Agents console:\n\n [Conversational Agents console](https://conversational-agents.cloud.google.com)\n2. If you haven't already, select or create a project.\n\n3. Click **Create agent**.\n\n4. Click **Build your own**.\n\n5. Provide \"Shirt Ordering - Playbooks\" for the agent name.\n\n6. Provide a\n [location](/dialogflow/cx/docs/concept/region).\n\n7. Provide a time zone.\n\n8. Provide a\n [default language](/dialogflow/cx/docs/concept/agent-multilingual).\n\n9. Select **Playbook** for the **Conversation start** option.\n\n10. Click **Create**.\n\n11. The user interface takes you to the default playbook\n named **Default Generative Playbook**.\n\n12. Click the back button to see the list of playbooks.\n\nCreate the order playbook\n-------------------------\n\nThe **Order** playbook handles shirt orders.\nTo create this playbook:\n\n1. Click **Create**.\n2. Select the **Task playbook** option.\n3. Enter the playbook name: `Order`.\n4. Enter the following goal:\n\n You are a shirt store ordering assistant. Help customers purchase shirts.\n Help the customer choose a size and color.\n The shirts come in small, medium, and large.\n The shirts can be red, green, or blue.\n\n5. Enter the following instructions:\n\n - If the customer has not provided a size, ask them to choose a size.\n - If the customer has not provided a color, ask them to choose a color.\n - Once the customer has selected a size and color for the shirt,\n repeat the selection to the customer, and ask them to confirm the selection.\n - Once the customer has confirmed their selection,\n let them know that the shirt is now ordered.\n - Do not provide prices or collect payment.\n - Do not collect the customer's name or address.\n\n6. Click **Save**.\n\n7. Click the back button to return to the playbook list.\n\nCreate the information playbook\n-------------------------------\n\nThe **Information** playbook handles questions about the store.\nTo create this playbook:\n\n1. Click **Create**.\n2. Select the **Task playbook** option.\n3. Enter the playbook name: `Information`.\n4. Enter the following goal:\n\n You provide information about a shirt store.\n The store is open between 8 AM and 6 PM every day.\n The store is located at 1007 Mountain Drive, Gotham City, NJ.\n\n5. Enter the following instructions:\n\n - If the customer asks for the store location, provide them with the address.\n - If the customer asks for the store hours, provide them with the hours.\n\n6. Click **Save**.\n\n7. Click the back button to return to the playbook list.\n\nUpdate the default playbook\n---------------------------\n\nWhen you first created the application,\na default playbook was created for you.\nThis playbook should steer the conversation\nto the appropriate playbooks with specific goals.\nIn the instructions below,\nyou can see how the default playbook references the other playbooks.\nTo update this playbook:\n\n1. Click the default playbook. This playbook has a highlighted star.\n2. Enter the following goal:\n\n You are an assistant for a shirt store.\n Your name is \"Samantha\".\n Your job is to direct customers to other playbooks based on the customer's questions.\n\n3. Enter the following instructions:\n\n - If the customer hasn't been greeted yet, greet the customer,\n introduce yourself, and ask the user how you can help.\n - If the customer wants information about the store,\n route them to ${PLAYBOOK: Information}\n - If the customer wants to purchase a shirt,\n route them to ${PLAYBOOK: Order}\n\n4. Click **Save**.\n\n5. Note that the playbook references are highlighted\n because there are no examples yet.\n These will be added in the next section.\n\n6. Click the back button to return to the playbook list.\n\nProvide examples\n----------------\n\nAt this point,\nyour playbook is functional.\nHowever, You must provide\n[examples](/dialogflow/cx/docs/concept/playbook/example)\nto ensure quality responses.\n\nYou can manually provide examples from the **Examples**\ntab when you have a playbook open.\nHowever, it is often easier to have a conversation with the\nfunctioning playbook and save the conversation as an example.\n\nAn example conversation with a default playbook is short.\nThis playbook just needs to direct you to another playbook.\nTo have a conversation with the default playbook:\n\n1. Close or cancel any panel that might be present on the right side of the screen.\n2. Click the simulator question_answer button in the top row navigation.\n3. For resource, select the default playbook.\n4. Use the default model or select an alternative.\n5. In the text box that says **Enter user input** , type `Hello`, then press enter.\n6. The playbook responds with a greeting.\n\nTo save this conversation as an example:\n\n1. Select the default playbook in the **Invocations** dropdown.\n2. Click the **Save as example** button near the top right of the interface.\n3. The example editor panel opens. You can use this editor to add, edit, delete, or reorder actions.\n4. Provide the example name: `Greeting`.\n5. Update the playbook responses as necessary.\n6. Scroll down to the **End example with output information** and enter `The user is greeted.` in the **Summary** section.\n7. Click the save icon.\n\nAdd a location example for the information playbook:\n\n1. Close or cancel any panel that might be present on the right side of the screen.\n2. If necessary, reset the conversation with the reset restart_alt button.\n3. Select the information playbook in the simulator **Start Resource** dropdown.\n4. Enter the message: `Where are you located?`.\n5. The playbook responds with a location.\n6. Select the information playbook in the **Invocations** dropdown.\n7. Click the **Save as example** button.\n8. Provide the example name: `Location`.\n9. Before saving this conversation as an example, you must delete the action that contains \"Where are you located\". Only the default playbook examples can start with a user action.\n10. To provide the example with the context that started the conversation, expand the **Summary of the preceding conversation...** section and enter the following in the **Starts example with input information** field: `The customer asked \"Where are you located?\"`.\n11. To provide the example with the context that completes the conversation, expand the **Summary of the playbook execution...** section and enter the following in the **End example with output information** field: `The store is located at 1007 Mountain Drive, Gotham City, NJ.`.\n12. Click the save icon.\n\nAdd an hours example for the information playbook:\n\n1. Similar to steps above, but enter the message: `What are your hours?` and name the example: `Hours`.\n\nAdd a selection example for the order playbook:\n\n1. Similar to steps above,\n but name the example `Selection`,\n select the order playbook,\n and send the following messages:\n\n - `I want to buy a shirt`\n - `Large`\n - `Green`\n - `Yes`\n\nTest the agent\n--------------\n\nYour agent is now ready to test.\nOpen the simulator panel\nand have a conversation with the agent.\nYou do not need to have the same conversations as above.\nFor example,\nyou can ask this agent which colors are available for shirts.\nIf you are not getting the desired behavior,\nrefining your examples and creating new ones will improve responses.\n\nInteracting with the agent using the API\n----------------------------------------\n\nSee\n[Interactions with the API](/dialogflow/cx/docs/quick/api)."]]