From 5826573d5c5691cad5e9f4795468a1cdb54e28a7 Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 17 Aug 2026 15:16:32 -0400 Subject: [PATCH] Added official file support --- package.json | 2 +- src/llm.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 23fb7ce..90018cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/ai-utils", - "version": "1.6.0", + "version": "1.6.1", "description": "AI Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/llm.ts b/src/llm.ts index 26a38a8..e19d9bd 100644 --- a/src/llm.ts +++ b/src/llm.ts @@ -50,6 +50,8 @@ export type LLMMessage = { role: 'assistant' | 'system' | 'user'; /** Message content */ content: string | any; + /** Files attached to request */ + files?: LLMFile[]; /** Timestamp */ timestamp?: number; /** Response duration in ms */ @@ -487,6 +489,7 @@ Linked: ${makeUnique([...r.links, ...r.backlinks]).join(', ')} const lastMsg = history[history.length - 1]; const originalContent = lastMsg?.content; if(files.length && lastMsg?.role === 'user') { + lastMsg.files = files; const {text, images} = await this.resolveFiles(files); const merged = text ? `${originalContent}\n\n${text}` : originalContent; lastMsg.content = images.length