EntityTypesClient

EntityTypesClient

Entities are extracted from user input and represent parameters that are meaningful to your application. For example, a date range, a proper name such as a geographic location or landmark, and so on. Entities represent actionable data for your application.

When you define an entity, you can also include synonyms that all map to that entity. For example, "soft drink", "soda", "pop", and so on.

There are three types of entities:

  • System - entities that are defined by the Dialogflow API for common data types such as date, time, currency, and so on. A system entity is represented by the EntityType type.

  • Custom - entities that are defined by you that represent actionable data that is meaningful to your application. For example, you could define a pizza.sauce entity for red or white pizza sauce, a pizza.cheese entity for the different types of cheese on a pizza, a pizza.topping entity for different toppings, and so on. A custom entity is represented by the EntityType type.

  • User - entities that are built for an individual user such as favorites, preferences, playlists, and so on. A user entity is represented by the SessionEntityType type.

For more information about entity types, see the Dialogflow documentation.

Constructor

new EntityTypesClient(optionsopt)

Construct an instance of EntityTypesClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. See the subsequent parameters for more details.

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

Members

(static) apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

(static) port

The port for this API service.

(static) scopes

The scopes needed to make gRPC calls for every method defined in this service.

(static) servicePath

The DNS address for this API service.

Methods

batchCreateEntities(request, optionsopt) → {Promise}

Creates multiple new entities in the specified entity type.

Operation <response: google.protobuf.Empty>

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The name of the entity type to create entities in. Format: projects/<Project ID>/agent/entityTypes/<Entity Type ID>.

entities Array.<number>

Required. The entities to create.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

options object <optional>

Call options. See CallOptions for more details.

batchDeleteEntities(request, optionsopt) → {Promise}

Deletes entities in the specified entity type.

Operation <response: google.protobuf.Empty>

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The name of the entity type to delete entries for. Format: projects/<Project ID>/agent/entityTypes/<Entity Type ID>.

entityValues Array.<string>

Required. The reference values of the entities to delete. Note that these are not fully-qualified names, i.e. they don't start with projects/<Project ID>.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

options object <optional>

Call options. See CallOptions for more details.

batchDeleteEntityTypes(request, optionsopt) → {Promise}

Deletes entity types in the specified agent.

Operation <response: google.protobuf.Empty>

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The name of the agent to delete all entities types for. Format: projects/<Project ID>/agent.

entityTypeNames Array.<string>

Required. The names entity types to delete. All names must point to the same agent as parent.

options object <optional>

Call options. See CallOptions for more details.

batchUpdateEntities(request, optionsopt) → {Promise}

Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.

Operation <response: google.protobuf.Empty>

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The name of the entity type to update or create entities in. Format: projects/<Project ID>/agent/entityTypes/<Entity Type ID>.

entities Array.<number>

Required. The entities to update or create.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

updateMask google.protobuf.FieldMask

Optional. The mask to control which fields get updated.

options object <optional>

Call options. See CallOptions for more details.

batchUpdateEntityTypes(request, optionsopt) → {Promise}

Updates/Creates multiple entity types in the specified agent.

Operation <response: BatchUpdateEntityTypesResponse>

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The name of the agent to update or create entity types in. Format: projects/<Project ID>/agent.

entityTypeBatchUri string

The URI to a Google Cloud Storage file containing entity types to update or create. The file format can either be a serialized proto (of EntityBatch type) or a JSON object. Note: The URI must start with "gs://".

entityTypeBatchInline google.cloud.dialogflow.v2beta1.EntityTypeBatch

The collection of entity types to update or create.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

updateMask google.protobuf.FieldMask

Optional. The mask to control which fields get updated.

options object <optional>

Call options. See CallOptions for more details.

close()

Terminate the GRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

createEntityType(request, optionsopt) → {Promise}

Creates an entity type in the specified agent.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The agent to create a entity type for. Format: projects/<Project ID>/agent.

entityType google.cloud.dialogflow.v2beta1.EntityType

Required. The entity type to create.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

options object <optional>

Call options. See CallOptions for more details.

deleteEntityType(request, optionsopt) → {Promise}

Deletes the specified entity type.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the entity type to delete. Format: projects/<Project ID>/agent/entityTypes/<EntityType ID>.

options object <optional>

Call options. See CallOptions for more details.

environmentPath(project, environment) → {string}

Return a fully-qualified environment resource name string.

Parameters:
Name Type Description
project string
environment string

getEntityType(request, optionsopt) → {Promise}

Retrieves the specified entity type.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
name string

Required. The name of the entity type. Format: projects/<Project ID>/agent/entityTypes/<EntityType ID>.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

