Class: SafetyKit::Models::ContentCreateResponse::Policy
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- SafetyKit::Models::ContentCreateResponse::Policy
- Defined in:
- lib/safety_kit/models/content_create_response.rb,
sig/safety_kit/models/content_create_response.rbs
Defined Under Namespace
Modules: Decision, Escalation
Instance Attribute Summary collapse
-
#decision ⇒ Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Decision
Whether the submitted content violates the policy.
-
#escalation ⇒ Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Escalation
Escalation outcome for this policy.
-
#policy_id ⇒ String
Identifier of the policy.
-
#score ⇒ Float?
Classifier score between 0 and 1.
-
#version ⇒ String
Version of the policy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(decision:, escalation:, policy_id:, score:, version:) ⇒ Object
constructor
Some parameter documentations has been truncated, see Policy for more details.
- #to_hash ⇒ {
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(decision:, escalation:, policy_id:, score:, version:) ⇒ Object
Some parameter documentations has been truncated, see SafetyKit::Models::ContentCreateResponse::Policy for more details.
Result for one policy evaluated against the submitted content.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/safety_kit/models/content_create_response.rb', line 44 class Policy < SafetyKit::Internal::Type::BaseModel # @!attribute decision # Whether the submitted content violates the policy. # # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Decision] required :decision, enum: -> { SafetyKit::Models::ContentCreateResponse::Policy::Decision } # @!attribute escalation # Escalation outcome for this policy. # # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Escalation] required :escalation, enum: -> { SafetyKit::Models::ContentCreateResponse::Policy::Escalation } # @!attribute policy_id # Identifier of the policy. # # @return [String] required :policy_id, String # @!attribute score # Classifier score between 0 and 1. Higher means more likely violating. Null when # no classifier scored the policy. # # @return [Float, nil] required :score, Float, nil?: true # @!attribute version # Version of the policy. # # @return [String] required :version, String # @!method initialize(decision:, escalation:, policy_id:, score:, version:) # Some parameter documentations has been truncated, see # {SafetyKit::Models::ContentCreateResponse::Policy} for more details. # # Result for one policy evaluated against the submitted content. # # @param decision [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Decision] Whether the submitted content violates the policy. # # @param escalation [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Escalation] Escalation outcome for this policy. # # @param policy_id [String] Identifier of the policy. # # @param score [Float, nil] Classifier score between 0 and 1. Higher means more likely violating. Null when # # @param version [String] Version of the policy. # Whether the submitted content violates the policy. # # @see SafetyKit::Models::ContentCreateResponse::Policy#decision module Decision extend SafetyKit::Internal::Type::Enum MATCH = :match NOT_MATCH = :not_match REVIEW = :review # @!method self.values # @return [Array<Symbol>] end # Escalation outcome for this policy. # # @see SafetyKit::Models::ContentCreateResponse::Policy#escalation module Escalation extend SafetyKit::Internal::Type::Enum NONE = :none COMPLETED = :completed ERROR = :error # @!method self.values # @return [Array<Symbol>] end end |
Instance Attribute Details
#decision ⇒ Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Decision
Whether the submitted content violates the policy.
49 |
# File 'lib/safety_kit/models/content_create_response.rb', line 49 required :decision, enum: -> { SafetyKit::Models::ContentCreateResponse::Policy::Decision } |
#escalation ⇒ Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Escalation
Escalation outcome for this policy.
55 |
# File 'lib/safety_kit/models/content_create_response.rb', line 55 required :escalation, enum: -> { SafetyKit::Models::ContentCreateResponse::Policy::Escalation } |
#policy_id ⇒ String
Identifier of the policy.
61 |
# File 'lib/safety_kit/models/content_create_response.rb', line 61 required :policy_id, String |
#score ⇒ Float?
Classifier score between 0 and 1. Higher means more likely violating. Null when no classifier scored the policy.
68 |
# File 'lib/safety_kit/models/content_create_response.rb', line 68 required :score, Float, nil?: true |
#version ⇒ String
Version of the policy.
74 |
# File 'lib/safety_kit/models/content_create_response.rb', line 74 required :version, String |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/safety_kit/models/content_create_response.rb', line 102
|
Instance Method Details
#to_hash ⇒ {
62 |
# File 'sig/safety_kit/models/content_create_response.rbs', line 62
def to_hash: -> {
|