Table of Contents

Method AttachTo

Namespace
Qavren.Edge.Rag
Assembly
Qavren.Edge.Rag.dll

AttachTo(ChatResponseUpdate, IReadOnlyList<CitationAnnotation>)

Attaches citations to update by appending one TextContent(string.Empty) whose Annotations hold them. The carrier is spelled out as a public helper because an AIAnnotation hangs off an AIContent and the final update has no text content of its own to hang them on - and because a consumer writing their own middleware should attach them the same way.

public static void AttachTo(ChatResponseUpdate update, IReadOnlyList<CitationAnnotation> citations)

Parameters

update ChatResponseUpdate
citations IReadOnlyList<CitationAnnotation>

Remarks

The carrier is empty text on purpose: it contributes nothing to ChatResponse.Text, so the offsets the citations carry still index the same string. An empty citations list attaches nothing rather than an empty carrier.