import type { MessageContent } from '@langchain/core/messages'; import type { LLMResult, Generation } from '@langchain/core/outputs'; /** * Detect garbage/empty responses from models after heavy tool use. * Returns true if the content is empty or matches common garbage patterns * that models produce when they fail to synthesize a proper summary. */ export declare function isGarbageResponse(content: MessageContent): boolean; /** * Convert LangChain Generation[] to MessageContent for use with formatFinalResponse. * Handles both simple Generation (with text) and ChatGeneration (with message). * * This is useful when processing LLMResult from callbacks like handleLLMEnd, * where you have generations but want to use the unified formatFinalResponse. * * @param generations - Array of Generation objects (typically from LLMResult.generations.flat()) * @returns MessageContent that can be passed to formatFinalResponse */ export declare function generationsToMessageContent(generations: Generation[]): MessageContent; /** * Extract and stream thinking tokens from different model providers */ /** * Extract thinking from message content blocks (Claude extended thinking format). * Use when you have MessageContent directly (e.g., AIMessage.content). */ export declare function extractThinkingFromContent(content: MessageContent): string | undefined; /** * Extract thinking/reasoning tokens from an LLM response. * Handles all provider formats in one place: * - Claude: thinking blocks in message content array * - Grok/OpenRouter: reasoning in raw response choices */ export declare function extractThinking(output: LLMResult): string | undefined; /** @deprecated Use `extractThinking` instead */ export declare const extractAndStreamThinkingTokens: typeof extractThinking; /** * Format final response with special handling for Gemini image models and JSON mode */ export declare function formatFinalResponse(response: MessageContent, modelName: string, jsonMode?: boolean): { response: string; error?: string; }; /** * Convert Gemini's inlineData format to LangChain-compatible data URI format */ export declare function formatGeminiImageResponse(response: string | unknown): string; //# sourceMappingURL=agent-formatter.d.ts.map