UNPKG

toto-agent

Version:

Chatbot agent and reusable components for Toto platform

79 lines (78 loc) 2.64 kB
import { OrchestrationResult } from '../../shared/AgentTypes'; export declare class OrchestratorService { private genAI; private donationAgent; private sharingAgent; private dialogAgent; private engagementAgent; private adoptionAgent; private onboardingAgent; private synthesisAgent; private conversationMemory; private interactionLogs; private analyticsService; private memoryService; private monitoringService; constructor(apiKey: string); /** * Main orchestration method - analyzes user input and routes to appropriate agent(s) */ processUserInput(userMessage: string, context?: any, conversationId?: string, onChunk?: (chunk: string) => void): Promise<OrchestrationResult>; /** * Analyzes user intent using Gemini to determine the action type * Enhanced with Google AI Studio recommendations for better context weighting * Now using hybrid memory strategy with conversation summarization */ private analyzeUserIntent; /** * Select all relevant agents for collaborative response based on intent and context */ private selectRelevantAgents; /** * Routes the request to the selected specialized agent */ private routeToAgent; /** * Log an agent interaction for MetaAgent analysis and persist to Firestore */ private logInteraction; /** * Determine the outcome of an agent interaction */ private determineOutcome; /** * End a conversation session and get analytics */ endConversation(sessionId: string, feedback?: { rating?: number; comment?: string; helpful?: boolean; }): Promise<import("./ConversationAnalyticsService").ConversationAnalytics>; /** * Get analytics for a specific session */ getSessionAnalytics(sessionId: string): Promise<import("./ConversationAnalyticsService").ConversationAnalytics | null>; /** * Get aggregated analytics across all sessions */ getAggregatedAnalytics(): { totalSessions: number; totalInteractions: number; averageSessionLength: number; topIntents: Record<string, number>; conversionRates: Record<string, number>; commonIssues: string[]; }; /** * Analyze logs and generate insights using MetaAgent */ analyzeAgentInsights(): {}; /** * Get alternative intent predictions for disambiguation */ private getAlternativeIntents; /** * Generate contextual disambiguation prompt based on conversation history */ private generateDisambiguationPrompt; }