input: ModerationInput

Moderation for the response input.

One of the following:
class ModerationInputModerationResult:

A moderation result produced for the response input or output.

categories: Dict[str, bool]

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

category_applied_input_types: Dict[str, List[Literal["text", "image"]]]

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

One of the following:
"text"
"image"
category_scores: Dict[str, float]

A dictionary of moderation categories to scores.

flagged: bool

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

model: str

The moderation model that produced this result.

type: Literal["moderation_result"]

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

class ModerationInputError:

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

code: str

The error code.

message: str

The error message.

type: Literal["error"]

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

output: ModerationOutput

Moderation for the response output.

One of the following:
class ModerationOutputModerationResult:

A moderation result produced for the response input or output.

categories: Dict[str, bool]

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

category_applied_input_types: Dict[str, List[Literal["text", "image"]]]

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

One of the following:
"text"
"image"
category_scores: Dict[str, float]

A dictionary of moderation categories to scores.

flagged: bool

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

model: str

The moderation model that produced this result.

type: Literal["moderation_result"]

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

class ModerationOutputError:

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

code: str

The error code.

message: str

The error message.

type: Literal["error"]

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