Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class Agent.
A Dialogflow agent is a virtual agent that handles conversations with your end-users. It is a natural language understanding module that understands the nuances of human language. Dialogflow translates end-user text or audio during a conversation to structured data that your apps and services can understand. You design and build a Dialogflow agent to handle the types of conversations required for your system.
For more information about agents, see the Agent guide.
Generated from protobuf message google.cloud.dialogflow.v2.Agent
Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ parent |
string
Required. The project of this agent. Format: |
↳ display_name |
string
Required. The name of this agent. |
↳ default_language_code |
string
Required. The default language of the agent as a language tag. See Language Support for a list of the currently supported language codes. This field cannot be set by the |
↳ supported_language_codes |
array
Optional. The list of all languages supported by this agent (except for the |
↳ time_zone |
string
Required. The time zone of this agent from the time zone database, e.g., America/New_York, Europe/Paris. |
↳ description |
string
Optional. The description of this agent. The maximum length is 500 characters. If exceeded, the request is rejected. |
↳ avatar_uri |
string
Optional. The URI of the agent's avatar. Avatars are used throughout the Dialogflow console and in the self-hosted Web Demo integration. |
↳ enable_logging |
bool
Optional. Determines whether this agent should log conversation queries. |
↳ match_mode |
int
Optional. Determines how intents are detected from user queries. |
↳ classification_threshold |
float
Optional. To filter out false positive results and still get variety in matched natural language inputs for your agent, you can tune the machine learning classification threshold. If the returned score value is less than the threshold value, then a fallback intent will be triggered or, if there are no fallback intents defined, no intent will be triggered. The score values range from 0.0 (completely uncertain) to 1.0 (completely certain). If set to 0.0, the default of 0.3 is used. |
↳ api_version |
int
Optional. API version displayed in Dialogflow console. If not specified, V2 API is assumed. Clients are free to query different service endpoints for different API versions. However, bots connectors and webhook calls will follow the specified API version. |
↳ tier |
int
Optional. The agent tier. If not specified, TIER_STANDARD is assumed. |
getParent
Required. The project of this agent.
Format: projects/<Project ID>
.
Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
Returns | |
---|---|
Type | Description |
string |
setParent
Required. The project of this agent.
Format: projects/<Project ID>
.
Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDisplayName
Required. The name of this agent.
Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
string |
setDisplayName
Required. The name of this agent.
Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDefaultLanguageCode
Required. The default language of the agent as a language tag. See
Language
Support
for a list of the currently supported language codes. This field cannot be
set by the Update
method.
Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
string |
setDefaultLanguageCode
Required. The default language of the agent as a language tag. See
Language
Support
for a list of the currently supported language codes. This field cannot be
set by the Update
method.
Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getSupportedLanguageCodes
Optional. The list of all languages supported by this agent (except for the
default_language_code
).
Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setSupportedLanguageCodes
Optional. The list of all languages supported by this agent (except for the
default_language_code
).
Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$this |
getTimeZone
Required. The time zone of this agent from the time zone database, e.g., America/New_York, Europe/Paris.
Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
string |
setTimeZone
Required. The time zone of this agent from the time zone database, e.g., America/New_York, Europe/Paris.
Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDescription
Optional. The description of this agent.
The maximum length is 500 characters. If exceeded, the request is rejected.
Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
string |
setDescription
Optional. The description of this agent.
The maximum length is 500 characters. If exceeded, the request is rejected.
Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getAvatarUri
Optional. The URI of the agent's avatar.
Avatars are used throughout the Dialogflow console and in the self-hosted Web Demo integration.
Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
string |
setAvatarUri
Optional. The URI of the agent's avatar.
Avatars are used throughout the Dialogflow console and in the self-hosted Web Demo integration.
Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getEnableLogging
Optional. Determines whether this agent should log conversation queries.
Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
bool |
setEnableLogging
Optional. Determines whether this agent should log conversation queries.
Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
bool
|
Returns | |
---|---|
Type | Description |
$this |
getMatchMode
Optional. Determines how intents are detected from user queries.
Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
int |
setMatchMode
Optional. Determines how intents are detected from user queries.
Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getClassificationThreshold
Optional. To filter out false positive results and still get variety in matched natural language inputs for your agent, you can tune the machine learning classification threshold. If the returned score value is less than the threshold value, then a fallback intent will be triggered or, if there are no fallback intents defined, no intent will be triggered. The score values range from 0.0 (completely uncertain) to 1.0 (completely certain).
If set to 0.0, the default of 0.3 is used.
Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
float |
setClassificationThreshold
Optional. To filter out false positive results and still get variety in matched natural language inputs for your agent, you can tune the machine learning classification threshold. If the returned score value is less than the threshold value, then a fallback intent will be triggered or, if there are no fallback intents defined, no intent will be triggered. The score values range from 0.0 (completely uncertain) to 1.0 (completely certain).
If set to 0.0, the default of 0.3 is used.
Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
float
|
Returns | |
---|---|
Type | Description |
$this |
getApiVersion
Optional. API version displayed in Dialogflow console. If not specified, V2 API is assumed. Clients are free to query different service endpoints for different API versions. However, bots connectors and webhook calls will follow the specified API version.
Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
int |
setApiVersion
Optional. API version displayed in Dialogflow console. If not specified, V2 API is assumed. Clients are free to query different service endpoints for different API versions. However, bots connectors and webhook calls will follow the specified API version.
Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getTier
Optional. The agent tier. If not specified, TIER_STANDARD is assumed.
Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
int |
setTier
Optional. The agent tier. If not specified, TIER_STANDARD is assumed.
Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |