Commit Graph

22 Commits

Author SHA1 Message Date
Marco Minerva 33c8fcb9dc Switch to OpenAPI and hybrid caching mechanism
Updated Program.cs to use TinyHelpers.AspNetCore.OpenApi and Microsoft.Extensions.Caching.Hybrid. Refactored ChatService.cs to use HybridCache for chat history management. Removed MessageLimit property from AppSettings.cs and appsettings.json. Updated SqlDatabaseVectorSearch.csproj to include new caching package and replace Swagger with Swagger UI.
2024-12-10 11:57:37 +01:00
Marco Minerva 29b8ebe283 Change ChatService to singleton, update package version
- Changed ChatService registration in Program.cs to singleton.
- Reformatted ChatHistory initialization in ChatService.cs.
- Modified prompt construction to avoid new lines after chunks.
- Updated Microsoft.SemanticKernel package to version 1.27.0.
2024-11-06 17:23:12 +01:00
Marco Minerva 5c0cf1cbd0 Update dependencies and remove unused EF Core
Removed the Microsoft.EntityFrameworkCore namespace from Program.cs.
In SqlDatabaseVectorSearch.csproj:
- Removed EntityFrameworkCore.Exceptions.SqlServer package.
- Updated Microsoft.AspNetCore.OpenApi from 8.0.8 to 8.0.10.
- Updated Microsoft.SemanticKernel from 1.21.1 to 1.22.0.
- Updated TinyHelpers from 3.1.16 to 3.1.18.
2024-10-14 09:58:59 +02:00
Marco Minerva 1b2ebbd6a3 Update PK constraints, API description, and config comment
Updated primary key constraint names in Scripts.sql for Documents
and DocumentChunks tables. Enhanced document upload API endpoint
description in Program.cs to reflect the use of the new native
Vector type for embeddings. Added a comment in appsettings.json
to clarify the Dimensions setting in the Embedding section.
2024-10-01 14:37:01 +02:00
Marco Minerva 2dff0aae55 Add dimensions parameter for embeddings; reformat SQL
Updated Program.cs to include dimensions parameter for AddAzureOpenAITextEmbeddingGeneration sourced from aiSettings.Embedding.Dimensions. Reformatted SQL command texts in VectorSearchService.cs for better readability. Introduced EmbeddingServiceSettings class in AzureOpenAISettings.cs to allow optional dimensions configuration. Updated appsettings.json to include new Dimensions property under Embedding section.
2024-09-30 17:53:59 +02:00
Marco Minerva 3e95251485 Refactor to use the native VECTOR type 2024-09-30 17:08:28 +02:00
Marco Minerva 3c7b076659 Remove custom Swagger UI stylesheet and checkbox width
The custom stylesheet injection for Swagger UI has been removed.
Specific width constraints for checkbox inputs in the Swagger UI
have been removed from the CSS.
2024-09-05 14:39:44 +02:00
Marco Minerva b6a09d0926 Data access optimizations 2024-09-02 10:42:30 +02:00
Marco Minerva b628c8996e Fix a typo in the documentation 2024-08-02 15:33:51 +02:00
Marco Minerva 17eee5f775 Optimize query performance and memory usage 2024-08-02 14:56:19 +02:00
Marco Minerva 1264b7f502 Correct a typo 2024-08-02 12:24:34 +02:00
Marco Minerva e54a091106 Update Swagger config and package versions
- Removed AddFormFile method from Swagger config in Program.cs
- Updated package versions in SqlDatabaseVectorSearch.csproj:
  - Microsoft.SemanticKernel to 1.16.2
  - MinimalHelpers.OpenApi to 2.0.11
  - Swashbuckle.AspNetCore to 6.7.0
  - TinyHelpers to 3.1.11
  - TinyHelpers.AspNetCore to 3.1.8
