chatbot : step 1

This commit is contained in:
morteza-mortezai
2025-11-29 12:25:13 +03:30
parent 3ebae01605
commit db266a1cd6
18 changed files with 689 additions and 765 deletions
+14
View File
@@ -54,6 +54,13 @@ import { ChatService } from "../modules/chat/chat.service";
import { ChatRepo, createChatRepo } from "../modules/chat/repository/chat.repository";
import { ChatMessageRepo, createChatMessageRepo } from "../modules/chat/repository/message.repository";
import { WsAuthService } from "../modules/chat/wsAuth.service";
import { ChatbotService } from "../modules/chatbot/providers/chatbot.service";
import { DataContextService } from "../modules/chatbot/providers/data-context.service";
import { LangChainService } from "../modules/chatbot/providers/langchain.service";
import { LLMService } from "../modules/chatbot/providers/llm.service";
import { WebSocketAuthService } from "../modules/chatbot/providers/websocket-auth.service";
import { ChatSessionRepository, createChatSessionRepository } from "../modules/chatbot/repositories/chat-session.repository";
import { ChatMessageRepository, createChatMessageRepository } from "../modules/chatbot/repositories/chat-message.repository";
import { ContactUsRepo, CreateContactUsRepo } from "../modules/contact-us/contactUs.repository";
import { ContactUsService } from "../modules/contact-us/contactUs.service";
import { CouponRepo, CouponUsageRepo, createCouponRepo, createCouponUsageRepo } from "../modules/Coupon/coupon.repository";
@@ -197,6 +204,11 @@ const containerModules = new AsyncContainerModule(async (bind) => {
bind<LearningService>(IOCTYPES.LearningService).to(LearningService).inSingletonScope();
bind<RedisService>(IOCTYPES.RedisService).to(RedisService).inSingletonScope();
bind<CacheService>(IOCTYPES.CacheService).to(CacheService).inSingletonScope();
bind<ChatbotService>(IOCTYPES.ChatbotService).to(ChatbotService).inSingletonScope();
bind<LLMService>(IOCTYPES.ChatbotLLMService).to(LLMService).inSingletonScope();
bind<LangChainService>(IOCTYPES.ChatbotLangChainService).to(LangChainService).inSingletonScope();
bind<DataContextService>(IOCTYPES.ChatbotDataContextService).to(DataContextService).inSingletonScope();
bind<WebSocketAuthService>(IOCTYPES.ChatbotWebSocketAuthService).to(WebSocketAuthService).inSingletonScope();
// #endregion
// #region repository
bind<CategoryRepository>(IOCTYPES.CategoryRepository).toDynamicValue(createCategoryRepo).inSingletonScope();
@@ -279,6 +291,8 @@ const containerModules = new AsyncContainerModule(async (bind) => {
bind<AboutUsRepo>(IOCTYPES.AboutUsRepo).toDynamicValue(CreateAboutUsRepo).inSingletonScope();
bind<SiteSettingRepo>(IOCTYPES.SiteSettingRepo).toDynamicValue(CreateSiteSettingRepo).inSingletonScope();
bind<NewsletterRepo>(IOCTYPES.NewsletterRepo).toDynamicValue(CreateNewsletterRepo).inSingletonScope();
bind<ChatSessionRepository>(IOCTYPES.ChatSessionRepository).toDynamicValue(createChatSessionRepository).inSingletonScope();
bind<ChatMessageRepository>(IOCTYPES.ChatMessageRepository).toDynamicValue(createChatMessageRepository).inSingletonScope();
// #endregion
});
+8
View File
@@ -46,6 +46,12 @@ export const IOCTYPES = {
NewsletterService: Symbol.for("NewsletterService"),
PricingService: Symbol.for("PricingService"),
OrderQueue: Symbol.for("OrderQueue"),
ChatbotService: Symbol.for("ChatbotService"),
ChatbotLLMService: Symbol.for("ChatbotLLMService"),
ChatbotLangChainService: Symbol.for("ChatbotLangChainService"),
ChatbotDataContextService: Symbol.for("ChatbotDataContextService"),
ChatbotGateway: Symbol.for("ChatbotGateway"),
ChatbotWebSocketAuthService: Symbol.for("ChatbotWebSocketAuthService"),
// #endregion
// #region repository
CategoryRepository: Symbol.for("CategoryRepository"),
@@ -131,6 +137,8 @@ export const IOCTYPES = {
ContactUsRepo: Symbol.for("ContactUsRepo"),
AboutUsRepo: Symbol.for("AboutUsRepo"),
NewsletterRepo: Symbol.for("NewsletterRepo"),
ChatSessionRepository: Symbol.for("ChatSessionRepository"),
ChatMessageRepository: Symbol.for("ChatMessageRepository"),
// #endregion
Logger: Symbol.for("Logger"),
ZarinPalGateway: Symbol.for("ZarinPalGateway"),