From 1b2ebbd6a3848bbe66fc56776a905f9344a34fd9 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Tue, 1 Oct 2024 14:37:01 +0200 Subject: [PATCH] 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. --- Scripts.sql | 4 ++-- SqlDatabaseVectorSearch/Program.cs | 2 +- SqlDatabaseVectorSearch/appsettings.json | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Scripts.sql b/Scripts.sql index a2e1e93..f0332cf 100644 --- a/Scripts.sql +++ b/Scripts.sql @@ -2,7 +2,7 @@ CREATE TABLE [dbo].[Documents]( [Id] [uniqueidentifier] NOT NULL, [Name] [nvarchar](255) NOT NULL, [CreationDate] [datetimeoffset](7) NOT NULL, - CONSTRAINT [PK_Documents2] PRIMARY KEY CLUSTERED + CONSTRAINT [PK_Documents] PRIMARY KEY CLUSTERED ( [Id] ASC )) @@ -14,7 +14,7 @@ CREATE TABLE [dbo].[DocumentChunks]( [Index] [int] NOT NULL, [Content] [nvarchar](max) NOT NULL, [Embedding] [vector](1536) NOT NULL, - CONSTRAINT [PK_DocumentChunks2] PRIMARY KEY CLUSTERED + CONSTRAINT [PK_DocumentChunks] PRIMARY KEY CLUSTERED ( [Id] ASC )) diff --git a/SqlDatabaseVectorSearch/Program.cs b/SqlDatabaseVectorSearch/Program.cs index 244729a..f572c42 100644 --- a/SqlDatabaseVectorSearch/Program.cs +++ b/SqlDatabaseVectorSearch/Program.cs @@ -118,7 +118,7 @@ documentsApiGroup.MapPost(string.Empty, async (IFormFile file, VectorSearchServi .WithOpenApi(operation => { operation.Summary = "Uploads a document"; - operation.Description = "Uploads a document to SQL Database and saves its embedding using Vector Support. The document will be indexed and used to answer questions. Currently, only PDF files are supported."; + operation.Description = "Uploads a document to SQL Database and saves its embedding using the new native Vector type. The document will be indexed and used to answer questions. Currently, only PDF files are supported."; operation.Parameter("documentId").Description = "The unique identifier of the document. If not provided, a new one will be generated. If you specify an existing documentId, the corresponding document will be overwritten."; diff --git a/SqlDatabaseVectorSearch/appsettings.json b/SqlDatabaseVectorSearch/appsettings.json index 75f72ec..79648fe 100644 --- a/SqlDatabaseVectorSearch/appsettings.json +++ b/SqlDatabaseVectorSearch/appsettings.json @@ -12,6 +12,8 @@ "Endpoint": "", "Deployment": "", "ApiKey": "", + // Set this value only if you're using a model that allows to specify the dimensions of the embeddings + // (e.g. text-embedding-3-small or text-embedding-3-large). Currently, a maximum value of 1998 is supported. "Dimensions": null } },