Interface Guardrail.LlmPolicyOrBuilder (0.1.0)

public static interface Guardrail.LlmPolicyOrBuilder extends MessageOrBuilder

Implements

MessageOrBuilder

Methods

getAllowShortUtterance()

public abstract boolean getAllowShortUtterance()

Optional. By default, the LLM policy check is bypassed for short utterances. Enabling this setting applies the policy check to all utterances, including those that would normally be skipped.

bool allow_short_utterance = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The allowShortUtterance.

getFailOpen()

public abstract boolean getFailOpen()

Optional. If an error occurs during the policy check, fail open and do not trigger the guardrail.

bool fail_open = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The failOpen.

getMaxConversationMessages()

public abstract int getMaxConversationMessages()

Optional. When checking this policy, consider the last 'n' messages in the conversation. When not set a default value of 10 will be used.

int32 max_conversation_messages = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The maxConversationMessages.

getModelSettings()

public abstract ModelSettings getModelSettings()

Optional. Model settings.

.google.cloud.ces.v1.ModelSettings model_settings = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ModelSettings

The modelSettings.

getModelSettingsOrBuilder()

public abstract ModelSettingsOrBuilder getModelSettingsOrBuilder()

Optional. Model settings.

.google.cloud.ces.v1.ModelSettings model_settings = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ModelSettingsOrBuilder

getPolicyScope()

public abstract Guardrail.LlmPolicy.PolicyScope getPolicyScope()

Required. Defines when to apply the policy check during the conversation. If set to POLICY_SCOPE_UNSPECIFIED, the policy will be applied to the user input. When applying the policy to the agent response, additional latency will be introduced before the agent can respond.

.google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope policy_scope = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Guardrail.LlmPolicy.PolicyScope

The policyScope.

getPolicyScopeValue()

public abstract int getPolicyScopeValue()

Required. Defines when to apply the policy check during the conversation. If set to POLICY_SCOPE_UNSPECIFIED, the policy will be applied to the user input. When applying the policy to the agent response, additional latency will be introduced before the agent can respond.

.google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope policy_scope = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for policyScope.

getPrompt()

public abstract String getPrompt()

Required. Policy prompt.

string prompt = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The prompt.

getPromptBytes()

public abstract ByteString getPromptBytes()

Required. Policy prompt.

string prompt = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for prompt.

hasModelSettings()

public abstract boolean hasModelSettings()

Optional. Model settings.

.google.cloud.ces.v1.ModelSettings model_settings = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the modelSettings field is set.