Skip to main content

mistral_openapi_client/models/
ocr_table_object.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 OcrTableObject {
16    /// Table ID for extracted table in a page
17    #[serde(rename = "id")]
18    pub id: String,
19    /// Content of the table in the given format
20    #[serde(rename = "content")]
21    pub content: String,
22    /// Format of the table
23    #[serde(rename = "format")]
24    pub format: Format,
25}
26
27impl OcrTableObject {
28    pub fn new(id: String, content: String, format: Format) -> OcrTableObject {
29        OcrTableObject {
30            id,
31            content,
32            format,
33        }
34    }
35}
36/// Format of the table
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Format {
39    #[serde(rename = "markdown")]
40    Markdown,
41    #[serde(rename = "html")]
42    Html,
43}
44
45impl Default for Format {
46    fn default() -> Format {
47        Self::Markdown
48    }
49}
50