Class: Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb

Overview

Safety specification. There are two use cases:

  1. when only safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold will be applied for all categories.
  2. when safety_spec.enable is set and some safety_settings are set, only specified safety_settings are applied.

Defined Under Namespace

Classes: SafetySetting

Instance Attribute Summary collapse

Instance Attribute Details

#enable::Boolean

Returns Enable the safety filtering on the answer response. It is false by default.

Returns:

  • (::Boolean)

    Enable the safety filtering on the answer response. It is false by default.



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 333

class SafetySpec
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety settings.
  # @!attribute [rw] category
  #   @return [::Google::Cloud::DiscoveryEngine::V1::HarmCategory]
  #     Required. Harm category.
  # @!attribute [rw] threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting::HarmBlockThreshold]
  #     Required. The harm block threshold.
  class SafetySetting
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Probability based thresholds levels for blocking.
    module HarmBlockThreshold
      # Unspecified harm block threshold.
      HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0

      # Block low threshold and above (i.e. block more).
      BLOCK_LOW_AND_ABOVE = 1

      # Block medium threshold and above.
      BLOCK_MEDIUM_AND_ABOVE = 2

      # Block only high threshold (i.e. block less).
      BLOCK_ONLY_HIGH = 3

      # Block none.
      BLOCK_NONE = 4

      # Turn off the safety filter.
      OFF = 5
    end
  end
end

#safety_settings::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting>

Returns Optional. Safety settings. This settings are effective only when the safety_spec.enable is true.

Returns:



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 333

class SafetySpec
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety settings.
  # @!attribute [rw] category
  #   @return [::Google::Cloud::DiscoveryEngine::V1::HarmCategory]
  #     Required. Harm category.
  # @!attribute [rw] threshold
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting::HarmBlockThreshold]
  #     Required. The harm block threshold.
  class SafetySetting
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Probability based thresholds levels for blocking.
    module HarmBlockThreshold
      # Unspecified harm block threshold.
      HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0

      # Block low threshold and above (i.e. block more).
      BLOCK_LOW_AND_ABOVE = 1

      # Block medium threshold and above.
      BLOCK_MEDIUM_AND_ABOVE = 2

      # Block only high threshold (i.e. block less).
      BLOCK_ONLY_HIGH = 3

      # Block none.
      BLOCK_NONE = 4

      # Turn off the safety filter.
      OFF = 5
    end
  end
end