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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user