usingvarclient=newGeminiClient(apiKey);try{usingvarcts=newCancellationTokenSource(TimeSpan.FromSeconds(30));// Connects using ResilientLiveSession and verifies basic text exchange works.varconfig=CreateLiveConfig();awaitusingvarsession=awaitclient.ConnectResilientLiveAsync(config,cancellationToken:cts.Token);// Send a text message through the resilient session.awaitsession.SendTextAsync("Say hello",cts.Token);boolreceivedResponse=false;awaitforeach(varmessageinsession.ReadEventsAsync(cts.Token)){if(message.ServerContent?.ModelTurn?.Partsis{Count:>0}){receivedResponse=true;}if(message.ServerContent?.TurnComplete==true){break;}}}catch(WebSocketExceptionex){}catch(OperationCanceledException){}