mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Enable AI to see images when using the read tool
Return JPG/PNG images as structured image content parts from ReadTool instead of embedding base64 data URLs as plain text. Since OpenAI tool messages only support text content, images are injected as a follow-up user message with image_url parts that vision models can interpret.
This commit is contained in:
3 files changed
+38
-3
No files matched your search
@@ -1,8 +1,14 @@
|
||||
import type z from "zod";
|
||||
|
||||
export interface ToolResultImage {
|
||||
type: 'image';
|
||||
url: string; // data URL (e.g. data:image/png;base64,...)
|
||||
}
|
||||
|
||||
export interface ToolResult {
|
||||
content: string;
|
||||
cost?: number;
|
||||
images?: ToolResultImage[];
|
||||
}
|
||||
|
||||
export interface Tool<TParams> {
|
||||
|
||||
Reference in new issue
Block a user