Method AttachTo
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
updateChatResponseUpdatecitationsIReadOnlyList<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.