Skip to content

[Microsoft.Extensions.AI] Questions on undocumented features #6389

Answered by stephentoub
raffaeler asked this question in Q&A
Discussion options

You must be logged in to vote

If you don't want to use the automatic invocation and instead want to use manual invocation, you would just do effectively the same thing that FunctionInvocationChatClient is doing here:

for (int iteration = 0; ; iteration++)
{
updates.Clear();
functionCallContents?.Clear();
await foreach (var update in base.GetStreamingResponseAsync(messages, options, cancellationToken))
{
if (update is null)
{
Throw.InvalidOperationException($"The inner {nameof(IChatClient)} streamed a null {nameof(ChatResponseUpdate)}.");
}

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@stephentoub
Comment options

Answer selected by raffaeler
Comment options

You must be logged in to vote
4 replies
@stephentoub
Comment options

@raffaeler
Comment options

@stephentoub
Comment options

@raffaeler
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants