Class: SafetyKit::Resources::Content
- Inherits:
-
Object
- Object
- SafetyKit::Resources::Content
- Defined in:
- lib/safety_kit/resources/content.rb,
sig/safety_kit/resources/content.rbs
Overview
Classify user-authored text and images synchronously and receive a decision in the response.
Instance Method Summary collapse
-
#create(user_id:, content_id: nil, images: nil, metadata: nil, text: nil, request_options: {}) ⇒ SafetyKit::Models::ContentCreateResponse
Some parameter documentations has been truncated, see Models::ContentCreateParams for more details.
-
#initialize(client:) ⇒ Content
constructor
private
A new instance of Content.
Constructor Details
#initialize(client:) ⇒ Content
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 Content.
46 47 48 |
# File 'lib/safety_kit/resources/content.rb', line 46 def initialize(client:) @client = client end |
Instance Method Details
#create(user_id:, content_id: nil, images: nil, metadata: nil, text: nil, request_options: {}) ⇒ SafetyKit::Models::ContentCreateResponse
Some parameter documentations has been truncated, see Models::ContentCreateParams for more details.
Classify a piece of content synchronously. Send user-authored text, images, or both, and receive per-policy results in the response. Requests have a maximum size of 6MB.
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/safety_kit/resources/content.rb', line 32 def create(params) parsed, = SafetyKit::ContentCreateParams.dump_request(params) @client.request( method: :post, path: "v1/content", body: parsed, model: SafetyKit::Models::ContentCreateResponse, options: ) end |