From 555061b179b8ec034cb70f9a2dd6c823ced0f637 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 23 Dec 2025 14:43:23 +0000 Subject: Add file body and initial tool call system --- makima/src/db/models.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'makima/src/db/models.rs') diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs index 45b0e53..135ae75 100644 --- a/makima/src/db/models.rs +++ b/makima/src/db/models.rs @@ -18,6 +18,40 @@ pub struct TranscriptEntry { pub is_final: bool, } +/// Chart type for visualization elements +#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub enum ChartType { + Line, + Bar, + Pie, + Area, +} + +/// Body element types for structured file content +#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[serde(tag = "type", rename_all = "camelCase")] +pub enum BodyElement { + /// Heading element (h1-h6) + Heading { level: u8, text: String }, + /// Paragraph text + Paragraph { text: String }, + /// Chart visualization + Chart { + #[serde(rename = "chartType")] + chart_type: ChartType, + title: Option, + data: serde_json::Value, + config: Option, + }, + /// Image element (deferred for MVP) + Image { + src: String, + alt: Option, + caption: Option, + }, +} + /// File record from the database. #[derive(Debug, Clone, FromRow, Serialize, ToSchema)] #[serde(rename_all = "camelCase")] @@ -29,6 +63,11 @@ pub struct File { #[sqlx(json)] pub transcript: Vec, pub location: Option, + /// AI-generated summary of the transcript + pub summary: Option, + /// Structured body content (headings, paragraphs, charts) + #[sqlx(json)] + pub body: Vec, pub created_at: DateTime, pub updated_at: DateTime, } @@ -57,6 +96,10 @@ pub struct UpdateFileRequest { pub description: Option, /// New transcript (optional) pub transcript: Option>, + /// AI-generated summary (optional) + pub summary: Option, + /// Structured body content (optional) + pub body: Option>, } /// Response for file list endpoint. -- cgit v1.2.3