add vision analysis service with prompt versioning, response schema, and structured JSON output

This commit is contained in:
2026-09-22 15:14:28 +02:00
parent 72e429b1b3
commit 99a3277e64
10 changed files with 380 additions and 71 deletions
+9
View File
@@ -14,6 +14,15 @@ export function initializeAttachments(db) {
position INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(message_id, attachment_id)
);
CREATE INDEX IF NOT EXISTS attachment_references ON message_attachments(attachment_id);
CREATE TABLE IF NOT EXISTS attachment_vision_analyses (
attachment_id TEXT NOT NULL REFERENCES attachments(id) ON DELETE CASCADE,
vision_model TEXT NOT NULL,
prompt_version INTEGER NOT NULL,
question TEXT NOT NULL,
analysis TEXT NOT NULL,
analyzed_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (attachment_id, vision_model, prompt_version, question)
);
CREATE TABLE IF NOT EXISTS upload_deletions (storage_key TEXT PRIMARY KEY);
CREATE TRIGGER IF NOT EXISTS release_message_attachment AFTER DELETE ON message_attachments
BEGIN