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