forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
34 lines (27 loc) · 797 Bytes
/
Copy pathProgram.cs
File metadata and controls
34 lines (27 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using GitHub.Copilot.SDK;
using var client = new CopilotClient(new CopilotClientOptions
{
CliPath = Environment.GetEnvironmentVariable("COPILOT_CLI_PATH"),
GitHubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"),
});
await client.StartAsync();
try
{
await using var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "claude-haiku-4.5",
});
var response = await session.SendAndWaitAsync(new MessageOptions
{
Prompt = "Use the grep tool to search for the word 'SDK' in README.md and show the matching lines.",
});
if (response != null)
{
Console.WriteLine($"Response: {response.Data?.Content}");
}
Console.WriteLine("Default mode test complete");
}
finally
{
await client.StopAsync();
}