Class: ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput

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

Defined Under Namespace

Classes: Label

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

#initializeObject



536
# File 'sig/moderation_api/models/content_submit_response.rbs', line 536

def initialize: (

Instance Attribute Details

#dataHash{Symbol=>Object}?

Optional structured data produced by the policy. For face detection: { count, faces: [{ confidence, gender, age }] }.

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


719
# File 'lib/moderation_api/models/content_submit_response.rb', line 719

optional :data, ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown]

#flaggedBoolean

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


702
# File 'lib/moderation_api/models/content_submit_response.rb', line 702

required :flagged, ModerationAPI::Internal::Type::Boolean

#flagged_fieldsArray<String>?

The keys of the flagged fields if submitting an object.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


725
# File 'lib/moderation_api/models/content_submit_response.rb', line 725

optional :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String]

#idString

The unique identifier for the classifier output.

Parameters:

  • value (String)

Returns:

  • (String)


697
# File 'lib/moderation_api/models/content_submit_response.rb', line 697

required :id, String

#labelsArray<ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label>?



730
731
# File 'lib/moderation_api/models/content_submit_response.rb', line 730

optional :labels,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label] }

#probabilityFloat

Parameters:

  • value (Float)

Returns:

  • (Float)


707
# File 'lib/moderation_api/models/content_submit_response.rb', line 707

required :probability, Float

#typeSymbol, :classifier

Parameters:

  • value (:classifier)

Returns:

  • (Symbol, :classifier)


712
# File 'lib/moderation_api/models/content_submit_response.rb', line 712

required :type, const: :classifier

Instance Method Details

#to_hash{

Returns:

  • ({)


546
# File 'sig/moderation_api/models/content_submit_response.rbs', line 546

def to_hash: -> {