Interface GuardrailRegex.Builder

  • Method Details

    • name

      The name of the regular expression for the guardrail.

      Parameters:
      name - The name of the regular expression for the guardrail.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • description

      GuardrailRegex.Builder description(String description)

      The description of the regular expression for the guardrail.

      Parameters:
      description - The description of the regular expression for the guardrail.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • pattern

      GuardrailRegex.Builder pattern(String pattern)

      The pattern of the regular expression configured for the guardrail.

      Parameters:
      pattern - The pattern of the regular expression configured for the guardrail.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • action

      The action taken when a match to the regular expression is detected.

      Parameters:
      action - The action taken when a match to the regular expression is detected.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • action

      The action taken when a match to the regular expression is detected.

      Parameters:
      action - The action taken when a match to the regular expression is detected.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • inputAction

      GuardrailRegex.Builder inputAction(String inputAction)

      The action to take when harmful content is detected in the input. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Parameters:
      inputAction - The action to take when harmful content is detected in the input. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • inputAction

      The action to take when harmful content is detected in the input. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Parameters:
      inputAction - The action to take when harmful content is detected in the input. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • outputAction

      GuardrailRegex.Builder outputAction(String outputAction)

      The action to take when harmful content is detected in the output. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Parameters:
      outputAction - The action to take when harmful content is detected in the output. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • outputAction

      The action to take when harmful content is detected in the output. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Parameters:
      outputAction - The action to take when harmful content is detected in the output. Supported values include:

      • BLOCK – Block the content and replace it with blocked messaging.

      • NONE – Take no action but return detection information in the trace response.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • inputEnabled

      GuardrailRegex.Builder inputEnabled(Boolean inputEnabled)

      Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.

      Parameters:
      inputEnabled - Indicates whether guardrail evaluation is enabled on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • outputEnabled

      GuardrailRegex.Builder outputEnabled(Boolean outputEnabled)

      Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.

      Parameters:
      outputEnabled - Indicates whether guardrail evaluation is enabled on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.