openai-types 0.1.3

Typed OpenAI API models — zero dependencies beyond serde
Documentation
// AUTO-GENERATED by py2rust — do not edit.
// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
// Domain: moderation
#![allow(unused_imports)]

use serde::{Deserialize, Serialize};
use super::*;

/// A list of the categories along with the input type(s) that the score applies to.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct CategoryAppliedInputTypes {
    /// The applied input type(s) for the category 'harassment'.
    pub harassment: Vec<String>,
    /// The applied input type(s) for the category 'harassment/threatening'.
    #[serde(rename = "harassment/threatening")]
    pub harassment_threatening: Vec<String>,
    /// The applied input type(s) for the category 'hate'.
    pub hate: Vec<String>,
    /// The applied input type(s) for the category 'hate/threatening'.
    #[serde(rename = "hate/threatening")]
    pub hate_threatening: Vec<String>,
    /// The applied input type(s) for the category 'illicit'.
    pub illicit: Vec<String>,
    /// The applied input type(s) for the category 'illicit/violent'.
    #[serde(rename = "illicit/violent")]
    pub illicit_violent: Vec<String>,
    /// The applied input type(s) for the category 'self-harm'.
    #[serde(rename = "self-harm")]
    pub self_harm: Vec<serde_json::Value>,
    /// The applied input type(s) for the category 'self-harm/instructions'.
    #[serde(rename = "self-harm/instructions")]
    pub self_harm_instructions: Vec<serde_json::Value>,
    /// The applied input type(s) for the category 'self-harm/intent'.
    #[serde(rename = "self-harm/intent")]
    pub self_harm_intent: Vec<serde_json::Value>,
    /// The applied input type(s) for the category 'sexual'.
    pub sexual: Vec<serde_json::Value>,
    /// The applied input type(s) for the category 'sexual/minors'.
    #[serde(rename = "sexual/minors")]
    pub sexual_minors: Vec<String>,
    /// The applied input type(s) for the category 'violence'.
    pub violence: Vec<serde_json::Value>,
    /// The applied input type(s) for the category 'violence/graphic'.
    #[serde(rename = "violence/graphic")]
    pub violence_graphic: Vec<serde_json::Value>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ModerationCreateParams {
    /// Input (or inputs) to classify.
    pub input: serde_json::Value,
    /// The content moderation model you would like to use.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum ModerationModel {
    #[serde(rename = "omni-moderation-latest")]
    OmniModerationLatest,
    #[serde(rename = "omni-moderation-2024-09-26")]
    OmniModeration20240926,
    #[serde(rename = "text-moderation-latest")]
    TextModerationLatest,
    #[serde(rename = "text-moderation-stable")]
    TextModerationStable,
}