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.
다음 요청 사항을 입력합니다.
- 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.
저장을 클릭합니다.
뒤로 버튼을 클릭하여 플레이북 목록으로 돌아갑니다.
정보 플레이북 만들기
정보 플레이북은 매장에 대한 질문을 처리합니다.
이 플레이북을 만들려면 다음 단계를 따르세요.
만들기를 클릭합니다.
할 일 플레이북 옵션을 선택합니다.
플레이북 이름 Information을 입력합니다.
다음 목표를 입력합니다.
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.
다음 요청 사항을 입력합니다.
- 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.
저장을 클릭합니다.
뒤로 버튼을 클릭하여 플레이북 목록으로 돌아갑니다.
기본 플레이북 업데이트
애플리케이션을 처음 만들 때 기본 플레이북이 생성됩니다.
이 플레이북은 특정 목표가 있는 적절한 플레이북으로 대화를 유도합니다. 아래 안내에서 기본 플레이북이 다른 플레이북을 참조하는 방법을 확인할 수 있습니다.
이 플레이북을 업데이트하려면 다음 단계를 따르세요.
기본 플레이북을 클릭합니다. 이 플레이북에는 강조 표시된 별표가 있습니다.
다음 목표를 입력합니다.
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.
다음 요청 사항을 입력합니다.
- 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}
저장을 클릭합니다.
아직 예시가 없으므로 플레이북 참조가 강조 표시됩니다.
다음 섹션에서 추가됩니다.
뒤로 버튼을 클릭하여 플레이북 목록으로 돌아갑니다.
예 제공
이 시점에서 플레이북이 작동합니다.
하지만 대답의 품질을 보장하려면 예를 제공해야 합니다.
플레이북이 열려 있으면 예 탭에서 예를 수동으로 제공할 수 있습니다.
하지만 작동 중인 플레이북과 대화하고 이 대화를 예로 저장하는 것이 더 쉬울 때가 많습니다.
기본 플레이북과의 대화 예는 간단합니다.
이 플레이북은 다른 플레이북으로 사용자를 안내해야 할 뿐입니다.
기본 플레이북과 대화하려면 다음 안내를 따르세요.
화면 오른쪽에 있을 수 있는 패널을 닫거나 취소합니다.
상단 행 탐색에서 시뮬레이터 question_answer 버튼을 클릭합니다.
리소스에서 기본 플레이북을 선택합니다.
기본 모델을 사용하거나 대안을 선택합니다.
사용자 입력이라는 텍스트 상자에 Hello를 입력한 다음 Enter 키를 누릅니다.
플레이북이 인사말로 대답합니다.
이 대화를 예시로 저장하려면 다음 안내를 따르세요.
호출 드롭다운에서 기본 플레이북을 선택합니다.
인터페이스 오른쪽 상단에 있는 예로 저장 버튼을 클릭합니다.
예시 편집기 패널이 열립니다.
이 편집기를 사용하여 작업을 추가, 수정, 삭제 또는 재정렬할 수 있습니다.
예 이름을 Greeting으로 지정합니다.
필요에 따라 플레이북 대답을 업데이트합니다.
출력 정보가 있는 종료 예시로 스크롤하여 요약 섹션에 The user is greeted.를 입력합니다.
저장 아이콘을 클릭합니다.
정보 플레이북에 위치 예를 추가합니다.
화면 오른쪽에 있을 수 있는 패널을 닫거나 취소합니다.
필요한 경우 재설정 restart_alt 버튼을 사용하여 대화를 재설정합니다.
시뮬레이터 리소스 시작 드롭다운에서 정보 플레이북을 선택합니다.
메시지로 Where are you located?를 입력합니다.
플레이북이 위치로 대답합니다.
호출 드롭다운에서 정보 플레이북을 선택합니다.
예로 저장 버튼을 클릭합니다.
예시 이름을 Location으로 지정합니다.
이 대화를 예시로 저장하기 전에 'Where are you located'가 포함된 작업을 삭제해야 합니다.
기본 플레이북 예만 사용자 작업으로 시작할 수 있습니다.
대화를 시작한 컨텍스트를 예시로 제공하려면 이전 대화 요약... 섹션을 펼치고 입력 정보로 예시 시작 입력란에 The customer asked "Where are you located?"를 입력합니다.
대화를 완료하는 컨텍스트를 예시로 제공하려면 플레이북 실행 요약... 섹션을 펼치고 출력 정보가 있는 종료 예시 필드에 The store is located at 1007 Mountain Drive, Gotham City, NJ.를 입력합니다.
저장 아이콘을 클릭합니다.
정보 플레이북에 시간 예를 추가합니다.
위 단계와 비슷하지만 What are your hours? 메시지를 입력하고 예 이름을 Hours로 지정합니다.
주문 플레이북에 선택 예를 추가합니다.
위 단계와 비슷하지만 예 이름을 Selection으로 지정하고 주문 플레이북을 선택한 후 다음 메시지를 보냅니다.
I want to buy a shirt
Large
Green
Yes
에이전트 테스트
이제 에이전트를 테스트할 수 있습니다.
시뮬레이터 패널을 열고 에이전트와 대화합니다.
위와 동일한 대화를 할 필요는 없습니다.
예를 들어 이 에이전트에 구매 가능한 셔츠 색상을 물어볼 수 있습니다.
원하는 동작을 얻지 못한 경우 예를 미세 조정하고 새 예를 만들면 대답이 개선됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(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)."]]