/*
* OpenAI API
*
* The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
*
* The version of the OpenAPI document: 2.3.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// ModerationParam : Configuration for running moderation on the input and output of this response.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ModerationParam {
/// The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
#[serde(rename = "model")]
pub model: String,
}
impl ModerationParam {
/// Configuration for running moderation on the input and output of this response.
pub fn new(model: String) -> ModerationParam {
ModerationParam { model }
}
}
impl std::fmt::Display for ModerationParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}