input: ModerationResult{ categories, category_applied_input_types, category_scores, 3 more} | Error{ code, message, type}

Moderation for the response input.

One of the following:
class ModerationResult { categories, category_applied_input_types, category_scores, 3 more }

A moderation result produced for the response input or output.

categories: Hash[Symbol, bool]

A dictionary of moderation categories to booleans, True if the input is flagged under this category.

category_applied_input_types: Hash[Symbol, Array[:text | :image]]

Which modalities of input are reflected by the score for each category.

One of the following:
:text
:image
category_scores: Hash[Symbol, Float]

A dictionary of moderation categories to scores.

flagged: bool

A boolean indicating whether the content was flagged by any category.

model: String

The moderation model that produced this result.

type: :moderation_result

The object type, which was always moderation_result for successful moderation results.

class Error { code, message, type }

An error produced while attempting moderation for the response input or output.

code: String

The error code.

message: String

The error message.

type: :error

The object type, which was always error for moderation failures.

output: ModerationResult{ categories, category_applied_input_types, category_scores, 3 more} | Error{ code, message, type}

Moderation for the response output.

One of the following:
class ModerationResult { categories, category_applied_input_types, category_scores, 3 more }

A moderation result produced for the response input or output.

categories: Hash[Symbol, bool]

A dictionary of moderation categories to booleans, True if the input is flagged under this category.

category_applied_input_types: Hash[Symbol, Array[:text | :image]]

Which modalities of input are reflected by the score for each category.

One of the following:
:text
:image
category_scores: Hash[Symbol, Float]

A dictionary of moderation categories to scores.

flagged: bool

A boolean indicating whether the content was flagged by any category.

model: String

The moderation model that produced this result.

type: :moderation_result

The object type, which was always moderation_result for successful moderation results.

class Error { code, message, type }

An error produced while attempting moderation for the response input or output.

code: String

The error code.

message: String

The error message.

type: :error

The object type, which was always error for moderation failures.