diff --git a/.dotnet/README.md b/.dotnet/README.md index 122070d2c..1513d65ec 100644 --- a/.dotnet/README.md +++ b/.dotnet/README.md @@ -414,8 +414,12 @@ completion = client.CompleteChat(messages, options); PrintAudioContent(); ``` -Streaming is virtually identical: items in `StreamingChatCompletionUpdate.ContentUpdate` will provide incremental chunks of data via -`AudioBytes` and `AudioTranscript`. +Streaming is highly parallel: `StreamingChatCompletionUpdate` instances can include a `ResponseAudioUpdate` that may +contain any of: + +- The `Id` of the streamed audio content, which can be referenced by subsequent `AssistantChatMessage` instances via `ChatAudioReference` once the streaming response is complete; this may appear across multiple `StreamingChatCompletionUpdate` instances but will always be the same value when present +- The `ExpiresAt` value that describes when the `Id` will no longer be valid for use with `ChatAudioReference` in subsequent requests; this typically appears once and only once, in the final `StreamingResponseAudioUpdate` +- Incremental `TranscriptUpdate` and/or `DataUpdate` values, which can incrementally consumed and, when concatenated, form the complete audio transcript and audio output for the overall response; many of these typically appear ## How to generate text embeddings diff --git a/.dotnet/tests/Chat/ChatTests.cs b/.dotnet/tests/Chat/ChatTests.cs index bf98864f9..c20df8200 100644 --- a/.dotnet/tests/Chat/ChatTests.cs +++ b/.dotnet/tests/Chat/ChatTests.cs @@ -430,7 +430,7 @@ public async Task ChatWithAudio() if (responseAudioUpdate.Id is not null) { Assert.That(streamedCorrelationId, Is.Null.Or.EqualTo(streamedCorrelationId)); - streamedCorrelationId = responseAudioUpdate.Id; + streamedCorrelationId ??= responseAudioUpdate.Id; } if (responseAudioUpdate.ExpiresAt.HasValue) {