Class Intent (0.14.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.v3.Intent

Implements

IntentOrBuilder

Static Fields

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

IS_FALLBACK_FIELD_NUMBER

public static final int IS_FALLBACK_FIELD_NUMBER
Field Value
TypeDescription
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

PARAMETERS_FIELD_NUMBER

public static final int PARAMETERS_FIELD_NUMBER
Field Value
TypeDescription
int

PRIORITY_FIELD_NUMBER

public static final int PRIORITY_FIELD_NUMBER
Field Value
TypeDescription
int

TRAINING_PHRASES_FIELD_NUMBER

public static final int TRAINING_PHRASES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Intent getDefaultInstance()
Returns
TypeDescription
Intent

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Intent.Builder newBuilder()
Returns
TypeDescription
Intent.Builder

newBuilder(Intent prototype)

public static Intent.Builder newBuilder(Intent prototype)
Parameter
NameDescription
prototypeIntent
Returns
TypeDescription
Intent.Builder

parseDelimitedFrom(InputStream input)

public static Intent parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Intent
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Intent parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Intent
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Intent parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Intent
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Intent
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Intent parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Intent
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Intent
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Intent parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Intent
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Intent
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Intent parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Intent
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Intent
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Intent parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Intent
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Intent parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Intent
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Intent> parser()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Intent getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

The isFallback.

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValueString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
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/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>.

string name = 1;

Returns
TypeDescription
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/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>.

string name = 1;

Returns
TypeDescription
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.v3.Intent.Parameter parameters = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
Intent.Parameter

getParametersCount()

public int getParametersCount()

The collection of parameters associated with the intent.

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

Returns
TypeDescription
int

getParametersList()

public List<Intent.Parameter> getParametersList()

The collection of parameters associated with the intent.

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

Returns
TypeDescription
List<Parameter>

getParametersOrBuilder(int index)

public Intent.ParameterOrBuilder getParametersOrBuilder(int index)

The collection of parameters associated with the intent.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Intent.ParameterOrBuilder

getParametersOrBuilderList()

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

The collection of parameters associated with the intent.

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

Returns
TypeDescription
List<? extends com.google.cloud.dialogflow.cx.v3.Intent.ParameterOrBuilder>

getParserForType()

public Parser<Intent> getParserForType()
Returns
TypeDescription
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
TypeDescription
int

The priority.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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.v3.Intent.TrainingPhrase training_phrases = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v3.Intent.TrainingPhrase training_phrases = 3;

Returns
TypeDescription
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.v3.Intent.TrainingPhrase training_phrases = 3;

Returns
TypeDescription
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.v3.Intent.TrainingPhrase training_phrases = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v3.Intent.TrainingPhrase training_phrases = 3;

Returns
TypeDescription
List<? extends com.google.cloud.dialogflow.cx.v3.Intent.TrainingPhraseOrBuilder>

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Intent.Builder newBuilderForType()
Returns
TypeDescription
Intent.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Intent.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Intent.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Intent.Builder toBuilder()
Returns
TypeDescription
Intent.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException