add small model for title generation

This commit is contained in:
Dax Raad
2025-07-15 14:00:39 -04:00
parent 76e256ed64
commit b1ab641905
6 changed files with 16 additions and 22 deletions

View File

@@ -7,7 +7,6 @@ import { FileTime } from "../file/time"
import DESCRIPTION from "./read.txt"
import { App } from "../app/app"
const MAX_READ_SIZE = 250 * 1024
const DEFAULT_READ_LIMIT = 2000
const MAX_LINE_LENGTH = 2000
@@ -45,10 +44,7 @@ export const ReadTool = Tool.define({
throw new Error(`File not found: ${filePath}`)
}
const stats = await file.stat()
if (stats.size > MAX_READ_SIZE)
throw new Error(`File is too large (${stats.size} bytes). Maximum size is ${MAX_READ_SIZE} bytes`)
const limit = params.limit ?? DEFAULT_READ_LIMIT
const offset = params.offset || 0
const isImage = isImageFile(filePath)