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.
This commit is contained in:
Marco Minerva
2024-10-01 14:37:01 +02:00
parent 4355f72dab
commit 1b2ebbd6a3
3 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -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
))
+1 -1
View File
@@ -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.";
+2
View File
@@ -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
}
},