mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
4571478787
Updated citation management in the application by removing the `RemoveCitations` and `ExtractCitations` methods in `Ask.razor`, and directly processing citations from the `delta` object. The `Response` class now includes a `Citations` property for better data handling. Modified `VectorSearchService.cs` to extract citations from the full answer in `AskQuestionAsync` and return them at the end of the streaming process in `AskStreamingAsync`. Introduced a new `Citation` class in `Citation.cs` to encapsulate citation properties, ensuring structured management of citation data. Updated citation formatting rules to enforce a specific XML format, ensuring citations are presented at the end of responses rather than within the answer text.
10 lines
567 B
C#
10 lines
567 B
C#
namespace SqlDatabaseVectorSearch.Models;
|
|
|
|
// Question and Answer can be null when using response streaming.
|
|
public record class Response(string? OriginalQuestion, string? ReformulatedQuestion, string? Answer, StreamState? StreamState = null, TokenUsageResponse? TokenUsage = null, IEnumerable<Citation>? Citations = null)
|
|
{
|
|
public Response(string? token, StreamState streamState, TokenUsageResponse? tokenUsageResponse = null, IEnumerable<Citation>? citations = null)
|
|
: this(null, null, token, streamState, tokenUsageResponse, citations)
|
|
{
|
|
}
|
|
} |