varapiKey=Environment.GetEnvironmentVariable("OPENAI_API_KEY")is{Length:>0}apiKeyValue?apiKeyValue:thrownewAssertInconclusiveException("OPENAI_API_KEY environment variable is not found.");varmodel=Environment.GetEnvironmentVariable("OPENAI_REALTIME_MODEL")is{Length:>0}modelValue?modelValue:"gpt-4o-realtime-preview";usingvarclient=newOpenAiRealtimeClient(apiKey);usingvarcancellationTokenSource=newCancellationTokenSource(TimeSpan.FromSeconds(30));varcancellationToken=cancellationTokenSource.Token;awaitclient.ConnectAsync(model:model,cancellationToken:cancellationToken);awaitforeach(varserverEventinclient.ReceiveUpdatesAsync(cancellationToken)){if(serverEvent.IsSessionCreated){Console.WriteLine(serverEvent.SessionCreated!.EventId);return;}if(serverEvent.IsError){thrownewAssertFailedException($"Realtime connection returned an error: {serverEvent.Error!.Error.Message}");}}thrownewAssertFailedException("Realtime connection did not produce a session.created event before timing out.");