Files
SqlDatabaseVectorSearch/SqlDatabaseVectorSearch/Models/Response.cs
T
Marco Minerva 44c6193674 Add streaming and refactor chat/question handling
Updated `Response` record in `Response.cs` to include an optional `StreamState` property, which can be `Start`, `Append`, or `End`. Added a new `StreamState` enum to `Response.cs`.

In `ChatService.cs`, added new methods `AskQuestionAsync` and `AskStreamingAsync` to handle asking questions and streaming responses, respectively. Refactored `CreateChatAsync` to return a `ChatHistory` object.

In `VectorSearchService.cs`, added a new `AskQuestionAsync` method to handle questions using `ChatService`. Updated `CreateContextAsync` to return a tuple with the reformulated question and chunks. Removed the previous implementation of `AskQuestionAsync` and replaced it with the new method utilizing `ChatService`.
2025-01-28 10:14:47 +01:00

10 lines
200 B
C#

namespace SqlDatabaseVectorSearch.Models;
public record class Response(string Question, string Answer, StreamState? StreamState = null);
public enum StreamState
{
Start,
Append,
End
}