dotnet / dotnet/extensions

[AI Evaluation] How should MEAI.Eval be used with GetStreamingResponseAsync

Open
#6,342 3 comments 0 reactions 0 assignees View on GitHub
area-ai-eval
Dominant language
C#
Stars
3.2k
Forks
894
Avg merge
1d 12h
Merged PRs (30d)
23

Description

The examples I've seen for using the Eval library all use `IChatClient.GetResponseAsync` which returns a `ChatResponse`. The `IChatClient.GetStreamingResponseAsync` method returns a `ChatResponseUpdate`. So in order to use the evaluation library I need to do:
```csharp
StringBuilder builder = new();
await foreach (var msg in IChatClient.GetStreamingResponseAsync())
{
builder.Append(msg.Text);
}
scenarioRun.EvaluateAsync(chatMessages, new ChatResponse(new ChatMessage(ChatRole.Assistant, builder.ToString())
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.