toto-agent
Version:
Chatbot agent and reusable components for Toto platform
85 lines (84 loc) • 2.19 kB
TypeScript
export declare enum UserAction {
DONATE = "donate",
SHARE = "share",
DIALOG = "dialog",
LIKE = "like",
TYPE = "type",
ADOPT = "adopt",
VOLUNTEER = "volunteer",
EMERGENCY = "emergency",
LOCATION = "location",
CONTACT = "contact",
UNKNOWN = "unknown"
}
export declare enum AgentType {
ORCHESTRATOR = "orchestrator",
DONATION_AGENT = "donation_agent",
SHARING_AGENT = "sharing_agent",
DIALOG_AGENT = "dialog_agent",
ENGAGEMENT_AGENT = "engagement_agent",
ADOPTION_AGENT = "adoption_agent",
ONBOARDING_AGENT = "onboarding_agent",
SYNTHESIS_AGENT = "synthesis_agent"
}
export interface UserIntent {
action: UserAction;
confidence: number;
context: any;
entities?: {
amount?: number | null;
platform?: string | null;
caseId?: string;
petName?: string | null;
urgencyLevel?: 'low' | 'medium' | 'high';
emotion?: 'love' | 'concern' | 'curiosity' | 'excitement';
};
}
export interface AgentResponse {
agentType: AgentType;
response: string;
actions?: {
type: string;
payload: any;
}[];
nextSteps?: string[];
metadata?: any;
isStreaming?: boolean;
streamingCallback?: (chunk: string) => void;
}
export interface OrchestrationResult {
intent: UserIntent;
selectedAgent?: AgentType;
response?: AgentResponse;
collaborativeResponses?: AgentResponse[];
disambiguationPrompt?: string;
disambiguationIntents?: UserIntent[];
conversationId: string;
timestamp: Date;
isStreaming?: boolean;
}
export interface ConversationContext {
conversationId: string;
userId?: string;
petInfo?: {
id: string;
name: string;
type: string;
status: string;
emergency: boolean;
};
history: {
timestamp: Date;
userMessage: string;
intent: UserAction;
agentResponse: string;
agentType: AgentType;
}[];
preferences?: {
language: string;
communicationStyle: string;
previousDonations: boolean;
adoptionInterest: boolean;
};
lastInteraction: Date;
}