Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Uma sessão representa uma conversa entre um agente do Dialogflow e um usuário final.
É possível criar entidades especiais, chamadas de entidades de sessão, durante essa conversa.
Elas podem estender ou substituir tipos de entidade personalizados e existem apenas durante a sessão para a qual foram criadas.
Todos os dados da sessão, incluindo as entidades, são armazenados pelo Dialogflow por 20 minutos.
Por exemplo, se o agente tiver um tipo de entidade @fruit que inclui "pera" e "uva", ele poderá ser atualizado para incluir "maçã" ou "laranja", dependendo das informações coletadas do usuário final.
O tipo de entidade atualizado terá a entrada de entidade “maçã” ou “laranja” pelo resto da sessão.
const{sessionEntitiesHelper}=require('actions-on-google-dialogflow-session-entities-plugin')constapp=dialogflow().use(sessionEntitiesHelper())app.intent('input.welcome',(conv)=>{conv.ask('make your choice: apple or orange?');//Setthefruitsessionentityvaluesto'apple'and'orange'.conv.sessionEntities.add({name:'fruit',entities:[{value:'APPLE_KEY',synonyms:['apple','green apple','crabapple']},{value:'ORANGE_KEY',synonyms:['orange']}]});conv.sessionEntities.send();});
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[[["\u003cp\u003eSession entities are specialized entities created during a Dialogflow session that can extend or replace existing custom entity types.\u003c/p\u003e\n"],["\u003cp\u003eThese session entities exist only for the duration of the session in which they were created, with all session data stored by Dialogflow for 20 minutes.\u003c/p\u003e\n"],["\u003cp\u003eSession entities can be created using fulfillment, through the \u003ccode\u003eWebhookResponse\u003c/code\u003e type's \u003ccode\u003esessionEntityTypes\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eThe Actions on Google client library includes a Session Entities plugin to simplify the process of creating and managing session entities within your code.\u003c/p\u003e\n"],["\u003cp\u003eSession entities can be created, updated, and managed using the \u003ccode\u003eSessionEntityTypes\u003c/code\u003e, however this method does not work with Google Assistant integration, requiring the fulfillment option.\u003c/p\u003e\n"]]],[],null,["# Session entities\n\nA *session* represents a conversation between a Dialogflow agent and an end-user.\nYou can create special entities, called *session entities*, during a session.\nSession entities can extend or replace custom entity types\nand only exist during the session that they were created for.\nAll session data, including session entities, is stored by Dialogflow for 20 minutes.\n\nFor example, if your agent has a `@fruit` entity type\nthat includes \"pear\" and \"grape\",\nthat entity type could be updated to include \"apple\" or \"orange\",\ndepending on the information your agent collects from the end-user.\nThe updated entity type would have the \"apple\" or \"orange\" entity entry\nfor the rest of the session.\n\nCreating session entities with fulfillment\n------------------------------------------\n\nYou can create session entities with\n[fulfillment](/dialogflow/docs/fulfillment-overview).\nThe\n[`WebhookResponse`](/dialogflow/docs/reference/common-types#webhookresponse)\ntype contains a field called `sessionEntityTypes`\nthat is used to set session entities.\n\nThe following examples show how to set a `fruit` entity type's\nentity entries to `apple` and `orange` for the current session.\n\n### Example WebhookResponse:\n\n```\n{\n \"fulfillmentMessages\": [\n {\n \"text\": {\n \"text\": [\n \"Choose apple or orange\"\n ]\n }\n }\n ],\n \"sessionEntityTypes\":[\n {\n \"name\":\"projects/project-id/agent/sessions/session-id/entityTypes/fruit\",\n \"entities\":[\n {\n \"value\":\"APPLE_KEY\",\n \"synonyms\":[\n \"apple\",\n \"green apple\",\n \"crabapple\"\n ]\n },\n {\n \"value\":\"ORANGE_KEY\",\n \"synonyms\":[\n \"orange\"\n ]\n }\n ],\n \"entityOverrideMode\":\"ENTITY_OVERRIDE_MODE_OVERRIDE\"\n }\n ]\n}\n```\n\n### Example using the Actions on Google client library:\n\nIf you are using the\n[Actions on Google client library](https://github.com/actions-on-google/actions-on-google-nodejs),\nyou can use the [Session Entities plugin](https://github.com/actions-on-google/dialogflow-session-entities-plugin-nodejs).\n\nYour code would look similar to the following: \n\n```gdscript\nconst { sessionEntitiesHelper } = require('actions-on-google-dialogflow-session-entities-plugin')\n\nconst app = dialogflow()\n .use(sessionEntitiesHelper())\n\napp.intent('input.welcome', (conv) =\u003e {\n conv.ask('make your choice: apple or orange?');\n // Set the fruit session entity values to 'apple' and 'orange'.\n conv.sessionEntities.add({\n name: 'fruit',\n entities: [{\n value: 'APPLE_KEY',\n synonyms: [\n 'apple', 'green apple', 'crabapple'\n ]\n }, {\n value: 'ORANGE_KEY',\n synonyms: ['orange']\n }]\n });\n conv.sessionEntities.send();\n});\n```\n\nCreating session entities with the API\n--------------------------------------\n\n| **Note:** Session entity API methods do not work with Google Assistant integration. Use the fulfillment option for Google Assistant integration.\n\nYou create, manage, and update session entities using the\n[`SessionEntityTypes`](/dialogflow/docs/reference/common-types#sessionentitytypes)\ntype."]]