varapiKey=Environment.GetEnvironmentVariable("DID_API_KEY")is{Length:>0}key?key:thrownewAssertInconclusiveException("DID_API_KEY environment variable is not found.");varagentId=Environment.GetEnvironmentVariable("DID_AGENT_ID")is{Length:>0}id?id:thrownewAssertInconclusiveException("DID_AGENT_ID environment variable is not found.");varclient=newDIdClient(apiKey);// Create and connect via the unified interfaceawaitusingvaravatar=awaitDIdRealtimeAvatarClient.ConnectAsync(client,agentId);// Verify the adapter implements IRealtimeAvatarClienttryAGI.RealtimeAvatar.IRealtimeAvatarClientrealtimeClient=avatar;// SendAudioAsync should throw NotSupportedException (D-ID is text-only)Func<Task>sendAudio=()=>avatar.SendAudioAsync(ReadOnlyMemory<byte>.Empty);// Send text and receive at least one video frameawaitavatar.SendTextAsync("Hello, this is a test.");usingvarcts=newCancellationTokenSource(TimeSpan.FromSeconds(30));varreceivedVideo=false;varreceivedAudio=false;varvideoTask=Task.Run(async()=>{awaitforeach(varframeinavatar.ReceiveVideoFramesAsync(cts.Token)){receivedVideo=true;break;// Just verify we get at least one frame}},cts.Token);varaudioTask=Task.Run(async()=>{awaitforeach(varframeinavatar.ReceiveAudioFramesAsync(cts.Token)){receivedAudio=true;break;}},cts.Token);try{awaitTask.WhenAny(videoTask,audioTask,Task.Delay(TimeSpan.FromSeconds(30),cts.Token));}catch(OperationCanceledException){}// At least one type of frame should be received"Expected to receive at least one video or audio frame from D-ID avatar.");