mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 01:00:25 +00:00
Add blockImages setting to prevent images from being sent to LLM providers
- Setting controls filtering at convertToLlm layer (defense-in-depth) - Images are always stored in session, filtered dynamically based on current setting - Toggle mid-session works: LLM sees/doesn't see images already in session - Fixed SettingsManager.save() to handle inMemory mode for all setters Closes #492
This commit is contained in:
parent
b582a6b70d
commit
1fc2a912d4
8 changed files with 80 additions and 127 deletions
|
|
@ -18,8 +18,6 @@ export interface ProcessedFiles {
|
|||
export interface ProcessFileOptions {
|
||||
/** Whether to auto-resize images to 2000x2000 max. Default: true */
|
||||
autoResizeImages?: boolean;
|
||||
/** When true, skip image files with warning. Default: false */
|
||||
blockImages?: boolean;
|
||||
}
|
||||
|
||||
/** Process @file arguments into text content and image attachments */
|
||||
|
|
@ -50,11 +48,6 @@ export async function processFileArguments(fileArgs: string[], options?: Process
|
|||
const mimeType = await detectSupportedImageMimeTypeFromFile(absolutePath);
|
||||
|
||||
if (mimeType) {
|
||||
// Check if images are blocked
|
||||
if (options?.blockImages) {
|
||||
console.warn(chalk.yellow(`[blockImages] Skipping image file: ${absolutePath}`));
|
||||
continue;
|
||||
}
|
||||
// Handle image file
|
||||
const content = await readFile(absolutePath);
|
||||
const base64Content = content.toString("base64");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue