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
Static Fields
DESCRIPTION_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
Field Value
DISPLAY_NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
IS_FALLBACK_FIELD_NUMBER
public static final int IS_FALLBACK_FIELD_NUMBER
Field Value
LABELS_FIELD_NUMBER
public static final int LABELS_FIELD_NUMBER
Field Value
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value
PARAMETERS_FIELD_NUMBER
public static final int PARAMETERS_FIELD_NUMBER
Field Value
PRIORITY_FIELD_NUMBER
public static final int PRIORITY_FIELD_NUMBER
Field Value
TRAINING_PHRASES_FIELD_NUMBER
public static final int TRAINING_PHRASES_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Intent getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static Intent.Builder newBuilder()
Returns
newBuilder(Intent prototype)
public static Intent.Builder newBuilder(Intent prototype)
Parameter
Name | Description |
prototype | Intent
|
Returns
public static Intent parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Intent parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Intent parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Intent parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Intent parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Intent parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Intent parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Intent parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Intent parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Intent parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Intent parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Intent parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Intent> parser()
Returns
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
Returns
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstanceForType()
public Intent getDefaultInstanceForType()
Returns
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()
public Map<String,String> getLabels()
Returns
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
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
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
Returns
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
Returns
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
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/<Project ID>/locations/<Location ID>/agents/<Agent
ID>/intents/<Intent ID>
.
string name = 1;
Returns
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
Returns
getParametersCount()
public int getParametersCount()
The collection of parameters associated with the intent.
repeated .google.cloud.dialogflow.cx.v3.Intent.Parameter parameters = 4;
Returns
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
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
Returns
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
Type | Description |
List<? extends com.google.cloud.dialogflow.cx.v3.Intent.ParameterOrBuilder> | |
getParserForType()
public Parser<Intent> getParserForType()
Returns
Overrides
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
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
Returns
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
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
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
Returns
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
Type | Description |
List<? extends com.google.cloud.dialogflow.cx.v3.Intent.TrainingPhraseOrBuilder> | |
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public Intent.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Intent.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public Intent.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions