Class: OpenAI::Models::Moderation
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Moderation
- Defined in:
- lib/openai/models/moderation.rb,
sig/openai/models/moderation.rbs
Defined Under Namespace
Classes: Categories, CategoryAppliedInputTypes, CategoryScores
Instance Attribute Summary collapse
-
#categories ⇒ OpenAI::Moderation::Categories
A list of the categories, and whether they are flagged or not.
-
#category_applied_input_types ⇒ OpenAI::Moderation::CategoryAppliedInputTypes
A list of the categories along with the input type(s) that the score applies to.
-
#category_scores ⇒ OpenAI::Moderation::CategoryScores
A list of the categories along with their scores as predicted by model.
-
#flagged ⇒ Boolean
Whether any of the below categories are flagged.
Attributes inherited from Internal::Type::BaseModel
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(harassment:, harassment_threatening:, hate:, hate_threatening:, illicit:, illicit_violent:, self_harm:, self_harm_instructions:, self_harm_intent:, sexual:, sexual_minors:, violence:, violence_graphic:) ⇒ Moderation
constructor
A new instance of Moderation.
- #to_hash ⇒ { categories: OpenAI::Moderation::Categories, category_applied_input_types: OpenAI::Moderation::CategoryAppliedInputTypes, category_scores: OpenAI::Moderation::CategoryScores, flagged: bool }
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(harassment:, harassment_threatening:, hate:, hate_threatening:, illicit:, illicit_violent:, self_harm:, self_harm_instructions:, self_harm_intent:, sexual:, sexual_minors:, violence:, violence_graphic:) ⇒ Moderation
Returns a new instance of Moderation.
|
|
# File 'lib/openai/models/moderation.rb', line 30
|
Instance Attribute Details
#categories ⇒ OpenAI::Moderation::Categories
A list of the categories, and whether they are flagged or not.
10 |
# File 'lib/openai/models/moderation.rb', line 10 required :categories, -> { OpenAI::Moderation::Categories } |
#category_applied_input_types ⇒ OpenAI::Moderation::CategoryAppliedInputTypes
A list of the categories along with the input type(s) that the score applies to.
16 |
# File 'lib/openai/models/moderation.rb', line 16 required :category_applied_input_types, -> { OpenAI::Moderation::CategoryAppliedInputTypes } |
#category_scores ⇒ OpenAI::Moderation::CategoryScores
A list of the categories along with their scores as predicted by model.
22 |
# File 'lib/openai/models/moderation.rb', line 22 required :category_scores, -> { OpenAI::Moderation::CategoryScores } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/moderation.rb', line 503
|
Instance Method Details
#to_hash ⇒ { categories: OpenAI::Moderation::Categories, category_applied_input_types: OpenAI::Moderation::CategoryAppliedInputTypes, category_scores: OpenAI::Moderation::CategoryScores, flagged: bool }
39 40 41 42 43 44 |
# File 'sig/openai/models/moderation.rbs', line 39
def to_hash: -> {
categories: OpenAI::Moderation::Categories,
category_applied_input_types: OpenAI::Moderation::CategoryAppliedInputTypes,
category_scores: OpenAI::Moderation::CategoryScores,
flagged: bool
}
|