@digitalsingularity/agent-ui-chat-components
Version:
Reusable UI components for agent chat and management interfaces
99 lines (98 loc) • 4.04 kB
TypeScript
export interface AiAgent {
id: string;
name: string;
description?: string | null;
systemInstruction: string;
temperature?: number;
model: string;
personalityTags?: string[];
avatarUrl?: string;
avatarType?: string;
avatarPrompt?: string;
isPublic?: boolean;
isOwner?: boolean;
userId: string;
createdAt: string;
updatedAt: string;
}
export interface AiAgentDocument {
id: number;
fileName: string;
fileSize?: number;
}
export interface AgentManagementProps {
useMutation: any;
useQueryClient: any;
useQuery: any;
useAiAgents: () => any;
useAiAgent: any;
createAiAgent: (agent: any) => Promise<AiAgent>;
updateAiAgent: (id: string, agentData: any) => Promise<AiAgent>;
deleteAiAgent: (id: string) => Promise<void>;
uploadAiAgentDocument: (agentId: string, file: File) => Promise<any>;
deleteAiAgentDocument: (agentId: string, documentId: number) => Promise<void>;
useAiAgentDocuments: (agentId: string) => any;
aiAgentKeys: any;
uploadAiAgentAvatar: (agentId: string, file: File) => Promise<any>;
generateAiAgentAvatar: (agentId: string, prompt: string) => Promise<any>;
shareAiAgent: (id: string, isPublic: boolean) => Promise<AiAgent>;
useToast: () => any;
agentService: any;
toastService: any;
}
export declare const PERSONALITY_TAGS: string[];
export declare const useAgentManagement: (props: AgentManagementProps) => {
agents: any;
isLoadingAgents: any;
errorAgents: any;
agentDocuments: any;
isLoadingDocuments: any;
selectedAgent: AiAgent | null;
setSelectedAgent: import("react").Dispatch<import("react").SetStateAction<AiAgent | null>>;
newAgent: Partial<AiAgent>;
setNewAgent: (value: any) => void;
isCreateDialogOpen: boolean;
setIsCreateDialogOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
isEditDialogOpen: boolean;
setIsEditDialogOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
isDeleteDialogOpen: boolean;
setIsDeleteDialogOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
isChatModalOpen: boolean;
setIsChatModalOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
selectedAgentForChat: AiAgent | null;
setSelectedAgentForChat: import("react").Dispatch<import("react").SetStateAction<AiAgent | null>>;
documents: File[];
setDocuments: import("react").Dispatch<import("react").SetStateAction<File[]>>;
avatarFile: File | null;
setAvatarFile: import("react").Dispatch<import("react").SetStateAction<File | null>>;
avatarPrompt: string;
setAvatarPrompt: import("react").Dispatch<import("react").SetStateAction<string>>;
isGeneratingAvatar: boolean;
customTag: string;
setCustomTag: import("react").Dispatch<import("react").SetStateAction<string>>;
agentFilter: "all" | "own" | "public";
setAgentFilter: import("react").Dispatch<import("react").SetStateAction<"all" | "own" | "public">>;
createAgentMutation: any;
updateAgentMutation: any;
deleteAgentMutation: any;
shareAgentMutation: any;
uploadDocumentMutation: any;
deleteDocumentMutation: any;
handleCreateAgent: () => void;
handleUpdateAgent: () => void;
handleDeleteAgent: () => void;
handleFileChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
removeFile: (index: number) => void;
handleDeleteDocument: (documentId: number) => void;
handleEditAgent: (agent: AiAgent) => void;
handleOpenChat: (agent: AiAgent) => void;
addCustomTag: () => void;
handleRemoveTag: (tagToRemove: string) => void;
handleSelectTag: (tag: string) => void;
handleAvatarChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
handleGenerateAvatar: () => Promise<void>;
handleUploadAvatar: () => Promise<void>;
handleShareAgent: (agent: AiAgent) => void;
wrappedSetSelectedAgent: (value: any) => void;
PERSONALITY_TAGS: string[];
};