Class Guardrail (0.1.0)

public final class Guardrail extends GeneratedMessage implements GuardrailOrBuilder

Guardrail contains a list of checks and balances to keep the agents safe and secure.

Protobuf type google.cloud.ces.v1.Guardrail

Implements

GuardrailOrBuilder

Static Fields

ACTION_FIELD_NUMBER

public static final int ACTION_FIELD_NUMBER
Field Value
Type Description
int

CODE_CALLBACK_FIELD_NUMBER

public static final int CODE_CALLBACK_FIELD_NUMBER
Field Value
Type Description
int

CONTENT_FILTER_FIELD_NUMBER

public static final int CONTENT_FILTER_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

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

ENABLED_FIELD_NUMBER

public static final int ENABLED_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

LLM_POLICY_FIELD_NUMBER

public static final int LLM_POLICY_FIELD_NUMBER
Field Value
Type Description
int

LLM_PROMPT_SECURITY_FIELD_NUMBER

public static final int LLM_PROMPT_SECURITY_FIELD_NUMBER
Field Value
Type Description
int

MODEL_SAFETY_FIELD_NUMBER

public static final int MODEL_SAFETY_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Guardrail getDefaultInstance()
Returns
Type Description
Guardrail

getDescriptor()

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

newBuilder()

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

