-
Notifications
You must be signed in to change notification settings - Fork 8
feat: AI Chat and embeddings #763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces comprehensive AI chat functionality to the Essential C# project by integrating Azure OpenAI services and vector search capabilities. The PR removes old Vue.js library files and implements a modern AI-powered chat assistant with contextual search abilities.
Key changes include:
- Integration of Azure OpenAI services with streaming chat completions and vector embeddings
- Implementation of AI chat widget with Vuetify UI components and real-time markdown rendering
- Addition of vector database builder and markdown chunking services for contextual search
Reviewed Changes
Copilot reviewed 46 out of 65 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| EssentialCSharp.Web/wwwroot/lib/vue/* | Removed local Vue.js library files in favor of CDN imports |
| EssentialCSharp.Web/wwwroot/js/chat-module.js | Added comprehensive chat module with authentication, rate limiting, and markdown support |
| EssentialCSharp.Web/Controllers/ChatController.cs | Implemented streaming chat API endpoints with authentication and rate limiting |
| EssentialCSharp.Chat.Shared/Services/*.cs | Added AI services for chat, search, embeddings, and markdown processing |
| EssentialCSharp.Web/Views/Shared/_Layout.cshtml | Integrated chat widget UI with Vuetify components and accessibility features |
Comments suppressed due to low confidence (1)
EssentialCSharp.Web/Program.cs:221
- [nitpick] The error message 'Rate limit exceeded. Please wait before sending another message.' could be more helpful by including specific timing information, such as when the user can retry.
await context.HttpContext.Response.WriteAsync(
EssentialCSharp.Chat.Shared/Extensions/ServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
EssentialCSharp.Chat.Shared/Services/ChunkingResultExtensions.cs
Outdated
Show resolved
Hide resolved
EssentialCSharp.VectorDbBuilder/EssentialCSharp.VectorDbBuilder.csproj
Outdated
Show resolved
Hide resolved
EssentialCSharp.VectorDbBuilder/EssentialCSharp.VectorDbBuilder.csproj
Outdated
Show resolved
Hide resolved
a94adbe to
4c572c8
Compare
A bunch of files were just deleted :)
Fixes #168
Fixes IntelliTect-dev/EssentialCSharp.Tooling#901
PR Summary
This pull request introduces significant enhancements to integrate Azure OpenAI services and vector search capabilities into the project. Key changes include adding dependencies for AI and vector search tools, creating new services for AI chat and search functionality, and defining models and configurations to support these features.Dependency and Configuration Updates:
Directory.Packages.props: Added new package dependencies, includingMicrosoft.SemanticKernel,ModelContextProtocol, andSystem.CommandLine, to enable AI and vector search functionality.EssentialCSharp.Chat.Common.csproj: Configured project properties and added package references for Azure OpenAI and vector search integration.AI Service Implementation:
EssentialCSharp.Chat.Shared/Services/AIChatService.cs: IntroducedAIChatService, which handles AI chat completions using Azure OpenAI. It supports both single and streaming responses, contextual prompt enrichment via vector search, and function call execution.EssentialCSharp.Chat.Shared/Services/AISearchService.cs: AddedAISearchServiceto execute vector searches on book content chunks using embeddings generated by theEmbeddingService.Data Models and Extensions:
EssentialCSharp.Chat.Shared/Models/BookContentChunk.cs: DefinedBookContentChunkto represent chunks of book content for vector search, including metadata and vector embeddings.EssentialCSharp.Chat.Shared/Models/AIOptions.cs: CreatedAIOptionsto centralize configuration for Azure OpenAI services and PostgreSQL vector store.EssentialCSharp.Chat.Shared/Extensions/ServiceCollectionExtensions.cs: Added extension methods to register Azure OpenAI services and PostgreSQL vector store in the dependency injection container.Screenshot: