usingvarclient=newGeminiClient(apiKey);try{usingvarcts=newCancellationTokenSource(TimeSpan.FromSeconds(30));// Demonstrates a multi-turn conversation using sequential text exchanges.awaitusingvarsession=awaitclient.ConnectLiveAsync(CreateLiveConfig(),cancellationToken:cts.Token);// First turn: tell the model a fact.awaitsession.SendTextAsync("My name is Alice",cts.Token);awaitforeach(varmessageinsession.ReadEventsAsync(cts.Token)){if(message.ServerContent?.TurnComplete==true){break;}}// Second turn: ask the model to recall the fact.awaitsession.SendTextAsync("What is my name?",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){}