0.3.1 (latest) 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Gemini Enterprise for Customer Experience V1BETA API class Google::Cloud::Ces::V1beta::Guardrail::LlmPolicy.

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

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #allow_short_utterance

    def allow_short_utterance() -> ::Boolean

**Returns**

- (::Boolean) --- 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.

### #allow_short_utterance=

    def allow_short_utterance=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- 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.
**Returns**

- (::Boolean) --- 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.

### #fail_open

    def fail_open() -> ::Boolean

**Returns**

- (::Boolean) --- Optional. If an error occurs during the policy check, fail open and do not trigger the guardrail.

### #fail_open=

    def fail_open=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Optional. If an error occurs during the policy check, fail open and do not trigger the guardrail.
**Returns**

- (::Boolean) --- Optional. If an error occurs during the policy check, fail open and do not trigger the guardrail.

### #max_conversation_messages

    def max_conversation_messages() -> ::Integer

**Returns**

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

### #max_conversation_messages=

    def max_conversation_messages=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. When checking this policy, consider the last 'n' messages in the conversation. When not set a default value of 10 will be used.
**Returns**

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

### #model_settings

    def model_settings() -> ::Google::Cloud::Ces::V1beta::ModelSettings

**Returns**

- ([::Google::Cloud::Ces::V1beta::ModelSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ces-v1beta/latest/Google-Cloud-Ces-V1beta-ModelSettings)) --- Optional. Model settings.

### #model_settings=

    def model_settings=(value) -> ::Google::Cloud::Ces::V1beta::ModelSettings

**Parameter**

- **value** ([::Google::Cloud::Ces::V1beta::ModelSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ces-v1beta/latest/Google-Cloud-Ces-V1beta-ModelSettings)) --- Optional. Model settings.
**Returns**

- ([::Google::Cloud::Ces::V1beta::ModelSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ces-v1beta/latest/Google-Cloud-Ces-V1beta-ModelSettings)) --- Optional. Model settings.

### #policy_scope

    def policy_scope() -> ::Google::Cloud::Ces::V1beta::Guardrail::LlmPolicy::PolicyScope

**Returns**

- ([::Google::Cloud::Ces::V1beta::Guardrail::LlmPolicy::PolicyScope](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ces-v1beta/latest/Google-Cloud-Ces-V1beta-Guardrail-LlmPolicy-PolicyScope)) --- 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.

### #policy_scope=

    def policy_scope=(value) -> ::Google::Cloud::Ces::V1beta::Guardrail::LlmPolicy::PolicyScope

**Parameter**

- **value** ([::Google::Cloud::Ces::V1beta::Guardrail::LlmPolicy::PolicyScope](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ces-v1beta/latest/Google-Cloud-Ces-V1beta-Guardrail-LlmPolicy-PolicyScope)) --- 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.
**Returns**

- ([::Google::Cloud::Ces::V1beta::Guardrail::LlmPolicy::PolicyScope](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ces-v1beta/latest/Google-Cloud-Ces-V1beta-Guardrail-LlmPolicy-PolicyScope)) --- 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.

### #prompt

    def prompt() -> ::String

**Returns**

- (::String) --- Required. Policy prompt.

### #prompt=

    def prompt=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. Policy prompt.
**Returns**

- (::String) --- Required. Policy prompt.