From ddfa7979a58fde6cebfb07d7bdbd4ebd5f1d45c2 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Wed, 21 Oct 2026 17:55:12 +0330 Subject: [PATCH] last ... --- Controllers/ChatWithDocumentsController.cs | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Controllers/ChatWithDocumentsController.cs diff --git a/Controllers/ChatWithDocumentsController.cs b/Controllers/ChatWithDocumentsController.cs new file mode 100644 index 0000000..a64f96f --- /dev/null +++ b/Controllers/ChatWithDocumentsController.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Logging; +using xAiApi.Interfaces; +using xAiApi.Interfaces.Extractors; +using xAiModels.Models.Dtos; +using xCommons.Configurations; +using xCommons.Providers; +using xIdentityService.Controllers; +using xIdentityService.Interfaces; + +namespace xAiApi.Controllers +{ + [Authorize] + [Route("[controller]")] + public class ChatWithDocumentsController : XBaseIdentityApiV1Controller, IDisposable + { + /// + /// Default AI Service ... + /// + private IXDefaultAiService aiService; + + /// + /// In Memory Vector Store ... + /// + private IList vectorStore = []; + + /// + /// Embedding Service ... + /// + private readonly IXDefaultEmbeddingService embeddingService; + + /// + /// File Context Extractor Service ... + /// + private readonly IXFileContentExtractor fileContentExtractor; + + public ChatWithDocumentsController( + IXDefaultAiService aiService, + ILogger logger, + XAppConfiguration appConfiguration, + IXIdentityProvider identityProvider, + IXDefaultEmbeddingService embeddingService, + XValidationProvider validationProvider, + IXFileContentExtractor fileContentExtractor + ) : base(logger, appConfiguration, identityProvider, validationProvider) + { + this.aiService = aiService; + this.embeddingService = embeddingService; + this.fileContentExtractor = fileContentExtractor; + } + + /// + /// Dispose ... + /// + public void Dispose() + { + vectorStore.Clear(); + } + } +} \ No newline at end of file