Class: OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/beta_response.rb,
sig/openai/models/beta/beta_response.rbs

Defined Under Namespace

Modules: CategoryAppliedInputType

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_with_error, 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

Parameters:

  • categories

    A dictionary of moderation categories to booleans, True if the input is flagged under this category.

  • category_applied_input_types

    Which modalities of input are reflected by the score for each category.

  • category_scores

    A dictionary of moderation categories to scores.

  • flagged

    A boolean indicating whether the content was flagged by any category.

  • model

    The moderation model that produced this result.

  • type

    The object type, which was always moderation_result for successful moderation results.



997
# File 'sig/openai/models/beta/beta_response.rbs', line 997

def initialize: (

Instance Attribute Details

#categories::Hash[Symbol, bool]

A dictionary of moderation categories to booleans, True if the input is flagged under this category.

Returns:

  • (::Hash[Symbol, bool])


1120
# File 'lib/openai/models/beta/beta_response.rb', line 1120

required :categories, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Boolean]

#category_applied_input_types::Hash[Symbol, ::Array[OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult::category_applied_input_type]]

Which modalities of input are reflected by the score for each category.

Returns:

  • (::Hash[Symbol, ::Array[OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult::category_applied_input_type]])


1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
# File 'lib/openai/models/beta/beta_response.rb', line 1126

required(
  :category_applied_input_types,
  -> do
    OpenAI::Internal::Type::HashOf[
      OpenAI::Internal::Type::ArrayOf[
        enum: OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType
      ]
    ]
  end
)

#category_scores::Hash[Symbol, Float]

A dictionary of moderation categories to scores.

Returns:

  • (::Hash[Symbol, Float])


1141
# File 'lib/openai/models/beta/beta_response.rb', line 1141

required :category_scores, OpenAI::Internal::Type::HashOf[Float]

#flaggedBoolean

A boolean indicating whether the content was flagged by any category.

Returns:



1147
# File 'lib/openai/models/beta/beta_response.rb', line 1147

required :flagged, OpenAI::Internal::Type::Boolean

#modelString

The moderation model that produced this result.

Returns:

  • (String)


1153
# File 'lib/openai/models/beta/beta_response.rb', line 1153

required :model, String

#type:moderation_result

The object type, which was always moderation_result for successful moderation results.

Returns:

  • (:moderation_result)


1160
# File 'lib/openai/models/beta/beta_response.rb', line 1160

required :type, const: :moderation_result

Instance Method Details

#to_hash{

Returns:

  • ({)


1006
# File 'sig/openai/models/beta/beta_response.rbs', line 1006

def to_hash: -> {