@digitalsingularity/agent-ui-chat-components
Version:
Reusable UI components for agent chat and management interfaces
52 lines (51 loc) • 1.58 kB
TypeScript
import React from 'react';
export interface ChatMessage {
id: string;
role: 'user' | 'assistant';
content: string;
}
export interface AiAgent {
id: string;
name: string;
description?: string | null;
model: string;
temperature?: number;
avatarUrl?: string | null;
}
export interface UIComponents {
Dialog: React.ComponentType<any>;
DialogContent: React.ComponentType<any>;
DialogHeader: React.ComponentType<any>;
DialogTitle: React.ComponentType<any>;
DialogDescription: React.ComponentType<any>;
Button: React.ComponentType<any>;
Input: React.ComponentType<any>;
ScrollArea: React.ComponentType<any>;
Avatar: React.ComponentType<any>;
AvatarFallback: React.ComponentType<any>;
AvatarImage: React.ComponentType<any>;
}
export interface AgentService {
sendMessage(message: string, agentId: string, onChunk: (chunk: string) => void, onError: (error: any) => void, onCompletion: () => void): Promise<void>;
getUserAvatar?(): Promise<string | null>;
}
export interface ToastService {
toast(options: {
title?: string;
description?: string;
variant?: 'default' | 'destructive';
}): void;
}
export interface AgentChatModalProps {
agent: AiAgent | null;
isOpen: boolean;
onClose: () => void;
uiComponents: UIComponents;
agentService: AgentService;
toastService?: ToastService;
className?: string;
maxMessages?: number;
enableHistory?: boolean;
}
declare const AgentChatModal: React.FC<AgentChatModalProps>;
export default AgentChatModal;