claude-flow
Version:
Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration
45 lines • 2.09 kB
TypeScript
/**
* GAIA Tool: image_describe — ADR-133-PR5
*
* Describes an image at a given URL or local file path using Anthropic's
* claude-haiku-4-5 model with vision (image content blocks). Covers the
* subset of GAIA Level-1 questions that provide image attachments (graphs,
* screenshots, photos, diagrams).
*
* ============================================================
* DESIGN NOTES
* ============================================================
* - Uses the Anthropic Messages API directly via `fetch` (same approach as
* gaia-agent.ts / gaia-judge.ts) — no SDK dependency.
* - API key resolution order mirrors gaia-agent.ts:
* 1. `options.apiKey` (caller-supplied)
* 2. ANTHROPIC_API_KEY env var
* 3. gcloud secrets versions access latest --secret=ANTHROPIC_API_KEY
* - Model: claude-haiku-4-5 (cheapest vision-capable model, ~$0.001/call).
* - URL images: sent as { type: 'url', url } — Anthropic fetches the image.
* - Local files: read as Buffer, base64-encoded, MIME detected from extension.
* - execute() NEVER throws — returns a structured error string so the agent
* loop can forward it to Claude rather than crashing.
*
* ============================================================
* SUPPORTED IMAGE FORMATS
* ============================================================
* Anthropic vision accepts: JPEG, PNG, GIF, WebP.
* Unsupported formats return a descriptive error that Claude can relay.
*
* Refs: ADR-133, #2156
*/
import { GaiaTool, ToolDefinition } from './types.js';
export declare class ImageDescribeTool implements GaiaTool {
readonly name = "image_describe";
private readonly apiKey?;
constructor(apiKey?: string);
readonly definition: ToolDefinition;
execute(input: Record<string, unknown>): Promise<string>;
}
export interface ImageDescribeToolOptions {
/** Anthropic API key (falls back to env / gcloud if omitted). */
apiKey?: string;
}
export declare function createImageDescribeTool(opts?: ImageDescribeToolOptions): ImageDescribeTool;
//# sourceMappingURL=image_describe.d.ts.map