mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
Merge branch 'master' into ui
This commit is contained in:
@@ -6,7 +6,7 @@ The application is a Minimal API that exposes endpoints to load documents, gener
|
||||
> [!NOTE]
|
||||
> If you prefer to use straight SQL, check out the [sql branch](https://github.com/marcominerva/SqlDatabaseVectorSearch/tree/sql).
|
||||
|
||||

|
||||

|
||||
|
||||
## Setup
|
||||
|
||||
@@ -143,4 +143,4 @@ When using the `/api/ask-streaming` endpoint, answers will be streamed as happen
|
||||
- each one contains a token
|
||||
- The *streamState* property is set to `Append`
|
||||
- *origianlQuestion*, *reformulatedQuestion* and *tokenUsage* are always `null`
|
||||
- The stream ends when an element with *streamState* equals to `End` is received. This element contains token usage information for the question and the whole answer.
|
||||
- The stream ends when an element with *streamState* equals to `End` is received. This element contains token usage information for the question and the whole answer.
|
||||
|
||||
@@ -156,7 +156,14 @@ public class ChatService(IChatCompletionService chatCompletionService, Tokenizer
|
||||
}
|
||||
|
||||
private async Task UpdateCacheAsync(Guid conversationId, ChatHistory chat, CancellationToken cancellationToken)
|
||||
=> await cache.SetAsync(conversationId.ToString(), chat, cancellationToken: cancellationToken);
|
||||
{
|
||||
if (chat.Count > appSettings.MessageLimit)
|
||||
{
|
||||
chat.RemoveRange(0, chat.Count - appSettings.MessageLimit);
|
||||
}
|
||||
|
||||
await cache.SetAsync(conversationId.ToString(), chat, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
private async Task<ChatHistory> GetChatHistoryAsync(Guid conversationId, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -15,4 +15,6 @@ public class AppSettings
|
||||
public int MaxOutputTokens { get; init; } = 800;
|
||||
|
||||
public TimeSpan MessageExpiration { get; init; }
|
||||
|
||||
public int MessageLimit { get; set; } = 20;
|
||||
}
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
"MaxTokensPerParagraph": 1000,
|
||||
"OverlapTokens": 100,
|
||||
"MaxRelevantChunks": 10,
|
||||
"MaxInputTokens": 16385,
|
||||
"MaxInputTokens": 16384,
|
||||
"MaxOutputTokens": 800,
|
||||
"MessageExpiration": "00:05:00"
|
||||
"MessageExpiration": "00:05:00",
|
||||
"MessageLimit": 20
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
||||
Reference in New Issue
Block a user