// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Public create-classification request body.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClassificationRequest {
    /// The document to classify
    pub document: MimeData,
    /// The categories to classify the document into
    pub categories: Vec<Category>,
    /// The model to use for classification
    ///
    /// Defaults to `retab-small`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    /// Only use the first N pages of the document for classification. Useful for large documents where classification can be determined from early pages.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub first_n_pages: Option<i64>,
    /// Free-form instructions appended to the system prompt to steer the classification.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub instructions: Option<String>,
    /// Number of classification runs to use for consensus voting. Uses deterministic single-pass when set to 1.
    ///
    /// Defaults to `1`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub n_consensus: Option<i64>,
    /// If true, skip the LLM cache and force a fresh completion
    ///
    /// Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub bust_cache: Option<bool>,
    /// If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1/<primitive>/{id} until status is terminal. Mutually exclusive with stream.
    ///
    /// Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub background: Option<bool>,
}
impl ClassificationRequest {
    /// Construct a new `ClassificationRequest` with the required fields set.
    #[allow(deprecated)]
    pub fn new<D: Into<crate::MimeData>>(document: D, categories: Vec<Category>) -> Self {
        Self {
            document: document.into(),
            categories,
            model: Default::default(),
            first_n_pages: Default::default(),
            instructions: Default::default(),
            n_consensus: Default::default(),
            bust_cache: Default::default(),
            background: Default::default(),
        }
    }
}
