Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created May 8, 2026 20:21
Show Gist options
  • Select an option

  • Save wullemsb/89f80f824094e1250d970da9e63616e3 to your computer and use it in GitHub Desktop.

Select an option

Save wullemsb/89f80f824094e1250d970da9e63616e3 to your computer and use it in GitHub Desktop.
using GitHub.Copilot.SDK;
await using var client = new CopilotClient();
await client.StartAsync();
var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "gpt-4.1",
OnPermissionRequest = PermissionHandler.ApproveAll,
});
var response = await session.SendAndWaitAsync(new MessageOptions
{
Prompt = "What are three things I should know before building an agentic app?"
});
Console.WriteLine(response?.Data.Content);
await client.StopAsync();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment