Skip to main content

uapi_sdk_rust/models/generated/
post_image_ocr_200_response.rs

1/*
2 * UAPI
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
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 PostImageOcr200Response {
16    /// 按阅读顺序拼接后的识别文本。
17    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
18    pub text: Option<String>,
19    /// 纯文本结果,适合做搜索、索引或直接展示。
20    #[serde(rename = "plain_text", skip_serializing_if = "Option::is_none")]
21    pub plain_text: Option<String>,
22    /// 根据图片中的标题、段落和表格整理出的 Markdown 文本。只有在 `return_markdown=true` 时才会返回。
23    #[serde(rename = "markdown", skip_serializing_if = "Option::is_none")]
24    pub markdown: Option<String>,
25    /// 逐段文字结果。适合做高亮、框选和逐项解析。
26    #[serde(rename = "words_result", skip_serializing_if = "Option::is_none")]
27    pub words_result: Option<Vec<models::PostImageOcr200ResponseWordsResultInner>>,
28    /// 识别出的文字片段数量。
29    #[serde(rename = "words_result_num", skip_serializing_if = "Option::is_none")]
30    pub words_result_num: Option<i32>,
31    /// 本次响应是否包含坐标信息。
32    #[serde(rename = "need_location", skip_serializing_if = "Option::is_none")]
33    pub need_location: Option<bool>,
34    /// 耗时拆分信息,适合做性能统计或排查。
35    #[serde(rename = "timing", skip_serializing_if = "Option::is_none")]
36    pub timing: Option<serde_json::Value>,
37    /// 识别结果的统计摘要。
38    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
39    pub summary: Option<serde_json::Value>,
40    /// 图片本身的基础信息。
41    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
42    pub image: Option<serde_json::Value>,
43    /// 按行组织的详细识别结果。
44    #[serde(rename = "lines", skip_serializing_if = "Option::is_none")]
45    pub lines: Option<Vec<serde_json::Value>>,
46    /// 按块组织的详细识别结果。
47    #[serde(rename = "blocks", skip_serializing_if = "Option::is_none")]
48    pub blocks: Option<Vec<serde_json::Value>>,
49    /// 按页组织的详细识别结果。
50    #[serde(rename = "pages", skip_serializing_if = "Option::is_none")]
51    pub pages: Option<Vec<serde_json::Value>>,
52    /// 补充识别结果对象,适合需要继续解析更多细节字段的场景。
53    #[serde(rename = "raw", skip_serializing_if = "Option::is_none")]
54    pub raw: Option<serde_json::Value>,
55}
56
57impl PostImageOcr200Response {
58    pub fn new() -> PostImageOcr200Response {
59        PostImageOcr200Response {
60            text: None,
61            plain_text: None,
62            markdown: None,
63            words_result: None,
64            words_result_num: None,
65            need_location: None,
66            timing: None,
67            summary: None,
68            image: None,
69            lines: None,
70            blocks: None,
71            pages: None,
72            raw: None,
73        }
74    }
75}
76