프롬프트에서 사용자 저장소에 저장된 값을 참조할 수 있습니다. 이
값에는 $user.params.PARAMETER_NAME 구문을 사용합니다. 여기서
PARAMETER_NAME은
매개변수가 설정되었습니다.
예를 들어 이전에
매개변수 exampleColor 프롬프트에서 해당 값에 액세스하려면
$user.params.exampleColor를 사용하여 값을 찾을 수 있습니다.
JSON
{"candidates":[{"first_simple":{"variants":[{"speech":"Your favorite color is $user.params.exampleColor."}]}}]}
조건 내에서 저장된 값 참조
조건에서 사용자 저장소에 저장된 값을 참조할 수도 있습니다. 받는사람
값을 참조하려면 user.params.PARAMETER_NAME를 사용합니다.
구문으로, 여기서 PARAMETER_NAME은
웹훅을 설정할 수도 있습니다.
예를 들어 이전에
exampleColor 매개변수를 사용하고 이 매개변수를 'red' 값과 일치시키려고 합니다. 과녁을 맞히려는 화살의
있습니다. 조건에서 다음을 사용하여 저장된 값을 참조합니다.
user.params.exampleColor 그러면 조건 표현식이 다음과 같이 표시됩니다.
조건 문법
user.params.exampleColor == "red"
사용자 스토리지 데이터 만료
인증된 사용자의 경우 사용자 스토리지에 저장된 데이터는
웹 및 앱 활동 설정을 변경할 수 있으며 작업 자체에서 삭제할 수도 있습니다.
인증되지 않은 사용자의 경우 어시스턴트는 다음 시간 동안 사용자 저장용량 내용을 삭제합니다.
대화의 끝입니다.
Actions on Google은 각 작업을 시작할 때 사용자의 인증 상태를 설정합니다.
다양한 지표를 기반으로 대화를 식별합니다. 따라서
예를 들어 휴대기기에서 Google 어시스턴트에 로그인한 사용자에게
VERIFIED의 확인 상태입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eUser storage allows you to store and retrieve user-specific data across conversations within your Action.\u003c/p\u003e\n"],["\u003cp\u003eYou can write, read, and clear user-stored data through webhook calls using the \u003ccode\u003euser.params\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eReferenced stored values in prompts and conditions using \u003ccode\u003e$user.params.PARAMETER_NAME\u003c/code\u003e and \u003ccode\u003euser.params.PARAMETER_NAME\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eData stored in user storage for verified users is subject to their Web & App Activity settings and may expire; for unverified users, it's cleared at the conversation's end.\u003c/p\u003e\n"],["\u003cp\u003eUsers have the ability to view, reset, or completely remove their data stored by your Action.\u003c/p\u003e\n"]]],["User storage allows Actions to retain parameter values across sessions. Data is stored in the `user` object's `params` field during webhook calls, with consent required for certain data. To store, assign values to `conv.user.params.PARAMETER_NAME`; to retrieve, assign `conv.user.params.PARAMETER_NAME` to a variable; to clear, set the value to `null`. Stored values can be referenced in prompts and conditions using `$user.params.PARAMETER_NAME` and `user.params.PARAMETER_NAME`, respectively. Data expiry depends on the user's verification status and settings. Users can also view or clear their user storage data.\n"],null,["In a webhook call, you can store parameter values for a specific user across\nsessions in user storage. Your Action can then use those stored values later in\nprompts and conditions, and your webhook code can access values in user storage\nfor a specific user when necessary.\n\nThe state of user storage is passed in an `app.handle()` request and is stored\nin the [`user`](/assistant/conversational/reference/rest/v1/TopLevel/fulfill#User) object.\n| **Important: Obtain user consent prior to using user storage.** Some\n| countries have regulations that require developers to obtain consent from\n| the user before they can access or save certain information (like personal\n| information) in user storage.\n|\n| If you operate in one of these countries and you want to access or save\n| such information in user storage, you must first ask and obtain\n| consent from the user. Do so by creating a scene that asks for consent and\n| matches intents for *yes* and *no* responses.\n\nRead and write data across conversations\n\nTo update or set a new value in user storage, assign the value to the `params`\nfield of the `user` object in a webhook call. The following example sets\n\"exampleColor\" to \"red\" in user storage: \n\nNode.js \n\n```javascript\n// Assign color to user storage\napp.handle('storeColor', conv =\u003e {\n let color = 'red';\n conv.user.params.exampleColor = color;\n});\n \n```\n\nJSON \n\n```text\n{\n \"responseJson\": {\n \"session\": {\n \"id\": \"1234567890123456789\",\n \"params\": {}\n },\n \"prompt\": {\n \"override\": false\n },\n \"user\": {\n \"locale\": \"en-US\",\n \"params\": {\n \"verificationStatus\": \"VERIFIED\",\n \"exampleColor\": \"red\"\n }\n }\n }\n}\n \n```\n\nTo access data stored in user storage, assign it to a variable in a webhook\ncall. The following example retrieves a value from \"exampleColor\" in user\nstorage: \n\nNode.js \n\n```javascript\n// Retrieve color from user storage\napp.handle('getStoredColor', conv =\u003e {\n let color = conv.user.params.exampleColor;\n});\n \n```\n\nJSON \n\n```text\n{\n \"responseJson\": {\n \"session\": {\n \"id\": \"1234567890123456789\",\n \"params\": {}\n },\n \"prompt\": {\n \"override\": false\n },\n \"user\": {\n \"locale\": \"en-US\",\n \"params\": {\n \"verificationStatus\": \"VERIFIED\",\n \"exampleColor\": \"red\"\n }\n }\n }\n}\n \n```\n\nTo clear a previously saved value, set the value to `null` in a webhook call.\nThe following example clears the value of \"exampleColor\" in user storage: \n\nNode.js \n\n```javascript\n// Clear color from user storage\napp.handle('clearStoredColor', conv =\u003e {\n conv.user.params.exampleColor = null;\n});\n \n```\n\nJSON \n\n```text\n{\n \"responseJson\": {\n \"session\": {\n \"id\": \"1234567890123456789\",\n \"params\": {}\n },\n \"prompt\": {\n \"override\": false\n },\n \"user\": {\n \"locale\": \"en-US\",\n \"params\": {\n \"verificationStatus\": \"VERIFIED\"\n }\n }\n }\n}\n \n```\n\nReference stored values within prompts\n\nYou can reference values stored in user storage in a [prompt](/assistant/conversational/prompts). To reference the\nvalue, use `$user.params.`\u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e syntax, where\n\u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e is the name given in the webhook when the\nparameter was set.\n\nFor example, you previously stored a color value in user storage as the\nparameter `exampleColor`. To access that value in a prompt, you reference that\nvalue using `$user.params.exampleColor`: \n\nJSON \n\n```gdscript\n{\n \"candidates\": [{\n \"first_simple\": {\n \"variants\": [{\n \"speech\": \"Your favorite color is $user.params.exampleColor.\"\n }]\n }\n }]\n}\n \n```\n\nReference stored values within conditions\n\nYou can also reference values stored in user storage in [conditions](/assistant/conversational/conditions). To\nreference the value, use the `user.params.`\u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e\nsyntax, where \u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e is the name given in the\nwebhook when the parameter was set.\n\nFor example, you previously stored a color value in user storage as the\nparameter `exampleColor`, and you want to match it with the value \"red\" in a\ncondition. In your condition, you reference the stored value using\n`user.params.exampleColor`. Your condition expression then looks like this: \n\nCondition syntax \n\n```text\nuser.params.exampleColor == \"red\"\n \n```\n\nExpiration of user storage data\n\nFor verified users, data stored in user storage expires based on their\n[Web \\& App Activity](https://support.google.com/googlenest/answer/7382500) settings and can also be cleared by the Action itself.\nFor users who aren't verified, Assistant clears the contents of user storage at\nthe end of the conversation.\n\nActions on Google sets the user's verification status at the start of each\nconversation based on a variety of indicators when the conversation starts. As\none example, a user logged in to Google Assistant on their mobile device has a\nverification status of `VERIFIED`.\n\nThe following are possible reasons for a user to have a verification status of\n`GUEST`:\n\n- The user has [personal results](https://support.google.com/googlehome/answer/7684543) turned off.\n- The user disabled their [Web \\& App Activity](https://support.google.com/googlenest/answer/7382500). Keep in mind that some users may have this setting disabled at the domain level.\n- If a device has Voice Match enabled, and the match fails or the user invokes the Assistant without using their voice (such as a long press on a Nest Home device).\n- The user isn't signed in.\n\nAlways check the user's verification status before storing data with user\nstorage to prevent guest users from interacting with a feature that will fail\nfor them.\n\nVisibility to users\n\nAs a user, you can view data stored in your user storage for Actions you invoke.\nYou can also remove data stored in your user storage from a specific Action or\nstop the service from remembering you.\n\nTo view your stored data or to stop a service from remembering you, follow these\nsteps:\n\n1. Go to the [Assistant directory](https://assistant.google.com/explore).\n2. Find and select the Action you want to view or clear your user storage for.\n3. Scroll to the bottom of the page:\n - To view the contents of your user storage, click **\\[View stored data\\]**.\n - To reset data stored in your user storage for the service, click **Reset**.\n - To remove data stored in your user storage and stop the service from remembering you, click **Stop *action_name* from remembering me**."]]