newBuilder(Guardrail prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getAction()

public TriggerAction getAction()

Optional. Action to take when the guardrail is triggered.

.google.cloud.ces.v1.TriggerAction action = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
TriggerAction

The action.

getActionOrBuilder()

public TriggerActionOrBuilder getActionOrBuilder()

Optional. Action to take when the guardrail is triggered.

.google.cloud.ces.v1.TriggerAction action = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
TriggerActionOrBuilder

getCodeCallback()

public Guardrail.CodeCallback getCodeCallback()

Optional. Guardrail that potentially blocks the conversation based on the result of the callback execution.

.google.cloud.ces.v1.Guardrail.CodeCallback code_callback = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.CodeCallback

The codeCallback.

getCodeCallbackOrBuilder()

public Guardrail.CodeCallbackOrBuilder getCodeCallbackOrBuilder()

Optional. Guardrail that potentially blocks the conversation based on the result of the callback execution.

.google.cloud.ces.v1.Guardrail.CodeCallback code_callback = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.CodeCallbackOrBuilder

getContentFilter()

public Guardrail.ContentFilter getContentFilter()

Optional. Guardrail that bans certain content from being used in the conversation.

.google.cloud.ces.v1.Guardrail.ContentFilter content_filter = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.ContentFilter

The contentFilter.

getContentFilterOrBuilder()

public Guardrail.ContentFilterOrBuilder getContentFilterOrBuilder()

Optional. Guardrail that bans certain content from being used in the conversation.

.google.cloud.ces.v1.Guardrail.ContentFilter content_filter = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.ContentFilterOrBuilder

getCreateTime()

public Timestamp getCreateTime()

Output only. Timestamp when the guardrail was created.

.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Timestamp when the guardrail was created.

.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public Guardrail getDefaultInstanceForType()
Returns
Type Description
Guardrail

getDescription()

public String getDescription()

Optional. Description of the guardrail.

string description = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. Description of the guardrail.

string description = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for description.

getDisplayName()

public String getDisplayName()

Required. Display name of the guardrail.

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

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. Display name of the guardrail.

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

Returns
Type Description
ByteString

The bytes for displayName.

getEnabled()

public boolean getEnabled()

Optional. Whether the guardrail is enabled.

bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The enabled.

getEtag()

public String getEtag()

Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.

string etag = 11;

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.

string etag = 11;

Returns
Type Description
ByteString

The bytes for etag.

getGuardrailTypeCase()

public Guardrail.GuardrailTypeCase getGuardrailTypeCase()
Returns
Type Description
Guardrail.GuardrailTypeCase

getLlmPolicy()

public Guardrail.LlmPolicy getLlmPolicy()

Optional. Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.

.google.cloud.ces.v1.Guardrail.LlmPolicy llm_policy = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.LlmPolicy

The llmPolicy.

getLlmPolicyOrBuilder()

public Guardrail.LlmPolicyOrBuilder getLlmPolicyOrBuilder()

Optional. Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.

.google.cloud.ces.v1.Guardrail.LlmPolicy llm_policy = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.LlmPolicyOrBuilder

getLlmPromptSecurity()

public Guardrail.LlmPromptSecurity getLlmPromptSecurity()

Optional. Guardrail that blocks the conversation if the prompt is considered unsafe based on the LLM classification.

.google.cloud.ces.v1.Guardrail.LlmPromptSecurity llm_prompt_security = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.LlmPromptSecurity

The llmPromptSecurity.

getLlmPromptSecurityOrBuilder()

public Guardrail.LlmPromptSecurityOrBuilder getLlmPromptSecurityOrBuilder()

Optional. Guardrail that blocks the conversation if the prompt is considered unsafe based on the LLM classification.

.google.cloud.ces.v1.Guardrail.LlmPromptSecurity llm_prompt_security = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.LlmPromptSecurityOrBuilder

getModelSafety()

public Guardrail.ModelSafety getModelSafety()

Optional. Guardrail that blocks the conversation if the LLM response is considered unsafe based on the model safety settings.

.google.cloud.ces.v1.Guardrail.ModelSafety model_safety = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.ModelSafety

The modelSafety.

getModelSafetyOrBuilder()

public Guardrail.ModelSafetyOrBuilder getModelSafetyOrBuilder()

Optional. Guardrail that blocks the conversation if the LLM response is considered unsafe based on the model safety settings.

.google.cloud.ces.v1.Guardrail.ModelSafety model_safety = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Guardrail.ModelSafetyOrBuilder

getName()

public String getName()

Identifier. The unique identifier of the guardrail. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Identifier. The unique identifier of the guardrail. Format: projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

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

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUpdateTime()

public Timestamp getUpdateTime()

Output only. Timestamp when the guardrail was last updated.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Timestamp when the guardrail was last updated.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

hasAction()

public boolean hasAction()

Optional. Action to take when the guardrail is triggered.

.google.cloud.ces.v1.TriggerAction action = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the action field is set.

hasCodeCallback()

public boolean hasCodeCallback()

Optional. Guardrail that potentially blocks the conversation based on the result of the callback execution.

.google.cloud.ces.v1.Guardrail.CodeCallback code_callback = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the codeCallback field is set.

hasContentFilter()

public boolean hasContentFilter()

Optional. Guardrail that bans certain content from being used in the conversation.

.google.cloud.ces.v1.Guardrail.ContentFilter content_filter = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the contentFilter field is set.

hasCreateTime()

public boolean hasCreateTime()

Output only. Timestamp when the guardrail was created.

.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasLlmPolicy()

public boolean hasLlmPolicy()

Optional. Guardrail that blocks the conversation if the LLM response is considered violating the policy based on the LLM classification.

.google.cloud.ces.v1.Guardrail.LlmPolicy llm_policy = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the llmPolicy field is set.

hasLlmPromptSecurity()

public boolean hasLlmPromptSecurity()

Optional. Guardrail that blocks the conversation if the prompt is considered unsafe based on the LLM classification.

.google.cloud.ces.v1.Guardrail.LlmPromptSecurity llm_prompt_security = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the llmPromptSecurity field is set.

hasModelSafety()

public boolean hasModelSafety()

Optional. Guardrail that blocks the conversation if the LLM response is considered unsafe based on the model safety settings.

.google.cloud.ces.v1.Guardrail.ModelSafety model_safety = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the modelSafety field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. Timestamp when the guardrail was last updated.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(AbstractMessage.BuilderParent parent)

protected Guardrail.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Guardrail.Builder
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

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