Alcuni prodotti e funzionalità sono in fase di rinominazione. Anche le funzionalità di playbook e flusso generativi sono in fase di migrazione a un'unica console consolidata. Consulta i dettagli.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Puoi creare entità personalizzate per la corrispondenza dei dati specifici per il tuo agente.
Ad esempio, potresti definire un tipo di entità vegetable
che può corrispondere ai tipi di verdure
disponibili per l'acquisto con un agente di un negozio di alimentari.
I nomi visualizzati dei tipi di entità personalizzati sono univoci per ogni agente.
I nomi visualizzati dei tipi di entità devono iniziare con una lettera
e possono contenere i seguenti caratteri:
A-Z, a-z, 0-9, _ (trattino basso), - (trattino).
I valori di riferimento e sinonimi delle entità non hanno questa limitazione.
Esportare e importare entità personalizzate
Puoi esportare e importare le entità per la condivisione tra gli agenti.
Una delle opzioni di formato di esportazione è il pacchetto JSON,
che è un file zip contenente una gerarchia
di directory e file JSON.
Di seguito è descritta la struttura delle directory:
entityTypes: questa directory contiene i tipi di entità.
<entity type name>: Esistono una o più di queste directory e i nomi delle directory corrispondono ai nomi visualizzati dei tipi di entità.
entities: Questa directory contiene i file di voci di entità.
<language tag>.json: Uno o più di questi file esistono
e i nomi dei file corrispondono ai tag di lingua.
Ogni file contiene voci di entità specifiche per la lingua.
<excludedPhrases>: questa directory contiene
file di frasi escluse.
<language tag>.json: Uno o più di questi file esistono
e i nomi dei file corrispondono ai tag di lingua.
Ogni file contiene esclusioni di frasi specifiche per lingua.
<entity type name>.json: Questo nome file corrisponde
a un nome visualizzato del tipo di entità.
Il file contiene dati specifici per il tipo di entità
non trovati in altri file.
Quando importi i tipi di entità,
potrebbero verificarsi conflitti di unione se il nome visualizzato di un
tipo di entità nell'agente esistente corrisponde a quello di un tipo di entità importato.
Puoi controllare il comportamento di unione quando i nomi visualizzati dei tipi di entità corrispondono
selezionando una delle seguenti opzioni:
Sostituisci i tipi di entità esistenti: un tipo di entità importato sovrascrive qualsiasi tipo di entità con lo stesso nome nell'agente esistente.
Unisci ai tipi di entità esistenti:
Le voci di entità di un tipo di entità importato vengono aggiunte al tipo di entità esistente.
Se esistono le stesse voci di entità, queste non verranno duplicate
e i sinonimi verranno uniti.
Rinomina e importa come nuovi tipi di entità:
Il tipo di entità importato viene rinominato aggiungendo "_1" al nome visualizzato.
Ignora i tipi di entità:
Il tipo di entità esistente rimane invariato
e il tipo di entità importato viene ignorato.
Puoi importare le voci di entità in un tipo di entità esistente.
Il formato del file utilizzato per importare le voci di entità è lo stesso utilizzato per importare i tipi di entità. Tuttavia, il file di importazione può contenere solo un tipo di entità e tutte le voci al suo interno verranno importate nel tipo di entità selezionato.
Se esistono le stesse voci di entità, queste non verranno duplicate
e i sinonimi verranno uniti.
Per importare le voci di entità per un tipo di entità:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eCustom entities can be created to match data specific to your agent, such as defining a \u003ccode\u003evegetable\u003c/code\u003e entity for a grocery store agent.\u003c/p\u003e\n"],["\u003cp\u003eEntities should be defined before adding training phrases to intents, though they can be manually annotated afterward if necessary.\u003c/p\u003e\n"],["\u003cp\u003eThe Dialogflow CX console or the \u003ccode\u003eEntityType\u003c/code\u003e API's \u003ccode\u003ecreate\u003c/code\u003e method can be used to create custom entities by providing entity data.\u003c/p\u003e\n"],["\u003cp\u003eCustom entities can be exported and imported in various formats, including JSON packages, which facilitates sharing across agents.\u003c/p\u003e\n"],["\u003cp\u003eWhen importing entities, merge conflicts can occur, and you can decide whether to replace, merge, rename, or skip existing entity types based on display name matches.\u003c/p\u003e\n"]]],[],null,["# Custom entities\n\nYou can create custom entities for matching data specific to your agent.\nFor example, you could define a `vegetable` entity type\nthat can match the types of vegetables\navailable for purchase with a grocery store agent.\n| **Note:** When building your agent, it's best to define your entities prior to adding [training phrases](/dialogflow/cx/docs/concept/intent#tp) to your intents. The console will automatically annotate your training phrases with existing entities. However, if you create entities after training phrases, you can manually annotate the phrases.\n\nCreate custom entities\n----------------------\n\nTo create a custom entity: \n\n### Console\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Entity Types**.\n6. Click **Create**.\n7. Enter entity data.\n8. Click **Save**.\n\n### API\n\nUse the `EntityType`'s `create` method.\n\n\nGo to the EntityType API reference \n**Select a protocol and version for the EntityType reference:**\n\nClose\n\n\u003cbr /\u003e\n\nLimitations\n-----------\n\nThe following limitations apply:\n\n- Custom entity type display names are unique for each agent. Entity type display names should start with a letter and can contain the following: `A-Z`, `a-z`, `0-9`, `_` (underscore), `-` (dash). Entity reference and synonym values have no such limitation.\n\nExport and import custom entities\n---------------------------------\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can export and import entities for sharing across agents.\n\nOne of the export format options is Json package,\nwhich is a zip file that contains a hierarchy\nof directories and JSON files.\nThe following describes the directory structure:\n\n- `entityTypes`: This directory contains your entity types.\n - `\u003centity type name\u003e`: One or more of these directories exist, and the directory names correspond to entity type display names.\n - `entities`: This directory contains entity entry files.\n - `\u003clanguage tag\u003e.json`: One or more of these files exist, and the file names correspond to language tags. Each file contains language-specific entity entries.\n - `\u003cexcludedPhrases\u003e`: This directory contains [excluded phrase](/dialogflow/cx/docs/concept/entity-options#exclusion) files.\n - `\u003clanguage tag\u003e.json`: One or more of these files exist, and the file names correspond to language tags. Each file contains language-specific phrase exclusions.\n - `\u003centity type name\u003e.json`: This filename corresponds to an entity type display name. The file contains entity-type-specific data not found in other files.\n\nFor example: \n\n```\nfolder entityTypes\n ⤷ folder Entity Type A\n ⤷ folder entities\n ⤷ insert_drive_file en.json\n ⤷ insert_drive_file en-gb.json\n ⤷ insert_drive_file en-ca.json\n ⤷ folder excludedPhrases\n ⤷ insert_drive_file en.json\n ⤷ insert_drive_file en-gb.json\n ⤷ insert_drive_file en-ca.json\n ⤷ insert_drive_file Entity Type A.json\n ⤷ folder Entity Type B\n ⤷ folder entities\n ⤷ insert_drive_file en.json\n ⤷ insert_drive_file en-gb.json\n ⤷ insert_drive_file en-ca.json\n ⤷ folder excludedPhrases\n ⤷ insert_drive_file en.json\n ⤷ insert_drive_file en-gb.json\n ⤷ insert_drive_file en-ca.json\n ⤷ insert_drive_file Entity Type B.json\n```\n\nWhen importing entity types,\nthere may be merge conflicts when the display name of an\nentity type in your existing agent matches that of an imported entity type.\nYou can control the merge behavior when entity type display names match\nby selecting one of the following:\n\n- **Replace existing entity types**: An imported entity type overwrites any same-named entity type in your existing agent.\n- **Merge with existing entity types**: The entity entries of an imported entity type are added to the existing entity type. If the same entity entries exist, they won't be duplicated, and the synonyms under them will be merged.\n- **Rename and import as new entity types**: The imported entity type is renamed by appending \"_1\" to the display name.\n- **Skip the entity types**: The existing entity type remains unchanged, and the imported entity type is ignored.\n\nTo export entity types: \n\n### Console\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Entity Types**.\n6. Select all the entity types you want to export.\n7. Click **Export selected entity**.\n8. Select the format and destination.\n9. Click **Submit**.\n\nTo import entity types: \n\n### Console\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Entity Types**.\n6. Click **Import**.\n7. Select the source and merge behavior.\n8. Click **Submit**.\n\nImport entity entries\n---------------------\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can import entity entries to an existing entity type.\n\nThe file format used for importing entity entries is the same as the format\nused for importing entity types. However, the import file can only contain 1\nentity type and all the entries under it will be imported to the selected entity\ntype.\nIf the same entity entries exist, they won't be duplicated,\nand the synonyms under them will be merged.\n\nTo import entity entries for an entity type: \n\n### Console\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Entity Types**.\n6. Select an entity.\n7. Click **Import to entity**.\n8. Select a file.\n9. Click **Submit**."]]