Class: SafetyKit::Models::ContentCreateResponse::Score

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/safety_kit/models/content_create_response.rb,
sig/safety_kit/models/content_create_response.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(classifier_id:, score:, version:) ⇒ Object

Score produced by one classifier for the submitted content.

Parameters:

  • classifier_id (String)

    Identifier of the classifier that produced this score.

  • score (Float)

    Classifier score between 0 and 1. Higher means more likely violating.

  • version (String)

    Version of the classifier that produced this score.



# File 'lib/safety_kit/models/content_create_response.rb', line 147

Instance Attribute Details

#classifier_idString

Identifier of the classifier that produced this score.

Parameters:

  • value (String)

Returns:

  • (String)


133
# File 'lib/safety_kit/models/content_create_response.rb', line 133

required :classifier_id, String

#scoreFloat

Classifier score between 0 and 1. Higher means more likely violating.

Parameters:

  • value (Float)

Returns:

  • (Float)


139
# File 'lib/safety_kit/models/content_create_response.rb', line 139

required :score, Float

#versionString

Version of the classifier that produced this score.

Parameters:

  • value (String)

Returns:

  • (String)


145
# File 'lib/safety_kit/models/content_create_response.rb', line 145

required :version, String

Instance Method Details

#to_hash{ classifier_id: String, score: Float, version: String }

Returns:

  • ({ classifier_id: String, score: Float, version: String })


100
# File 'sig/safety_kit/models/content_create_response.rbs', line 100

def to_hash: -> { classifier_id: String, score: Float, version: String }