using var client = new AnthropicClient(apiKey);
var enumerable = client.CreateMessageAsStreamAsync(new CreateMessageParams
{
Model = ModelVariant2.Claude37SonnetLatest,
Messages = ["Once upon a time"],
MaxTokens = 250,
}, anthropicVersion: "2023-06-01");
var deltas = new List<string>();
await foreach (var response in enumerable)
{
Console.Write(response.ContentBlockDelta?.Delta.TextDelta?.Text);
deltas.Add(response.ContentBlockDelta?.Delta.TextDelta?.Text ?? string.Empty);
}