- Removed old package references from SqlDatabaseVectorSearch.csproj
2024-08-01 15:41:42 +02:00
Marco Minerva 6e716f3984 Optimize delete logic 2024-07-19 11:31:54 +02:00
Marco Minerva b66e64f6a2 Fix documentation 2024-07-19 10:48:51 +02:00
Marco Minerva 45de38d87a Enhanced document chunk handling and API
- Updated `Scripts.sql` to add a new `[Index]` column to `[dbo].[DocumentChunks]` for order tracking.
- Modified `DocumentChunk.cs` to include a new `Index` property, and introduced a new immutable record class for document chunks.
- Introduced new API endpoints in `Program.cs` for document and chunk retrieval, including embedding details, with OpenAPI documentation enhancements.
- Updated an API endpoint description in `Program.cs` to clarify document embedding handling.
- Updated `VectorSearchService.cs` to reflect schema changes in service logic, adding methods for fetching document chunks and specific embeddings.
2024-07-10 11:25:50 +02:00
Marco Minerva 01016e54e8 Refactor and update Swagger docs in Program.cs
Updated Swagger documentation title and endpoint description in Program.cs to reflect a shift towards general SQL Database usage instead of specific SQL Server implementation. Simplified the document upload endpoint by removing the `LinkGenerator` parameter and enhancing clarity in operation descriptions, emphasizing support for uploading documents to SQL databases for indexing and question answering purposes.
2024-07-02 10:48:03 +02:00
Marco Minerva 8ef8836075 Minor updates 2024-06-26 11:05:00 +02:00
Marco Minerva c72ed3054b Update Semantical Kernel comment 2024-06-20 17:21:07 +02:00
Marco Minerva dcccdf7365 Enhanced app with Vector Search support
- Updated README.md with details on Vector Support in Azure SQL Database, application functionalities, and setup instructions.
- Removed inheritance of `Question` class from `Search` class and deleted `Search` class.
- Minor adjustment in Program.cs for endpoint description consistency.
- Simplified appsettings.Development.json by removing the empty "ConnectionStrings" section.
- Enhanced Script.sql with SQL commands to create `DocumentChunks` and `Documents` tables, including schema for identifiers, content, embeddings, document names, creation dates, and established a foreign key relationship between the two tables.
2024-06-14 17:42:37 +02:00
Marco Minerva b6c898a3f5 Refactor code and enhance API documentation
- Converted `Question.cs` and `Search.cs` records to `record class` syntax for clarity.
- Organized API endpoints with tags and added new GET and DELETE endpoints in `Program.cs`, including OpenAPI documentation improvements.
- Removed commented-out code in `Program.cs` for cleaner codebase.
- Introduced `WithTags` for better API operation categorization in Swagger UI.
- Added a TODO comment in `ChatService.cs` for future improvement on chunk length check.
- Clarified `using` directives in `VectorSearchService.cs` with namespace aliasing to improve readability.
- Refactored document deletion in `VectorSearchService.cs` to use a private helper method and expanded service capabilities with a new `GetDocumentsAsync` method.
- Introduced a new `Document` model in the `Models` namespace to support document fetching functionality.
- Simplified `appsettings.json` by removing `MaxTokens` configuration for `ChatCompletion` and `Embedding` services.
2024-06-14 17:20:21 +02:00
Marco Minerva db4646330f Enhanced app with Azure AI and vector search
- Modified `ApplicationDbContext.cs` to correct the `.IsVector()` method placement for `DocumentChunk`.
- Removed `MemoryResponse.cs` class, indicating a move away from this model.
- Enhanced `Program.cs` with Azure AI services integration for text embeddings and chat completions. Updated OpenAPI descriptions and reintroduced `/api/ask` with vector search.
- Adjusted `ChatService.cs` to improve question-asking functionality using document chunks.
- Updated `VectorSearchService.cs` with a new `AskQuestionAsync` method for advanced search and response capabilities. Made `GetContentAsync` static.
- Formatted `SqlDatabaseVectorSearch.csproj` and managed NuGet package inclusions.
- Simplified `appsettings.json` by removing unused keys.
- Added a new `Response` record class for standardized service responses.
2024-06-14 12:59:09 +02:00
Marco Minerva 9284ae5377 Initial commit 2024-06-14 11:47:00 +02:00