Method GetResponseAsync
GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions?, CancellationToken)
GetStreamingResponseAsync(...).ToChatResponseAsync(ct), plus exactly one fix-up:
the citation list is moved from the streaming carrier - an empty TextContent on the
final update - onto the aggregated assistant message's first TextContent, whose
Text is the same concatenation the spans already index, and the emptied carrier is
dropped. The offsets are not recomputed, because the string does not change. The
fix-up exists because MEAI's aggregation may coalesce adjacent TextContents, so the
content holding the full text is the only one whose identity survives it.
public override Task<ChatResponse> GetResponseAsync(IEnumerable<ChatMessage> messages, ChatOptions? options = null, CancellationToken cancellationToken = default)
Parameters
messagesIEnumerable<ChatMessage>The conversation.
optionsChatOptionsThe caller's options. Never mutated.
cancellationTokenCancellationTokenCancels the turn. Never converted into another exception.
Returns
- Task<ChatResponse>
The aggregated response.