Skip to main content

openai_types/moderation/
_gen.rs

1// AUTO-GENERATED by py2rust — do not edit.
2// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
3// Domain: moderation
4#![allow(unused_imports)]
5
6use serde::{Deserialize, Serialize};
7use super::*;
8
9/// A list of the categories along with the input type(s) that the score applies to.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
12pub struct CategoryAppliedInputTypes {
13    /// The applied input type(s) for the category 'harassment'.
14    pub harassment: Vec<String>,
15    /// The applied input type(s) for the category 'harassment/threatening'.
16    #[serde(rename = "harassment/threatening")]
17    pub harassment_threatening: Vec<String>,
18    /// The applied input type(s) for the category 'hate'.
19    pub hate: Vec<String>,
20    /// The applied input type(s) for the category 'hate/threatening'.
21    #[serde(rename = "hate/threatening")]
22    pub hate_threatening: Vec<String>,
23    /// The applied input type(s) for the category 'illicit'.
24    pub illicit: Vec<String>,
25    /// The applied input type(s) for the category 'illicit/violent'.
26    #[serde(rename = "illicit/violent")]
27    pub illicit_violent: Vec<String>,
28    /// The applied input type(s) for the category 'self-harm'.
29    #[serde(rename = "self-harm")]
30    pub self_harm: Vec<serde_json::Value>,
31    /// The applied input type(s) for the category 'self-harm/instructions'.
32    #[serde(rename = "self-harm/instructions")]
33    pub self_harm_instructions: Vec<serde_json::Value>,
34    /// The applied input type(s) for the category 'self-harm/intent'.
35    #[serde(rename = "self-harm/intent")]
36    pub self_harm_intent: Vec<serde_json::Value>,
37    /// The applied input type(s) for the category 'sexual'.
38    pub sexual: Vec<serde_json::Value>,
39    /// The applied input type(s) for the category 'sexual/minors'.
40    #[serde(rename = "sexual/minors")]
41    pub sexual_minors: Vec<String>,
42    /// The applied input type(s) for the category 'violence'.
43    pub violence: Vec<serde_json::Value>,
44    /// The applied input type(s) for the category 'violence/graphic'.
45    #[serde(rename = "violence/graphic")]
46    pub violence_graphic: Vec<serde_json::Value>,
47}
48
49#[derive(Debug, Clone, Serialize, Deserialize)]
50#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
51pub struct ModerationCreateParams {
52    /// Input (or inputs) to classify.
53    pub input: serde_json::Value,
54    /// The content moderation model you would like to use.
55    #[serde(skip_serializing_if = "Option::is_none", default)]
56    pub model: Option<String>,
57}
58
59#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
60#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
61#[non_exhaustive]
62pub enum ModerationModel {
63    #[serde(rename = "omni-moderation-latest")]
64    OmniModerationLatest,
65    #[serde(rename = "omni-moderation-2024-09-26")]
66    OmniModeration20240926,
67    #[serde(rename = "text-moderation-latest")]
68    TextModerationLatest,
69    #[serde(rename = "text-moderation-stable")]
70    TextModerationStable,
71}