/** * Copyright 2025 Vybestack LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Enhances tool name extraction for qwen and other providers that may send tool names in chunks * @param currentName Current accumulated tool name * @param newName New name chunk from streaming * @param isComplete Whether the stream for this tool call is complete * @returns Enhanced tool name with fallback strategies */ export declare function enhanceToolNameExtraction(currentName: string, newName: string | undefined, isComplete: boolean): { name: string; isFallback: boolean; }; /** * Validates a tool name for consistency with expected tool names * @param toolName The tool name to validate * @param availableToolNames Array of available tool names * @returns Validated tool name or null if invalid */ export declare function validateToolName(toolName: string, availableToolNames?: string[]): { isValid: boolean; correctedName?: string; reason?: string; }; /** * Processes final tool name validation with comprehensive fallback strategy * @param toolName The tool name to process * @param availableToolNames Array of available tool names * @returns Final validated tool name */ export declare function processFinalToolName(toolName: string, availableToolNames?: string[]): string; /** * Safely extracts tool name from streaming delta with comprehensive error handling * @param delta The streaming delta object * @param currentIndex Current tool call index * @param availableToolNames Array of available tool names * @returns Safe tool name extraction result */ export declare function safeExtractToolName(delta: Record, currentIndex: number, availableToolNames?: string[]): { name: string; hasName: boolean; isComplete: boolean; warnings: string[]; };