// Context Management
export { ConversationContextManager } from "./context-manager";
export type { ConversationConfig, MessageSummary } from "./context-manager";

// Prompt Management
export { PromptManager } from "./prompt-manager";
export type { PromptTemplate, PromptContext } from "./prompt-manager";

// Chatbot
export { RAGChatbot } from "./chatbot";
export type { ChatbotConfig, ChatResponse, ChatRequest } from "./chatbot";

import { RAGChatbot } from "./chatbot";

// Utility function to create a simple chatbot instance
export function createRAGChatbot(config: {
  ragEngine: any;
  llmConfig: {
    apiKey: string;
    modelName: string;
    temperature?: number;
    maxTokens?: number;
  };
  options?: {
    defaultPromptTemplate?: string;
    languageDetection?: boolean;
    retrievalConfig?: {
      topK?: number;
      minScore?: number;
      searchMethod?: "hybrid" | "vector" | "keyword";
    };
  };
}): RAGChatbot {
  return new RAGChatbot({
    ragEngine: config.ragEngine,
    llmConfig: config.llmConfig,
    defaultPromptTemplate:
      config.options?.defaultPromptTemplate || "rag-default-en",
    languageDetection: config.options?.languageDetection ?? true,
    retrievalConfig: {
      topK: 5,
      minScore: 0.1,
      searchMethod: "hybrid",
      ...config.options?.retrievalConfig,
    },
  });
}
