fix: image reading

This commit is contained in:
adamdottv
2025-07-08 13:02:13 -05:00
parent 8322f18e03
commit f31cbf2744
4 changed files with 16 additions and 8 deletions

View File

@@ -372,11 +372,11 @@ export namespace Session {
return [
{
type: "text",
text: ["Called the Read tool on " + url.pathname].join("\n"),
text: `Called the Read tool with the following input: {\"filePath\":\"${url.pathname}\"}`,
},
{
type: "file",
url: `data:${part.mime};base64,` + Buffer.from(await file.bytes()).toString("base64url"),
url: `data:${part.mime};base64,` + Buffer.from(await file.bytes()).toString("base64"),
mime: part.mime,
filename: part.filename!,
},

View File

@@ -2,7 +2,7 @@ Reads a file from the local filesystem. You can access any file directly by usin
Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.
Usage:
- The file_path parameter must be an absolute path, not a relative path
- The filePath parameter must be an absolute path, not a relative path
- By default, it reads up to 2000 lines starting from the beginning of the file
- You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters
- Any lines longer than 2000 characters will be truncated