Class Intent (0.66.0)

public final class Intent extends GeneratedMessageV3 implements IntentOrBuilder

An intent represents a user's intent to interact with a conversational agent.

You can provide information for the Dialogflow API to use to match user input to an intent by adding training phrases (i.e., examples of user input) to your intent.

Protobuf type google.cloud.dialogflow.cx.v3beta1.Intent

Implements

IntentOrBuilder

Static Fields

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

IS_FALLBACK_FIELD_NUMBER

public static final int IS_FALLBACK_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PARAMETERS_FIELD_NUMBER

public static final int PARAMETERS_FIELD_NUMBER
Field Value
Type Description
int

PRIORITY_FIELD_NUMBER

public static final int PRIORITY_FIELD_NUMBER
Field Value
Type Description
int

TRAINING_PHRASES_FIELD_NUMBER

public static final int TRAINING_PHRASES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Intent getDefaultInstance()
Returns
Type Description
Intent

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Intent.Builder newBuilder()
Returns
Type Description
Intent.Builder

newBuilder(Intent prototype)

public static Intent.Builder newBuilder(Intent prototype)
Parameter
Name Description
prototype Intent
Returns
Type Description
Intent.Builder

parseDelimitedFrom(InputStream input)

public static Intent parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Intent
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Intent parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Intent
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Intent parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Intent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Intent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Intent parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Intent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Intent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Intent parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Intent
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Intent
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Intent parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Intent
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Intent
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Intent parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Intent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Intent
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Intent> parser()
Returns
Type Description
Parser<Intent>

Methods

containsLabels(String key)

public boolean containsLabels(String key)

The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes.

Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include:

  • sys-head
  • sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys-contextual" means the intent is a contextual intent.

map<string, string> labels = 7;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Intent getDefaultInstanceForType()
Returns
Type Description
Intent

getDescription()

public String getDescription()

Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters.

string description = 8;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters.

string description = 8;

Returns
Type Description
ByteString

The bytes for description.

getDisplayName()

public String getDisplayName()

Required. The human-readable name of the intent, unique within the agent.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. The human-readable name of the intent, unique within the agent.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for displayName.

getIsFallback()

public boolean getIsFallback()

Indicates whether this is a fallback intent. Currently only default fallback intent is allowed in the agent, which is added upon agent creation. Adding training phrases to fallback intent is useful in the case of requests that are mistakenly matched, since training phrases assigned to fallback intents act as negative examples that triggers no-match event.

bool is_fallback = 6;

Returns
Type Description
boolean

The isFallback.

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes.

Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include:

  • sys-head
  • sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys-contextual" means the intent is a contextual intent.

map<string, string> labels = 7;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes.

Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include:

  • sys-head
  • sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys-contextual" means the intent is a contextual intent.

map<string, string> labels = 7;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes.

Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include:

  • sys-head
  • sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys-contextual" means the intent is a contextual intent.

map<string, string> labels = 7;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes.

Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include:

  • sys-head
  • sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys-contextual" means the intent is a contextual intent.

map<string, string> labels = 7;

Parameter
Name Description
key String
Returns
Type Description
String

getName()

public String getName()

The unique identifier of the intent. Required for the Intents.UpdateIntent method. Intents.CreateIntent populates the name automatically. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The unique identifier of the intent. Required for the Intents.UpdateIntent method. Intents.CreateIntent populates the name automatically. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParameters(int index)

public Intent.Parameter getParameters(int index)

The collection of parameters associated with the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4;

Parameter
Name Description
index int
Returns
Type Description
Intent.Parameter

getParametersCount()

public int getParametersCount()

The collection of parameters associated with the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4;

Returns
Type Description
int

getParametersList()

public List<Intent.Parameter> getParametersList()

The collection of parameters associated with the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4;

Returns
Type Description
List<Parameter>

getParametersOrBuilder(int index)

public Intent.ParameterOrBuilder getParametersOrBuilder(int index)

The collection of parameters associated with the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4;

Parameter
Name Description
index int
Returns
Type Description
Intent.ParameterOrBuilder

getParametersOrBuilderList()

public List<? extends Intent.ParameterOrBuilder> getParametersOrBuilderList()

The collection of parameters associated with the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.Parameter parameters = 4;

Returns
Type Description
List<? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.ParameterOrBuilder>

getParserForType()

public Parser<Intent> getParserForType()
Returns
Type Description
Parser<Intent>
Overrides

getPriority()

public int getPriority()

The priority of this intent. Higher numbers represent higher priorities.

  • If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the Normal priority in the console.
  • If the supplied value is negative, the intent is ignored in runtime detect intent requests.

int32 priority = 5;

Returns
Type Description
int

The priority.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getTrainingPhrases(int index)

public Intent.TrainingPhrase getTrainingPhrases(int index)

The collection of training phrases the agent is trained on to identify the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3;

Parameter
Name Description
index int
Returns
Type Description
Intent.TrainingPhrase

getTrainingPhrasesCount()

public int getTrainingPhrasesCount()

The collection of training phrases the agent is trained on to identify the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3;

Returns
Type Description
int

getTrainingPhrasesList()

public List<Intent.TrainingPhrase> getTrainingPhrasesList()

The collection of training phrases the agent is trained on to identify the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3;

Returns
Type Description
List<TrainingPhrase>

getTrainingPhrasesOrBuilder(int index)

public Intent.TrainingPhraseOrBuilder getTrainingPhrasesOrBuilder(int index)

The collection of training phrases the agent is trained on to identify the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3;

Parameter
Name Description
index int
Returns
Type Description
Intent.TrainingPhraseOrBuilder

getTrainingPhrasesOrBuilderList()

public List<? extends Intent.TrainingPhraseOrBuilder> getTrainingPhrasesOrBuilderList()

The collection of training phrases the agent is trained on to identify the intent.

repeated .google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase training_phrases = 3;

Returns
Type Description
List<? extends com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhraseOrBuilder>

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Intent.Builder newBuilderForType()
Returns
Type Description
Intent.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Intent.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Intent.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Intent.Builder toBuilder()
Returns
Type Description
Intent.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException