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