Class: OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult
- 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
-
#categories ⇒ ::Hash[Symbol, bool]
A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
#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.
-
#category_scores ⇒ ::Hash[Symbol, Float]
A dictionary of moderation categories to scores.
-
#flagged ⇒ Boolean
A boolean indicating whether the content was flagged by any category.
-
#model ⇒ String
The moderation model that produced this result.
-
#type ⇒ :moderation_result
The object type, which was always
moderation_resultfor successful moderation results.
Attributes inherited from Internal::Type::BaseModel
Instance Method Summary collapse
-
#initialize ⇒ ModerationResult
constructor
A new instance of ModerationResult.
- #to_hash ⇒ { categories: ::Hash[Symbol, bool], category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult::category_applied_input_type]], category_scores: ::Hash[Symbol, Float], flagged: bool, model: String, ?type: :moderation_result }
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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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 ⇒ ModerationResult
Returns a new instance of ModerationResult.
1201 1202 1203 1204 1205 1206 1207 1208 |
# File 'sig/openai/models/beta/beta_response.rbs', line 1201 def initialize: ( categories: ::Hash[Symbol, bool], category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult::category_applied_input_type]], category_scores: ::Hash[Symbol, Float], flagged: bool, model: String, ?type: :moderation_result ) -> void |
Instance Attribute Details
#categories ⇒ ::Hash[Symbol, bool]
A dictionary of moderation categories to booleans, True if the input is flagged under this category.
1550 |
# File 'lib/openai/models/beta/beta_response.rb', line 1550 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.
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 |
# File 'lib/openai/models/beta/beta_response.rb', line 1556 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.
1571 |
# File 'lib/openai/models/beta/beta_response.rb', line 1571 required :category_scores, OpenAI::Internal::Type::HashOf[Float] |
#flagged ⇒ Boolean
A boolean indicating whether the content was flagged by any category.
1577 |
# File 'lib/openai/models/beta/beta_response.rb', line 1577 required :flagged, OpenAI::Internal::Type::Boolean |
#model ⇒ String
The moderation model that produced this result.
1583 |
# File 'lib/openai/models/beta/beta_response.rb', line 1583 required :model, String |
#type ⇒ :moderation_result
The object type, which was always moderation_result for successful moderation
results.
1590 |
# File 'lib/openai/models/beta/beta_response.rb', line 1590 required :type, const: :moderation_result |
Instance Method Details
#to_hash ⇒ { categories: ::Hash[Symbol, bool], category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult::category_applied_input_type]], category_scores: ::Hash[Symbol, Float], flagged: bool, model: String, ?type: :moderation_result }
1210 1211 1212 1213 1214 1215 1216 1217 |
# File 'sig/openai/models/beta/beta_response.rbs', line 1210 def to_hash: -> { categories: ::Hash[Symbol, bool], category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Beta::BetaResponse::Moderation::Input::ModerationResult::category_applied_input_type]], category_scores: ::Hash[Symbol, Float], flagged: bool, model: String, ?type: :moderation_result } |