mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
Add HTTP client config, update settings, and add package
- Added HTTP client defaults configuration in Program.cs. - Adjusted OpenAPI configuration order in Program.cs. - Changed MaxTokensPerParagraph in AppSettings.cs to 1000. - Added Microsoft.Extensions.Http.Resilience package in SqlDatabaseVectorSearch.csproj. - Reordered and added ModelId properties in appsettings.json.
This commit is contained in:
@@ -34,6 +34,11 @@ builder.Services.AddHybridCache(options =>
|
||||
};
|
||||
});
|
||||
|
||||
builder.Services.ConfigureHttpClientDefaults(builder =>
|
||||
{
|
||||
builder.AddStandardResilienceHandler();
|
||||
});
|
||||
|
||||
// Semantic Kernel is used to generate embeddings and to reformulate questions taking into account all the previous interactions,
|
||||
// so that embeddings themselves can be generated more accurately.
|
||||
builder.Services.AddKernel()
|
||||
@@ -46,8 +51,8 @@ builder.Services.AddScoped<VectorSearchService>();
|
||||
|
||||
builder.Services.AddOpenApi(options =>
|
||||
{
|
||||
options.AddDefaultResponse();
|
||||
options.RemoveServerList();
|
||||
options.AddDefaultResponse();
|
||||
});
|
||||
|
||||
builder.Services.AddDefaultProblemDetails();
|
||||
|
||||
@@ -4,7 +4,7 @@ public class AppSettings
|
||||
{
|
||||
public int MaxTokensPerLine { get; init; } = 300;
|
||||
|
||||
public int MaxTokensPerParagraph { get; init; } = 1024;
|
||||
public int MaxTokensPerParagraph { get; init; } = 1000;
|
||||
|
||||
public int OverlapTokens { get; init; } = 100;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="9.1.0-preview.1.25064.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.1.0" />
|
||||
<PackageReference Include="Microsoft.ML.Tokenizers" Version="1.0.1" />
|
||||
<PackageReference Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="1.0.1" />
|
||||
<PackageReference Include="Microsoft.ML.Tokenizers.Data.O200kBase" Version="1.0.1" />
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
"ChatCompletion": {
|
||||
"Endpoint": "",
|
||||
"Deployment": "",
|
||||
"ApiKey": "",
|
||||
"ModelId": "" // o1, gpt-4o, gpt-4, gpt-3.5
|
||||
"ModelId": "", // o1, gpt-4o, gpt-4, gpt-3.5
|
||||
"ApiKey": ""
|
||||
},
|
||||
"Embedding": {
|
||||
"Endpoint": "",
|
||||
"Deployment": "",
|
||||
"ModelId": "", // text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002
|
||||
"ApiKey": "",
|
||||
"ModelId": "",
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user