/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Detects if a tool format should use double-escape handling * @param toolFormat - The tool format to check * @returns true if the format typically needs double-escape handling */ export declare function shouldUseDoubleEscapeHandling(toolFormat: string): boolean; /** * Checks if a JSON string appears to be double-stringified * @param jsonString - The JSON string to check * @returns Object with detection results and corrected value if applicable */ export declare function detectDoubleEscaping(jsonString: string): { isDoubleEscaped: boolean; correctedValue?: unknown; originalValue: string; detectionDetails: { firstParse?: string; secondParse?: unknown; error?: string; }; }; /** * Detects double-escaping in streaming tool call chunks * @param chunk - The streaming chunk to analyze * @returns true if double-escaping patterns are detected */ export declare function detectDoubleEscapingInChunk(chunk: string): boolean; /** * Processes tool call parameters, fixing double-escaping if detected * @param parametersString - The JSON string containing tool parameters * @param toolName - Name of the tool (for logging) * @param format - The tool format being used (for context, optional) * @returns Processed parameters object */ export declare function processToolParameters(parametersString: string, toolName: string, format?: string): unknown; /** * Logs double-escaping detection in streaming chunks (for debugging) * @param chunk - The chunk that contains potential double-escaping * @param toolName - Name of the tool * @param format - The tool format */ export declare function logDoubleEscapingInChunk(chunk: string, toolName: string, format: string): void;