mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
Update code style, prompt, and dependencies
.editorconfig: Add new code style preferences. ChatService.cs: Add formatted question to prompt string. VectorSearchService.cs: Remove TinyHelpers.Extensions using directive. VectorSearchService.cs: Use paragraphs.Index() in foreach loop. SqlDatabaseVectorSearch.csproj: Update target framework to net9.0. SqlDatabaseVectorSearch.csproj: Update package references, remove TinyHelpers.
This commit is contained in:
@@ -131,6 +131,7 @@ csharp_prefer_braces = true:silent
|
||||
csharp_prefer_simple_using_statement = true:suggestion
|
||||
csharp_style_namespace_declarations = file_scoped:suggestion
|
||||
csharp_style_prefer_method_group_conversion = true:silent
|
||||
csharp_prefer_system_threading_lock = true:suggestion
|
||||
|
||||
# Expression-level preferences
|
||||
csharp_prefer_simple_default_expression = true:suggestion
|
||||
|
||||
@@ -55,6 +55,7 @@ public class ChatService(IMemoryCache cache, IChatCompletionService chatCompleti
|
||||
}
|
||||
|
||||
prompt.AppendLine($"""
|
||||
|
||||
=====
|
||||
Answer the following question:
|
||||
---
|
||||
|
||||
@@ -7,7 +7,6 @@ using Microsoft.SemanticKernel.Text;
|
||||
using SqlDatabaseVectorSearch.DataAccessLayer;
|
||||
using SqlDatabaseVectorSearch.Models;
|
||||
using SqlDatabaseVectorSearch.Settings;
|
||||
using TinyHelpers.Extensions;
|
||||
using UglyToad.PdfPig;
|
||||
using UglyToad.PdfPig.DocumentLayoutAnalysis.TextExtractor;
|
||||
using Entities = SqlDatabaseVectorSearch.DataAccessLayer.Entities;
|
||||
@@ -39,7 +38,7 @@ public class VectorSearchService(ApplicationDbContext dbContext, ITextEmbeddingG
|
||||
var embeddings = await textEmbeddingGenerationService.GenerateEmbeddingsAsync(paragraphs);
|
||||
|
||||
// Save the document chunks and the corresponding embedding in the database.
|
||||
foreach (var (paragraph, index) in paragraphs.WithIndex())
|
||||
foreach (var (index, paragraph) in paragraphs.Index())
|
||||
{
|
||||
var documentChunk = new Entities.DocumentChunk { Document = document, Index = index, Content = paragraph!, Embedding = embeddings[index].ToArray() };
|
||||
dbContext.DocumentChunks.Add(documentChunk);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<NoWarn>$(NoWarn);SKEXP0001;SKEXP0010;SKEXP0050;</NoWarn>
|
||||
@@ -10,13 +10,12 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EFCore.SqlServer.VectorSearch" Version="0.2.0" />
|
||||
<PackageReference Include="EntityFrameworkCore.Exceptions.SqlServer" Version="8.1.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
|
||||
<PackageReference Include="Microsoft.SemanticKernel" Version="1.27.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[8.0.11, 9.0.0)" />
|
||||
<PackageReference Include="Microsoft.SemanticKernel" Version="1.30.0" />
|
||||
<PackageReference Include="MinimalHelpers.OpenApi" Version="2.0.17" />
|
||||
<PackageReference Include="PdfPig" Version="0.1.9" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
|
||||
<PackageReference Include="TinyHelpers" Version="3.1.18" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
|
||||
<PackageReference Include="TinyHelpers.AspNetCore" Version="3.1.19" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user