options object <optional>

Call options. See CallOptions for more details.

getProjectId(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

initialize() → {Promise}

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

listEntityTypes(request, optionsopt) → {Promise}

Returns the list of all entity types in the specified agent.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The agent to list all entity types from. Format: projects/<Project ID>/agent.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

pageSize number

Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.

pageToken string

Optional. The next_page_token value returned from a previous list request.

options object <optional>

Call options. See CallOptions for more details.

listEntityTypesAsync(request, optionsopt) → {Object}

Equivalent to listEntityTypes, but returns an iterable object.

for-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The agent to list all entity types from. Format: projects/<Project ID>/agent.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

pageSize number

Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.

pageToken string

Optional. The next_page_token value returned from a previous list request.

options object <optional>

Call options. See CallOptions for more details.

listEntityTypesStream(request, optionsopt) → {Stream}

Equivalent to listEntityTypes, but returns a NodeJS Stream object.

This fetches the paged responses for listEntityTypes continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The agent to list all entity types from. Format: projects/<Project ID>/agent.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

pageSize number

Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.

pageToken string

Optional. The next_page_token value returned from a previous list request.

options object <optional>

Call options. See CallOptions for more details.

See:

matchEnvironmentFromEnvironmentName(environmentName) → {string}

Parse the environment from Environment resource.

Parameters:
Name Type Description
environmentName string

A fully-qualified path representing Environment resource.

matchIntentFromProjectAgentIntentName(projectAgentIntentName) → {string}

Parse the intent from ProjectAgentIntent resource.

Parameters:
Name Type Description
projectAgentIntentName string

A fully-qualified path representing project_agent_intent resource.

matchIntentFromProjectLocationAgentIntentName(projectLocationAgentIntentName) → {string}

Parse the intent from ProjectLocationAgentIntent resource.

Parameters:
Name Type Description
projectLocationAgentIntentName string

A fully-qualified path representing project_location_agent_intent resource.

matchLocationFromProjectLocationAgentIntentName(projectLocationAgentIntentName) → {string}

Parse the location from ProjectLocationAgentIntent resource.

Parameters:
Name Type Description
projectLocationAgentIntentName string

A fully-qualified path representing project_location_agent_intent resource.

matchLocationFromProjectLocationAgentName(projectLocationAgentName) → {string}

Parse the location from ProjectLocationAgent resource.

Parameters:
Name Type Description
projectLocationAgentName string

A fully-qualified path representing project_location_agent resource.

matchProjectFromEnvironmentName(environmentName) → {string}

Parse the project from Environment resource.

Parameters:
Name Type Description
environmentName string

A fully-qualified path representing Environment resource.

matchProjectFromProjectAgentIntentName(projectAgentIntentName) → {string}

Parse the project from ProjectAgentIntent resource.

Parameters:
Name Type Description
projectAgentIntentName string

A fully-qualified path representing project_agent_intent resource.

matchProjectFromProjectAgentName(projectAgentName) → {string}

Parse the project from ProjectAgent resource.

Parameters:
Name Type Description
projectAgentName string

A fully-qualified path representing project_agent resource.

matchProjectFromProjectLocationAgentIntentName(projectLocationAgentIntentName) → {string}

Parse the project from ProjectLocationAgentIntent resource.

Parameters:
Name Type Description
projectLocationAgentIntentName string

A fully-qualified path representing project_location_agent_intent resource.

matchProjectFromProjectLocationAgentName(projectLocationAgentName) → {string}

Parse the project from ProjectLocationAgent resource.

Parameters:
Name Type Description
projectLocationAgentName string

A fully-qualified path representing project_location_agent resource.

projectAgentIntentPath(project, intent) → {string}

Return a fully-qualified projectAgentIntent resource name string.

Parameters:
Name Type Description
project string
intent string

projectAgentPath(project) → {string}

Return a fully-qualified projectAgent resource name string.

Parameters:
Name Type Description
project string

projectLocationAgentIntentPath(project, location, intent) → {string}

Return a fully-qualified projectLocationAgentIntent resource name string.

Parameters:
Name Type Description
project string
location string
intent string

projectLocationAgentPath(project, location) → {string}

Return a fully-qualified projectLocationAgent resource name string.

Parameters:
Name Type Description
project string
location string

updateEntityType(request, optionsopt) → {Promise}

Updates the specified entity type.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
entityType google.cloud.dialogflow.v2beta1.EntityType

Required. The entity type to update.

languageCode string <optional>

Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data.

updateMask google.protobuf.FieldMask

Optional. The mask to control which fields get updated.

options object <optional>

Call options. See CallOptions for more details.