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:



52
53
54
# File 'lib/safety_kit/resources/agent_decisions.rb', line 52

def initialize(client:)
  @client = client
end

Instance Method Details

#create_agent_decision(content_type:, decision:, policy_id:, reference_id:, action: nil, agent_type: 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 feedback lets SafetyKit measure and improve automated decisions over time. Each request provides feedback for one content object and one policy category. If a content object is reviewed for multiple policy categories, send one request per policy category.

Parameters:

  • content_type (String)

    The SafetyKit data namespace or content type for the content being reviewed

  • decision (String)

    The human reviewer’s verdict for the policy category.

  • policy_id (String)

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

  • reference_id (String)

    Stable identifier for the content object in your system

  • action (String)

    Optional correct enforcement action for this content, such as ‘reduce_visibility

  • agent_type (String)

    Optional type of review that produced this decision, such as ‘appeal’, ‘bpo_revi

  • comment (String, nil)

    Additional context or details from the human reviewer

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

Returns:

See Also:



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

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