Class: Google::Cloud::Ces::V1::Guardrail::ModelSafety

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

Overview

Model safety settings overrides. When this is set, it will override the default settings and trigger the guardrail if the response is considered unsafe.

Defined Under Namespace

Modules: HarmBlockThreshold, HarmCategory Classes: SafetySetting

Instance Attribute Summary collapse

Instance Attribute Details

#safety_settings::Array<::Google::Cloud::Ces::V1::Guardrail::ModelSafety::SafetySetting>

Returns Required. List of safety settings.

Returns:



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'proto_docs/google/cloud/ces/v1/guardrail.rb', line 224

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

  # Safety setting.
  # @!attribute [rw] category
  #   @return [::Google::Cloud::Ces::V1::Guardrail::ModelSafety::HarmCategory]
  #     Required. The harm category.
  # @!attribute [rw] threshold
  #   @return [::Google::Cloud::Ces::V1::Guardrail::ModelSafety::HarmBlockThreshold]
  #     Required. The harm block threshold.
  class SafetySetting
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Harm category.
  module HarmCategory
    # The harm category is unspecified.
    HARM_CATEGORY_UNSPECIFIED = 0

    # The harm category is hate speech.
    HARM_CATEGORY_HATE_SPEECH = 1

    # The harm category is dangerous content.
    HARM_CATEGORY_DANGEROUS_CONTENT = 2

    # The harm category is harassment.
    HARM_CATEGORY_HARASSMENT = 3

    # The harm category is sexually explicit content.
    HARM_CATEGORY_SEXUALLY_EXPLICIT = 4
  end

  # 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