public static final class Guardrail.ContentFilter.Builder extends GeneratedMessage.Builder<Guardrail.ContentFilter.Builder> implements Guardrail.ContentFilterOrBuilderGuardrail that bans certain content from being used in the conversation.
Protobuf type google.cloud.ces.v1.Guardrail.ContentFilter
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > Guardrail.ContentFilter.BuilderImplements
Guardrail.ContentFilterOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
addAllBannedContents(Iterable<String> values)
public Guardrail.ContentFilter.Builder addAllBannedContents(Iterable<String> values)Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<String>The bannedContents to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addAllBannedContentsInAgentResponse(Iterable<String> values)
public Guardrail.ContentFilter.Builder addAllBannedContentsInAgentResponse(Iterable<String> values)Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<String>The bannedContentsInAgentResponse to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addAllBannedContentsInUserInput(Iterable<String> values)
public Guardrail.ContentFilter.Builder addAllBannedContentsInUserInput(Iterable<String> values)Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<String>The bannedContentsInUserInput to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addBannedContents(String value)
public Guardrail.ContentFilter.Builder addBannedContents(String value)Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe bannedContents to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addBannedContentsBytes(ByteString value)
public Guardrail.ContentFilter.Builder addBannedContentsBytes(ByteString value)Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes of the bannedContents to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addBannedContentsInAgentResponse(String value)
public Guardrail.ContentFilter.Builder addBannedContentsInAgentResponse(String value)Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe bannedContentsInAgentResponse to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addBannedContentsInAgentResponseBytes(ByteString value)
public Guardrail.ContentFilter.Builder addBannedContentsInAgentResponseBytes(ByteString value)Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes of the bannedContentsInAgentResponse to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addBannedContentsInUserInput(String value)
public Guardrail.ContentFilter.Builder addBannedContentsInUserInput(String value)Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe bannedContentsInUserInput to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
addBannedContentsInUserInputBytes(ByteString value)
public Guardrail.ContentFilter.Builder addBannedContentsInUserInputBytes(ByteString value)Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes of the bannedContentsInUserInput to add. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
build()
public Guardrail.ContentFilter build()| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter |
|
buildPartial()
public Guardrail.ContentFilter buildPartial()| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter |
|
clear()
public Guardrail.ContentFilter.Builder clear()| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
|
clearBannedContents()
public Guardrail.ContentFilter.Builder clearBannedContents()Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
clearBannedContentsInAgentResponse()
public Guardrail.ContentFilter.Builder clearBannedContentsInAgentResponse()Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
clearBannedContentsInUserInput()
public Guardrail.ContentFilter.Builder clearBannedContentsInUserInput()Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
clearDisregardDiacritics()
public Guardrail.ContentFilter.Builder clearDisregardDiacritics()Optional. If true, diacritics are ignored during matching.
bool disregard_diacritics = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
clearMatchType()
public Guardrail.ContentFilter.Builder clearMatchType()Required. Match type for the content filter.
.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType match_type = 4 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
getBannedContents(int index)
public String getBannedContents(int index)Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the element to return. |
| Returns | |
|---|---|
| Type | Description |
String |
The bannedContents at the given index. |
getBannedContentsBytes(int index)
public ByteString getBannedContentsBytes(int index)Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the value to return. |
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes of the bannedContents at the given index. |
getBannedContentsCount()
public int getBannedContentsCount()Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The count of bannedContents. |
getBannedContentsInAgentResponse(int index)
public String getBannedContentsInAgentResponse(int index)Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the element to return. |
| Returns | |
|---|---|
| Type | Description |
String |
The bannedContentsInAgentResponse at the given index. |
getBannedContentsInAgentResponseBytes(int index)
public ByteString getBannedContentsInAgentResponseBytes(int index)Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the value to return. |
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes of the bannedContentsInAgentResponse at the given index. |
getBannedContentsInAgentResponseCount()
public int getBannedContentsInAgentResponseCount()Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The count of bannedContentsInAgentResponse. |
getBannedContentsInAgentResponseList()
public ProtocolStringList getBannedContentsInAgentResponseList()Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
ProtocolStringList |
A list containing the bannedContentsInAgentResponse. |
getBannedContentsInUserInput(int index)
public String getBannedContentsInUserInput(int index)Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the element to return. |
| Returns | |
|---|---|
| Type | Description |
String |
The bannedContentsInUserInput at the given index. |
getBannedContentsInUserInputBytes(int index)
public ByteString getBannedContentsInUserInputBytes(int index)Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the value to return. |
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes of the bannedContentsInUserInput at the given index. |
getBannedContentsInUserInputCount()
public int getBannedContentsInUserInputCount()Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The count of bannedContentsInUserInput. |
getBannedContentsInUserInputList()
public ProtocolStringList getBannedContentsInUserInputList()Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
ProtocolStringList |
A list containing the bannedContentsInUserInput. |
getBannedContentsList()
public ProtocolStringList getBannedContentsList()Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
ProtocolStringList |
A list containing the bannedContents. |
getDefaultInstanceForType()
public Guardrail.ContentFilter getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getDisregardDiacritics()
public boolean getDisregardDiacritics()Optional. If true, diacritics are ignored during matching.
bool disregard_diacritics = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
The disregardDiacritics. |
getMatchType()
public Guardrail.ContentFilter.MatchType getMatchType()Required. Match type for the content filter.
.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType match_type = 4 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.MatchType |
The matchType. |
getMatchTypeValue()
public int getMatchTypeValue()Required. Match type for the content filter.
.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType match_type = 4 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
int |
The enum numeric value on the wire for matchType. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(Guardrail.ContentFilter other)
public Guardrail.ContentFilter.Builder mergeFrom(Guardrail.ContentFilter other)| Parameter | |
|---|---|
| Name | Description |
other |
Guardrail.ContentFilter |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Guardrail.ContentFilter.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public Guardrail.ContentFilter.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
|
setBannedContents(int index, String value)
public Guardrail.ContentFilter.Builder setBannedContents(int index, String value)Optional. List of banned phrases. Applies to both user inputs and agent responses.
repeated string banned_contents = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
intThe index to set the value at. |
value |
StringThe bannedContents to set. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
setBannedContentsInAgentResponse(int index, String value)
public Guardrail.ContentFilter.Builder setBannedContentsInAgentResponse(int index, String value)Optional. List of banned phrases. Applies only to agent responses.
repeated string banned_contents_in_agent_response = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
intThe index to set the value at. |
value |
StringThe bannedContentsInAgentResponse to set. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
setBannedContentsInUserInput(int index, String value)
public Guardrail.ContentFilter.Builder setBannedContentsInUserInput(int index, String value)Optional. List of banned phrases. Applies only to user inputs.
repeated string banned_contents_in_user_input = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
intThe index to set the value at. |
value |
StringThe bannedContentsInUserInput to set. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
setDisregardDiacritics(boolean value)
public Guardrail.ContentFilter.Builder setDisregardDiacritics(boolean value)Optional. If true, diacritics are ignored during matching.
bool disregard_diacritics = 5 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
booleanThe disregardDiacritics to set. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
setMatchType(Guardrail.ContentFilter.MatchType value)
public Guardrail.ContentFilter.Builder setMatchType(Guardrail.ContentFilter.MatchType value)Required. Match type for the content filter.
.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType match_type = 4 [(.google.api.field_behavior) = REQUIRED];
| Parameter | |
|---|---|
| Name | Description |
value |
Guardrail.ContentFilter.MatchTypeThe matchType to set. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |
setMatchTypeValue(int value)
public Guardrail.ContentFilter.Builder setMatchTypeValue(int value)Required. Match type for the content filter.
.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType match_type = 4 [(.google.api.field_behavior) = REQUIRED];
| Parameter | |
|---|---|
| Name | Description |
value |
intThe enum numeric value on the wire for matchType to set. |
| Returns | |
|---|---|
| Type | Description |
Guardrail.ContentFilter.Builder |
This builder for chaining. |