Class: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result
- Defined in:
- lib/openai/models/chat/chat_completion_chunk.rb
Defined Under Namespace
Modules: CategoryAppliedInputType
Instance Attribute Summary collapse
-
#categories ⇒ Hash{Symbol=>Boolean}
A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
#category_applied_input_types ⇒ Hash{Symbol=>Array<Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::CategoryAppliedInputType>}
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 ⇒ Symbol, :moderation_result
The object type, which was always ‘moderation_result` for successful moderation results.
Instance Method Summary collapse
-
#initialize(model:, results:, type: :moderation_results) ⇒ Object
constructor
Successful moderation results for the request input or generated output.
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(model:, results:, type: :moderation_results) ⇒ Object
Successful moderation results for the request input or generated output.
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 |
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 448 class Result < OpenAI::Internal::Type::BaseModel # @!attribute categories # A dictionary of moderation categories to booleans, True if the input is flagged # under this category. # # @return [Hash{Symbol=>Boolean}] required :categories, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Boolean] # @!attribute category_applied_input_types # Which modalities of input are reflected by the score for each category. # # @return [Hash{Symbol=>Array<Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::CategoryAppliedInputType>}] required :category_applied_input_types, -> do OpenAI::Internal::Type::HashOf[ OpenAI::Internal::Type::ArrayOf[ enum: OpenAI::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::CategoryAppliedInputType ] ] end # @!attribute category_scores # A dictionary of moderation categories to scores. # # @return [Hash{Symbol=>Float}] required :category_scores, OpenAI::Internal::Type::HashOf[Float] # @!attribute flagged # A boolean indicating whether the content was flagged by any category. # # @return [Boolean] required :flagged, OpenAI::Internal::Type::Boolean # @!attribute model # The moderation model that produced this result. # # @return [String] required :model, String # @!attribute type # The object type, which was always `moderation_result` for successful moderation # results. # # @return [Symbol, :moderation_result] required :type, const: :moderation_result # @!method initialize(categories:, category_applied_input_types:, category_scores:, flagged:, model:, type: :moderation_result) # Some parameter documentations has been truncated, see # {OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result} # for more details. # # A moderation result produced for the response input or output. # # @param categories [Hash{Symbol=>Boolean}] A dictionary of moderation categories to booleans, True if the input is flagged # # @param category_applied_input_types [Hash{Symbol=>Array<Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::CategoryAppliedInputType>}] Which modalities of input are reflected by the score for each category. # # @param category_scores [Hash{Symbol=>Float}] A dictionary of moderation categories to scores. # # @param flagged [Boolean] A boolean indicating whether the content was flagged by any category. # # @param model [String] The moderation model that produced this result. # # @param type [Symbol, :moderation_result] The object type, which was always `moderation_result` for successful moderation module CategoryAppliedInputType extend OpenAI::Internal::Type::Enum TEXT = :text IMAGE = :image # @!method self.values # @return [Array<Symbol>] end end |
Instance Attribute Details
#categories ⇒ Hash{Symbol=>Boolean}
A dictionary of moderation categories to booleans, True if the input is flagged under this category.
454 |
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 454 required :categories, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Boolean] |
#category_applied_input_types ⇒ Hash{Symbol=>Array<Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::CategoryAppliedInputType>}
Which modalities of input are reflected by the score for each category.
460 461 462 463 464 465 466 467 |
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 460 required :category_applied_input_types, -> do OpenAI::Internal::Type::HashOf[ OpenAI::Internal::Type::ArrayOf[ enum: OpenAI::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::CategoryAppliedInputType ] ] end |
#category_scores ⇒ Hash{Symbol=>Float}
A dictionary of moderation categories to scores.
473 |
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 473 required :category_scores, OpenAI::Internal::Type::HashOf[Float] |
#flagged ⇒ Boolean
A boolean indicating whether the content was flagged by any category.
479 |
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 479 required :flagged, OpenAI::Internal::Type::Boolean |
#model ⇒ String
The moderation model that produced this result.
485 |
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 485 required :model, String |
#type ⇒ Symbol, :moderation_result
The object type, which was always ‘moderation_result` for successful moderation results.
492 |
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 492 required :type, const: :moderation_result |