Skip to main content

mistral_openapi_client/models/
ocr_response.rs

1/*
2 * Mistral AI API
3 *
4 * Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OcrResponse {
16    /// List of OCR info for pages.
17    #[serde(rename = "pages")]
18    pub pages: Vec<models::OcrPageObject>,
19    /// The model used to generate the OCR.
20    #[serde(rename = "model")]
21    pub model: String,
22    #[serde(rename = "document_annotation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub document_annotation: Option<Option<String>>,
24    /// Usage info for the OCR request.
25    #[serde(rename = "usage_info")]
26    pub usage_info: Box<models::OcrUsageInfo>,
27}
28
29impl OcrResponse {
30    pub fn new(pages: Vec<models::OcrPageObject>, model: String, usage_info: models::OcrUsageInfo) -> OcrResponse {
31        OcrResponse {
32            pages,
33            model,
34            document_annotation: None,
35            usage_info: Box::new(usage_info),
36        }
37    }
38}
39