using GitHub.Copilot; using var client = new CopilotClient(); await client.StartAsync(); try { await using var session = await client.CreateSessionAsync(new SessionConfig { Model = "claude-haiku-4.5", Streaming = true, }); var chunkCount = 0; using var subscription = session.On(evt => { if (evt is AssistantMessageDeltaEvent) { chunkCount++; } }); var response = await session.SendAndWaitAsync(new MessageOptions { Prompt = "What is the capital of France?", }); if (response != null) { Console.WriteLine(response.Data.Content); } Console.WriteLine($"\nStreaming chunks received: {chunkCount}"); } finally { await client.StopAsync(); }