Skip to main content

fetchium_core/multimodal/
mod.rs

1//! Multimodal content extraction — video, PDF, OCR, charts (PRD §42).
2
3pub mod chart;
4pub mod ocr;
5pub mod pdf;
6pub mod video;
7
8/// Unified multimodal content representation.
9#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
10pub struct MultimodalContent {
11    pub source_url: String,
12    pub content_type: ContentType,
13    pub text: String,
14    pub segments: Vec<MultimodalSegment>,
15    pub extracted_at: chrono::DateTime<chrono::Utc>,
16}
17
18#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
19#[serde(rename_all = "snake_case")]
20pub enum ContentType {
21    Video {
22        duration_secs: u32,
23        transcript_source: String,
24    },
25    Pdf {
26        page_count: u32,
27    },
28    Image {
29        width: u32,
30        height: u32,
31    },
32    Chart {
33        chart_type: String,
34        series_count: usize,
35    },
36}
37
38#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
39pub struct MultimodalSegment {
40    pub offset_ms: Option<u32>,
41    pub page: Option<u32>,
42    pub text: String,
43}