Class: SafetyKit::Resources::AgentDecisions

Inherits:
Object
  • Object
show all
Defined in:
lib/safety_kit/resources/agent_decisions.rb

Overview

Send human reviewer final verdicts to SafetyKit. This feedback improves the accuracy of SafetyKit’s automated decisions over time.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AgentDecisions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AgentDecisions.

Parameters:



50
51
52
# File 'lib/safety_kit/resources/agent_decisions.rb', line 50

def initialize(client:)
  @client = client
end

Instance Method Details

#create_agent_decision(content_type:, decision:, policy_id:, reference_id:, action: nil, comment: nil, request_options: {}) ⇒ SafetyKit::Models::AgentDecisionCreateAgentDecisionResponse

Some parameter documentations has been truncated, see Models::AgentDecisionCreateAgentDecisionParams for more details.

Record a human reviewer’s final verdict for content that SafetyKit has previously reviewed. This ground truth feedback allows SafetyKit to improve the accuracy of automated decisions. Each call provides feedback on whether a given piece of content violates a specific policy category. If content is reviewed for multiple policies, send one call per policy.

Parameters:

  • content_type (String)

    The dataapi namespace of the content being reviewed

  • decision (String)

    The human reviewer’s verdict on whether the content violates the specified polic

  • policy_id (String)

    The SafetyKit policy category ID that was evaluated, as configured for your acco

  • reference_id (String)

    The external id for the content being reviewed

  • action (String)

    The correct enforcement action for this content (e.g. ‘reduce_visibility’, ‘unpu

  • comment (String, nil)

    Additional context or details from the human reviewer

  • request_options (SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
# File 'lib/safety_kit/resources/agent_decisions.rb', line 36

def create_agent_decision(params)
  parsed, options = SafetyKit::AgentDecisionCreateAgentDecisionParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/agent_decisions",
    body: parsed,
    model: SafetyKit::Models::AgentDecisionCreateAgentDecisionResponse,
    options: options
  )
end