UNPKG

smalltalk-ai

Version:

A complete TypeScript framework for building LLM applications with agent support and MCP integration

35 lines 1.55 kB
import { EventEmitter } from 'events'; import { ChatMessage, ChatSession, SmallTalkConfig, FlowContext } from '../types/index.js'; export declare class Chat extends EventEmitter { private config; private llmWrapper; private sessions; constructor(config: SmallTalkConfig); createSession(sessionId?: string): ChatSession; getSession(sessionId: string): ChatSession | undefined; deleteSession(sessionId: string): boolean; addMessage(sessionId: string, message: Omit<ChatMessage, 'id' | 'timestamp'>): ChatMessage; getMessages(sessionId: string, limit?: number): ChatMessage[]; clearMessages(sessionId: string): void; generateResponse(sessionId: string, userMessage: string, context: FlowContext): Promise<string>; generateStreamResponse(sessionId: string, userMessage: string, context: FlowContext, onChunk?: (chunk: string) => void): Promise<string>; exportSession(sessionId: string, format?: 'json' | 'text'): string; importSession(data: string, format?: 'json' | 'text'): ChatSession; getSessionStats(sessionId: string): { messageCount: number; userMessages: number; assistantMessages: number; systemMessages: number; duration: number; averageMessageLength: number; } | null; listSessions(): Array<{ id: string; messageCount: number; createdAt: Date; updatedAt: Date; activeAgent?: string; }>; updateConfig(newConfig: Partial<SmallTalkConfig>): void; } //# sourceMappingURL=Chat.d.ts.map