Compare commits

..

1 Commits
1.6.0 ... 1.6.1

Author SHA1 Message Date
5826573d5c Added official file support
All checks were successful
Publish Library / Build NPM Project (push) Successful in 50s
Publish Library / Tag Version (push) Successful in 13s
2026-08-17 15:16:32 -04:00
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@ztimson/ai-utils", "name": "@ztimson/ai-utils",
"version": "1.6.0", "version": "1.6.1",
"description": "AI Utility library", "description": "AI Utility library",
"author": "Zak Timson", "author": "Zak Timson",
"license": "MIT", "license": "MIT",

View File

@@ -50,6 +50,8 @@ export type LLMMessage = {
role: 'assistant' | 'system' | 'user'; role: 'assistant' | 'system' | 'user';
/** Message content */ /** Message content */
content: string | any; content: string | any;
/** Files attached to request */
files?: LLMFile[];
/** Timestamp */ /** Timestamp */
timestamp?: number; timestamp?: number;
/** Response duration in ms */ /** Response duration in ms */
@@ -487,6 +489,7 @@ Linked: ${makeUnique([...r.links, ...r.backlinks]).join(', ')}
const lastMsg = history[history.length - 1]; const lastMsg = history[history.length - 1];
const originalContent = lastMsg?.content; const originalContent = lastMsg?.content;
if(files.length && lastMsg?.role === 'user') { if(files.length && lastMsg?.role === 'user') {
lastMsg.files = files;
const {text, images} = await this.resolveFiles(files); const {text, images} = await this.resolveFiles(files);
const merged = text ? `${originalContent}\n\n${text}` : originalContent; const merged = text ? `${originalContent}\n\n${text}` : originalContent;
lastMsg.content = images.length lastMsg.content = images.length