프롬프트는 작업이 사용자에게 응답을 렌더링하는 방식과 작업이 어떻게 처리되는지 정의합니다.
계속 진행하라는 메시지가 표시됩니다. 작업을 빌드하면서 프롬프트를 추가하여
호출 및 장면 내의 다양한 위치에 쉽게 적용할 수 있습니다. 프롬프트는
더 복잡하고 다음과 같은 리치 콘텐츠를 포함할 수 있습니다.
카드, 이미지, 표를 사용할 수 있습니다.
응답 유형
각 프롬프트에 대해 다양한 참여형 응답 유형 중에서
어시스턴트가 사용자에게 발표할 내용:
간단한 응답: 간단한 응답은 시각적으로 채팅 풍선의 형태를 취합니다.
텍스트 음성 변환 (TTS)이나 음성 합성 마크업 언어 (SSML)를 사용하여
있습니다. 단순 응답은 모든 기기 유형에서 지원되는 유일한 응답입니다.
리치 응답: 리치 응답에는 시각적 또는 기능적 요소가 포함되어 있습니다.
작업과의 사용자 상호작용을 향상합니다. 풍부한 응답을 사용하면
테이블 형식 데이터를 표시하거나 더 긴 오디오 콘텐츠를 재생할 수 있습니다.
시각적 선택 응답: 시각적 선택 응답은 시각적 개체를 제공하며
사용자가 가장 쉽게 여러 옵션 중에서 선택할 수 있는 인터페이스
제목 또는 이미지로 구분됩니다.
미디어 응답: 미디어 응답을 사용하면 작업이 더 긴 형식의 오디오를 재생할 수 있습니다.
SSML보다 훨씬 효율적이고, 미디어 컨트롤이 있는 시각적 구성요소를 제공합니다.
Interactive Canvas: Interactive Canvas가 응답을 전체 화면으로 렌더링합니다.
웹 뷰 및 기능을 지원하는 대화형 웹 앱인
응답을 전송합니다. 캔버스에서 약간 다른 프롬프트를 사용합니다.
HTML, CSS, 웹 표준 등의 웹 표준에서 유연하게 사용할 수 있도록
있습니다.
이러한 각 응답 유형은 동일한 기본 프롬프트 형식을 사용하며
동일한 일반 기능을 사용할 수 있습니다.
프롬프트 형식
작업 프로젝트에서는 YAML 또는 JSON 형식으로 프롬프트를 정의합니다. 각
프롬프트에는 간단한 응답을 최대 2개까지 포함할 수 있으며, 원하는 경우 리치 미디어
있습니다. 응답은 다음과 같은 방식으로 정의됩니다.
first_simple: 사용자에게 전송할 초기 텍스트 또는 음성 (단순) 응답입니다.
content: 간단한 응답 후에 전송할 보충 응답 콘텐츠입니다.
last_simple 사용자에게 보낼 최종 텍스트 또는 음성 (단순) 응답입니다.
canvas: Interactive Canvas와 통합되는 웹 앱을 참조합니다.
기본적으로 프롬프트는 위 순서에 따라 프롬프트에 추가됩니다.
할 수 있습니다. 사용자가 응답하기 전에 어시스턴트는 사용자에게 모든 메시지를 표시합니다.
확인할 수 있습니다
또한 다음 기능을 사용하여 프롬프트에 유연성을 제공할 수 있습니다.
후보: 후보를 사용하면
사용자의 기기 기능에
액세스할 수 있습니다 예를 들어 어시스턴트가 풍부한 디스플레이 모드를 제공하도록 설정할 수 있습니다.
사용자가 디스플레이를 지원하는 내 작업과 상호작용할 때만 응답
있습니다.
변형: 변형은 단일 메시지의 대체 변형입니다.
예를 들어 어시스턴트가 5가지 환영 인사 중에서 선택하도록 할 수 있습니다.
메시지 변형을 생성할 수 있습니다.
추천: 추천은 사용자에게 디스플레이를 지원하는 것을 제공합니다.
어시스턴트에서 메시지를 표시할 때 추천 검색어 칩이 포함된 기기
기본 프롬프트는 하나의 후보, 하나의 변형, 하나의 first_simple 응답을 사용합니다.
후보자
프롬프트에서 candidates 객체를 사용하면
사용자의 기기 기능에
액세스할 수 있습니다 예를 들어 어시스턴트가 풍부한 디스플레이 모드를 제공하도록 설정할 수 있습니다.
사용자가 디스플레이를 지원하는 내 작업과 상호작용할 때만 응답
있습니다. 어시스턴트가 후보를 반환할 수 있는 기기 유형을 정의하려면 다음을 사용하세요.
candidates 객체의 selector 속성입니다.
아래 예에서 selector 속성에는 기기 기능이 포함되어 있습니다.
확인할 수 있습니다 첫 번째 후보에 설정된 프롬프트가 기기의 사용자에게 전송됩니다.
만들 수 있습니다. 두 번째 후보는
수신할 수 있습니다.
YAML
candidates:-selector:surface_capabilities:capabilities:-RICH_RESPONSEfirst_simple:variants:-speech:Here's a simple message.content:card:title:Image card titletext:Some details about the imageimage:url:'https://www.example.com/image/'-first_simple:variants:-speech:Text explains what the image might have shown in more detail.
JSON
{"candidates":[{"selector":{"surface_capabilities":{"capabilities":["RICH_RESPONSE"]}},"first_simple":{"variants":[{"speech":"Here's a simple message."}]},"content":{"card":{"title":"Image card title","text":"Some details about the image","image":{"url":"https://www.example.com/image/"}}}},{"first_simple":{"variants":[{"speech":"Text explains what the image might have shown in more detail."}]}}]}
특정 후보에 대해 하나 이상의 기능 요구사항을 제공할 수 있습니다. 이
다음 목록에는 사용 가능한 각 기능 요구사항이 설명되어 있습니다.
SPEECH: 기기가 텍스트 음성 변환 또는 SSML을 통해 사용자와 대화할 수 있습니다.
RICH_RESPONSE: 기기에서 카드, 목록 및
할 수 있습니다.
LONG_FORM_AUDIO: 기기에서 음악 및 동영상과 같은 긴 형식 오디오 미디어를 재생할 수 있습니다.
팟캐스트
INTERACTIVE_CANVAS: 기기가 Interactive Canvas 응답을 표시할 수 있습니다.
WEB_LINK: 기기에서 리치 응답으로 웹 링크를 사용하여 웹브라우저를 열 수 있습니다.
HOME_STORAGE: 기기에서 홈 스토리지에 데이터를 저장하고 데이터에 액세스할 수 있습니다.
대안
변형을 사용하면 응답의 여러 버전을 정의할 수 있습니다. 어시스턴트가 사용 설정 시
사용자에게 프롬프트를 전송할 때 변형 중 하나가 무작위로 선택됩니다. 최고의
대화 설계를 연습할 때, 대답을 바꿀 때 사용자에게 대체 대답을
액션과 대화하게 됩니다.
예를 들어 사용자가 듣지 못하도록 환영 메시지의 다양한 형태를 제공하세요.
동일한 응답을 반환합니다.
디스플레이 지원 기기에서 추천은 사용자에게 다음과 같은 경우 추천 칩을 제공합니다.
어시스턴트가 메시지를 표시합니다. 추천 검색어 칩을 사용하여
대화를 계속하거나 방향을 전환하세요. 탭하면 추천 검색어 칩이
는 사용자가 입력한 것처럼 텍스트를 대화에 그대로 표시했습니다.
하나의 프롬프트에 최대 8개의 추천을 사용할 수 있으며, 각 제안은 최대 1개입니다.
일반 텍스트 문자 25자까지 포함할 수 있습니다.
추천 단어를 추가하려면 각 제안이 포함된 Suggestion 객체를 제공합니다.
별도의 title 필드에 추천 검색어를 입력합니다. 각 제목은 세트 내에서 고유해야 합니다.
추천 칩도 표시됩니다 Actions Builder에서 이 객체는 YAML로 표시되며
suggestions 형식의 JSON입니다.
예를 들어 '예'라고 입력할 수 있습니다. '아니요'를 선택합니다. 추천 질문이 표시됩니다.
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003ePrompts control how Google Assistant interacts with users in your Action, using a variety of response types like simple text, rich cards, visual selections, media, and interactive canvases.\u003c/p\u003e\n"],["\u003cp\u003ePrompts are structured with elements like \u003ccode\u003efirst_simple\u003c/code\u003e, \u003ccode\u003econtent\u003c/code\u003e, \u003ccode\u003elast_simple\u003c/code\u003e, and \u003ccode\u003ecanvas\u003c/code\u003e, allowing for basic and enhanced responses depending on device capabilities.\u003c/p\u003e\n"],["\u003cp\u003eYou can tailor prompts with candidates for specific device types, variants for diverse responses, and suggestions to guide user interactions.\u003c/p\u003e\n"],["\u003cp\u003eCandidates determine the response based on device capabilities, such as showing rich responses only on devices that support them.\u003c/p\u003e\n"],["\u003cp\u003eVariants offer alternative phrasing for the same message, while suggestions provide clickable chips to guide user responses.\u003c/p\u003e\n"]]],[],null,["# Prompts define how your Action renders responses to users and how your Action\nprompts them to continue. As you build your Action, you can add prompts to\ninvocations and to various places within scenes. Prompts can be as simple as a\ntext or speech response, or can be more complex and contain rich content like\ncards, images, and tables.\n\nResponse types\n--------------\n\nFor each prompt, you select from a variety of engaging response types for\nAssistant to present to users:\n\n- [Simple responses](/assistant/conversational/prompts-simple): Simple responses take the form of a chat bubble visually and use text-to-speech (TTS) or Speech Synthesis Markup Language (SSML) for sound. Simple responses are the only responses supported on all device types.\n- [Rich responses](/assistant/conversational/prompts-rich): Rich responses contain visual or functional elements that enhance user interactions with your Actions. With rich responses, you can also display tabular data or play longer-form audio content.\n- [Visual selection responses](/assistant/conversational/prompts-selection): Visual selection responses provide a visual interface for users to choose between multiple options that are most easily differentiated by their title or by an image.\n- [Media responses](/assistant/conversational/prompts-media): Media responses let your Actions play longer form audio content than [SSML](/assistant/conversational/ssml), and provide a visual component with media controls.\n- [Interactive Canvas](/assistant/interactivecanvas): Interactive Canvas renders responses as full-screen web views and functions as an interactive web app that Assistant sends as a response to the user in conversation. Canvas uses a slightly different prompt format to accommodate added flexibility from web standards like HTML, CSS, and JavaScript.\n\nEach of these response types uses the same base prompt format and has access to\nthe same general features described below.\n\nFormat of a prompt\n------------------\n\nIn your Actions project, you define prompts in either YAML or JSON format. Each\nprompt can contain up to two simple responses, and optionally define a rich\nresponse. Responses are defined in the following ways:\n\n- `first_simple`: Initial text or speech (simple) response to send to the user.\n- `content`: Supplemental rich response content to send after simple responses.\n- `last_simple` Final text or speech (simple) response to send to the user.\n- `canvas`: References a web app that integrates with Interactive Canvas.\n\nBy default, prompts are appended to one another in the above order in a prompt\nqueue. Before the user can respond, Assistant presents the user with all prompts\nin the prompt queue.\n\nYou additionally provide flexibility to the prompt using the following features:\n\n- [Candidates](#candidates): Candidates allow you to define responses based on a user's device capabilities. For example, you can have Assistant display rich responses only when a user interacts with your Action on a display-capable device.\n- [Variants](#variants): Variants are alternate variations of a single message. For example, you can have Assistant choose between five different welcome message variants each time a user invokes your Action.\n- [Suggestions](#suggestions): Suggestions provide users on display-capable devices with suggestion chips when Assistant displays the prompt.\n\nA default prompt uses one candidate, one variant, and a `first_simple` response.\n| **Note:** As a best practice, use `content` to support the `first_simple` response. For example, if the `first_simple` provides options for ordering a drink, you can use `content` to provide visuals for the drink options. This approach ensures users get the important information regardless of which device they use. Alternatively, use candidates to provide different responses based on device.\n\nCandidates\n----------\n\nIn a prompt, the `candidates` object allows you to define responses based on a\nuser's device capabilities. For example, you can have Assistant display rich\nresponses only when a user interacts with your Action on a display-capable\ndevice. To define the device types where Assistant can return a candidate, use\nthe `selector` property of the `candidates` object.\n\nIn the example below, the `selector` property contains the device capability\ninformation. Prompts set in the first candidate are sent to users on a device\nthat can render rich responses. The second candidate contains prompts for\nusers that can only receive text and speech responses. \n\n### YAML\n\n```yaml\ncandidates:\n - selector:\n surface_capabilities:\n capabilities:\n - RICH_RESPONSE\n first_simple:\n variants:\n - speech: Here's a simple message.\n content:\n card:\n title: Image card title\n text: Some details about the image\n image:\n url: 'https://www.example.com/image/'\n - first_simple:\n variants:\n - speech: Text explains what the image might have shown in more detail.\n \n```\n\n### JSON\n\n```gdscript\n{\n \"candidates\": [{\n \"selector\": {\n \"surface_capabilities\": {\n \"capabilities\": [\"RICH_RESPONSE\"]\n }\n },\n \"first_simple\": {\n \"variants\": [{\n \"speech\": \"Here's a simple message.\"\n }]\n },\n \"content\": {\n \"card\": {\n \"title\": \"Image card title\",\n \"text\": \"Some details about the image\",\n \"image\": {\n \"url\": \"https://www.example.com/image/\"\n }\n }\n }\n }, {\n \"first_simple\": {\n \"variants\": [{\n \"speech\": \"Text explains what the image might have shown in more detail.\"\n }]\n }\n }]\n}\n \n```\n\nYou can provide one or more capability requirements for a given candidate. The\nfollowing list describes each of the available capability requirements:\n\n- `SPEECH`: Device can speak to the user via text-to-speech or SSML.\n- `RICH_RESPONSE`: Device can display rich responses like cards, lists, and tables.\n- `LONG_FORM_AUDIO`: Device can play long form audio media like music and podcasts.\n- `INTERACTIVE_CANVAS`: Device can display an Interactive Canvas response.\n- `WEB_LINK`: Device can use web links in rich responses to open a web browser.\n- `HOME_STORAGE`: Device can store to and access data from [home storage](/assistant/conversational/storage-home).\n\nVariants\n--------\n\nVariants provide a way to define multiple versions of a response. When Assistant\nsends the prompt to a user, one of the variants is chosen at random. As a best\npractice in conversation design, provide users with alternate responses when\nthey converse with your Action.\n\nFor example, provide different welcome message variants so users don't hear the\nsame response each time they invoke your Action: \n\n### YAML\n\n```yaml\ncandidates:\n - first_simple:\n variants:\n - speech: Hello.\n - speech: Hi there.\n - speech: Welcome.\n \n```\n\n### JSON\n\n```gdscript\n{\n \"candidates\": [{\n \"first_simple\": {\n \"variants\": [{\n \"speech\": \"Hello.\"\n },{\n \"speech\": \"Hi there.\"\n },{\n \"speech\": \"Welcome.\"\n }]\n }\n }]\n}\n \n```\n\nSuggestions\n-----------\n\nSuggestions provide users on display-capable devices with suggestion chips when\nAssistant displays the prompt. Use suggestion chips to hint at user responses to\ncontinue or pivot the conversation. When tapped, a suggestion chip returns the\ndisplayed text to the conversation verbatim, as if the user had typed it.\n\nYou may have a maximum of 8 suggestions in a single prompt, each with a maximum\nlength of 25 plaintext characters.\n\nTo add a suggestion, provide a [`Suggestion`](/assistant/actionssdk/reference/rest/Shared.Types/EventHandler#suggestion) object that contains each\nsuggestion in a separate `title` field. Each title must be unique among the set\nof suggestion chips. In Actions Builder, this object is represented in YAML and\nJSON as `suggestions`.\n\nFor example, you can provide \"Yes\" and \"No\" suggestions alongside a question: \n\n### YAML\n\n```yaml\ncandidates:\n - first_simple:\n variants:\n - speech: 'Welcome, do you want to play a game?'\n suggestions:\n - title: 'Yes'\n - title: 'No'\n \n```\n\n### JSON\n\n```gdscript\n{\n \"candidates\": [{\n \"first_simple\": {\n \"variants\": [{\n \"speech\": \"Welcome, do you want to play a game?\"\n }]\n },\n \"suggestions\": [{\n \"title\": \"Yes\"\n }, {\n \"title\": \"No\"\n }]\n }]\n}\n \n```"]]