crewai-ts
Version:
TypeScript port of crewAI for agent-based workflows
75 lines • 1.88 kB
TypeScript
/**
* MySQL Search Tool
* Provides optimized database search capabilities for agents
* with connection pooling and memory-efficient result handling
*/
/**
* Result of a MySQL search operation
*/
export interface MySQLSearchResult {
rows: Record<string, any>[];
rowCount: number;
fields: Array<{
name: string;
type: number;
table: string;
}> | null;
duration: number;
error?: string;
}
/**
* Options for configuring the MySQLSearchTool
*/
export interface MySQLSearchToolOptions {
/**
* Default connection string to use if not provided in the input
*/
defaultConnectionString?: string;
/**
* Whether to automatically parse JSON columns
* @default true
*/
parseJson?: boolean;
/**
* Maximum number of rows to return
* @default 1000
*/
maxRows?: number;
/**
* Whether to cache query results
* @default false
*/
cacheResults?: boolean;
/**
* Cache expiration time in milliseconds
* @default 60000 (1 minute)
*/
cacheExpiration?: number;
/**
* Maximum query execution time in milliseconds
* @default 30000 (30 seconds)
*/
queryTimeout?: number;
/**
* Max connection pools to maintain
* @default 5
*/
maxConnectionPools?: number;
}
/**
* Creates an optimized MySQL search tool
*/
export declare function createMySQLSearchTool(options?: MySQLSearchToolOptions): import("../StructuredTool.js").StructuredTool<{
timeout?: number;
query?: string;
params?: any[];
connectionString?: string;
rowLimit?: number;
nested?: boolean;
}, MySQLSearchResult>;
/**
* Cleanup MySQL connections
* Call this when shutting down your application
*/
export declare function cleanupMySQLConnections(): Promise<void>;
//# sourceMappingURL=MySQLSearchTool.d.ts.map