mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
Refactor response handling and content decoding
- Updated `TextContentDecoder` to use `ITextChunker` for paragraph splitting and return a list of `Chunk` objects. - Changed return type of `Stream` method in `AskEndpoints.cs` from `IAsyncEnumerable<QuestionResponse>` to `IAsyncEnumerable<Response>`. - Removed `QuestionResponse` class and introduced `Response` class to better handle streaming responses. - Modified `AskQuestionAsync` and `AskStreamingAsync` methods in `VectorSearchService` to return `Response` instead of `QuestionResponse`, and adjusted token count calculation. - Added namespace declaration in `Response.cs` and defined properties to align with new response structure.
This commit is contained in:
@@ -23,7 +23,7 @@ public class AskEndpoints : IEndpointRouteHandlerBuilder
|
||||
endpoints.MapPost("/api/ask-streaming", (Question question, VectorSearchService vectorSearchService, CancellationToken cancellationToken,
|
||||
[Description("If true, the question will be reformulated taking into account the context of the chat identified by the given ConversationId.")] bool reformulate = true) =>
|
||||
{
|
||||
async IAsyncEnumerable<QuestionResponse> Stream()
|
||||
async IAsyncEnumerable<Response> Stream()
|
||||
{
|
||||
// Requests a streaming response.
|
||||
var responseStream = vectorSearchService.AskStreamingAsync(question, reformulate, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user