@dev-fastn-ai/ucl-sdk
Version:
Fastn UCL SDK - A robust TypeScript SDK for integrating AI agents with Fastn UCL
35 lines • 1.65 kB
TypeScript
import type { Tool, ToolAnalysisResult, Connector } from '../types';
import { EmbeddingService } from '../services/embedding-service';
export declare class Analyzer {
private tools;
private connectors;
private toolEmbeddings;
private connectorEmbeddings;
private embeddingService;
private toolCache;
private connectorCache;
private tenantConnectorsCache;
private static TOOL_EMBEDDINGS_KEY;
private static CONNECTOR_EMBEDDINGS_KEY;
private static SIMILARITY_THRESHOLD;
constructor(tools: Tool[] | undefined, connectors: Connector[] | undefined, embeddingService: EmbeddingService);
initialize(): Promise<void>;
/**
* Checks if two arrays of tools/connectors are different by comparing their unique IDs and count.
*/
private isDifferentList;
updateTenantConnectors(tenantId: string, connectors: Connector[]): Promise<void>;
getTenantConnectors(tenantId: string): Connector[];
doesTenantConnectorsExist(tenantId: string): boolean;
updateTools(tools: Tool[], clearCache?: boolean): Promise<void>;
updateConnectors(connectors: Connector[], clearCache?: boolean): Promise<void>;
/**
* Analyze a message for tool or connector requirements.
* - If a tool is available, return { requiredTool: true, toolName, tool }
* - If no tool, but a matching connector is found and is INACTIVE, return { requireConnection: true, connectorName, connector }
* - Else, return { requiredTool: false }
*/
analyzeMessage(message: string, tenantId: string): Promise<ToolAnalysisResult>;
private cosineSimilarity;
}
//# sourceMappingURL=analyzer.d.ts.map