UNPKG

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

51 lines 2.06 kB
/** * GAIA Agent — Gemini 2.5 Pro Thinking adapter (Phase 2 pilot) * * Adapts the existing GAIA tool catalogue to Google's generateContent API, * translating Anthropic tool_use ↔ Gemini functionCall/functionResponse. * * Loop algorithm mirrors gaia-agent.ts: * 1. Build initial contents array with system instruction + first user turn. * 2. Call Gemini generateContent with functionDeclarations. * 3. On functionCall parts: execute tools, append functionResponse, repeat. * 4. On text-only response: scan for FINAL_ANSWER pattern. * 5. On maxTurns: return timedOut result. * * Gemini 2.5 Pro pricing (2026-05-28, per million tokens): * Input: $1.25 (≤200k tokens), $2.50 (>200k) * Output: $10.00 (≤200k tokens), $15.00 (>200k) * Thinking tokens are billed as output tokens. * * Cost gate for pilot: ≤$0.12 per question average. * Expected per-question cost at ~10k input + ~2k output: ~$0.032 — well within gate. * * Refs: ADR-133, ADR-135, #2156 Phase 2 */ import { GaiaQuestion } from './gaia-loader.js'; import { GaiaToolCatalogue } from './gaia-tools/index.js'; export declare const DEFAULT_GEMINI_MODEL = "gemini-2.5-pro"; export interface GeminiAgentResult { questionId: string; finalAnswer: string | null; turns: number; toolCallsByName: Record<string, number>; totalInputTokens: number; totalOutputTokens: number; totalThinkingTokens: number; wallMs: number; estimatedCostUsd: number; timedOut?: boolean; error?: string; } export interface GeminiAgentOptions { model?: string; maxTurns?: number; maxTokensPerTurn?: number; perTurnTimeoutMs?: number; apiKey?: string; catalogue?: GaiaToolCatalogue; } export declare function resolveGeminiApiKey(apiKey?: string): string; export declare function runGeminiAgent(question: GaiaQuestion, options?: GeminiAgentOptions): Promise<GeminiAgentResult>; export declare function isGeminiAnswerCorrect(modelAnswer: string, expected: string): boolean; //# sourceMappingURL=gaia-agent-gemini.d.ts.map