Skip to content

Commit c490d7a

Browse files
C# API review fixes (#1343)
1 parent ebac759 commit c490d7a

140 files changed

Lines changed: 1782 additions & 2066 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/auth/authenticate.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ client := copilot.NewClient(nil)
7777
<summary><strong>.NET</strong></summary>
7878

7979
```csharp
80-
using GitHub.Copilot.SDK;
80+
using GitHub.Copilot;
8181

8282
// Default: uses logged-in user credentials
8383
await using var client = new CopilotClient();
@@ -179,23 +179,23 @@ client := copilot.NewClient(&copilot.ClientOptions{
179179

180180
<!-- docs-validate: hidden -->
181181
```csharp
182-
using GitHub.Copilot.SDK;
182+
using GitHub.Copilot;
183183

184184
var userAccessToken = "token";
185185
await using var client = new CopilotClient(new CopilotClientOptions
186186
{
187-
GithubToken = userAccessToken,
187+
GitHubToken = userAccessToken,
188188
UseLoggedInUser = false,
189189
});
190190
```
191191
<!-- /docs-validate: hidden -->
192192

193193
```csharp
194-
using GitHub.Copilot.SDK;
194+
using GitHub.Copilot;
195195

196196
await using var client = new CopilotClient(new CopilotClientOptions
197197
{
198-
GithubToken = userAccessToken, // Token from OAuth flow
198+
GitHubToken = userAccessToken, // Token from OAuth flow
199199
UseLoggedInUser = false, // Don't use stored CLI credentials
200200
});
201201
```

docs/auth/byok.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func main() {
142142
<summary><strong>.NET</strong></summary>
143143

144144
```csharp
145-
using GitHub.Copilot.SDK;
145+
using GitHub.Copilot;
146146

147147
await using var client = new CopilotClient();
148148
await using var session = await client.CreateSessionAsync(new SessionConfig
@@ -424,7 +424,7 @@ func main() {
424424
<summary><strong>.NET</strong></summary>
425425

426426
```csharp
427-
using GitHub.Copilot.SDK;
427+
using GitHub.Copilot;
428428

429429
var client = new CopilotClient(new CopilotClientOptions
430430
{

docs/features/custom-agents.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ session, _ := client.CreateSession(ctx, &copilot.SessionConfig{
173173
<summary><strong>.NET</strong></summary>
174174

175175
```csharp
176-
using GitHub.Copilot.SDK;
176+
using GitHub.Copilot;
177177

178178
await using var client = new CopilotClient();
179179
await using var session = await client.CreateSessionAsync(new SessionConfig
@@ -585,13 +585,13 @@ _, err := session.SendAndWait(ctx, copilot.MessageOptions{
585585

586586
<!-- docs-validate: hidden -->
587587
```csharp
588-
using GitHub.Copilot.SDK;
588+
using GitHub.Copilot;
589589

590590
public static class SubAgentEventsExample
591591
{
592592
public static async Task Example(CopilotSession session)
593593
{
594-
using var subscription = session.On(evt =>
594+
using var subscription = session.On<SessionEvent>(evt =>
595595
{
596596
switch (evt)
597597
{
@@ -622,7 +622,7 @@ public static class SubAgentEventsExample
622622
<!-- /docs-validate: hidden -->
623623

624624
```csharp
625-
using var subscription = session.On(evt =>
625+
using var subscription = session.On<SessionEvent>(evt =>
626626
{
627627
switch (evt)
628628
{

docs/features/hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ session, err := client.CreateSession(ctx, &copilot.SessionConfig{
146146

147147
<!-- docs-validate: hidden -->
148148
```csharp
149-
using GitHub.Copilot.SDK;
149+
using GitHub.Copilot;
150150

151151
public static class HooksExample
152152
{
@@ -348,7 +348,7 @@ session, _ := client.CreateSession(ctx, &copilot.SessionConfig{
348348

349349
<!-- docs-validate: hidden -->
350350
```csharp
351-
using GitHub.Copilot.SDK;
351+
using GitHub.Copilot;
352352

353353
public static class PermissionControlExample
354354
{

docs/features/image-input.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ session.Send(ctx, copilot.MessageOptions{
161161

162162
<!-- docs-validate: hidden -->
163163
```csharp
164-
using GitHub.Copilot.SDK;
164+
using GitHub.Copilot;
165165

166166
public static class ImageInputExample
167167
{
@@ -193,7 +193,7 @@ public static class ImageInputExample
193193
<!-- /docs-validate: hidden -->
194194

195195
```csharp
196-
using GitHub.Copilot.SDK;
196+
using GitHub.Copilot;
197197

198198
await using var client = new CopilotClient();
199199
await using var session = await client.CreateSessionAsync(new SessionConfig
@@ -376,7 +376,7 @@ session.Send(ctx, copilot.MessageOptions{
376376

377377
<!-- docs-validate: hidden -->
378378
```csharp
379-
using GitHub.Copilot.SDK;
379+
using GitHub.Copilot;
380380

381381
public static class BlobAttachmentExample
382382
{

docs/features/mcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func main() {
136136
### .NET
137137

138138
```csharp
139-
using GitHub.Copilot.SDK;
139+
using GitHub.Copilot;
140140

141141
await using var client = new CopilotClient();
142142
await using var session = await client.CreateSessionAsync(new SessionConfig

docs/features/session-persistence.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ session.SendAndWait(ctx, copilot.MessageOptions{Prompt: "Analyze my codebase"})
109109
### C# (.NET)
110110

111111
```csharp
112-
using GitHub.Copilot.SDK;
112+
using GitHub.Copilot;
113113

114114
var client = new CopilotClient();
115115

@@ -201,7 +201,7 @@ session.SendAndWait(ctx, copilot.MessageOptions{Prompt: "What did we discuss ear
201201

202202
<!-- docs-validate: hidden -->
203203
```csharp
204-
using GitHub.Copilot.SDK;
204+
using GitHub.Copilot;
205205

206206
public static class ResumeSessionExample
207207
{

docs/features/skills.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func main() {
116116
<summary><strong>.NET</strong></summary>
117117

118118
```csharp
119-
using GitHub.Copilot.SDK;
119+
using GitHub.Copilot;
120120

121121
await using var client = new CopilotClient();
122122
await using var session = await client.CreateSessionAsync(new SessionConfig
@@ -244,7 +244,7 @@ session, _ := client.CreateSession(context.Background(), &copilot.SessionConfig{
244244

245245
<!-- docs-validate: hidden -->
246246
```csharp
247-
using GitHub.Copilot.SDK;
247+
using GitHub.Copilot;
248248

249249
public static class SkillsExample
250250
{

docs/features/steering-and-queueing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func main() {
152152
<summary><strong>.NET</strong></summary>
153153

154154
```csharp
155-
using GitHub.Copilot.SDK;
155+
using GitHub.Copilot;
156156

157157
await using var client = new CopilotClient();
158158
await using var session = await client.CreateSessionAsync(new SessionConfig
@@ -361,7 +361,7 @@ session.Send(ctx, copilot.MessageOptions{
361361

362362
<!-- docs-validate: hidden -->
363363
```csharp
364-
using GitHub.Copilot.SDK;
364+
using GitHub.Copilot;
365365

366366
public static class QueueingExample
367367
{

docs/features/streaming-events.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ session.On(func(event copilot.SessionEvent) {
161161

162162
<!-- docs-validate: hidden -->
163163
```csharp
164-
using GitHub.Copilot.SDK;
164+
using GitHub.Copilot;
165165

166166
public static class StreamingEventsExample
167167
{
168168
public static async Task Example(CopilotSession session)
169169
{
170-
session.On(evt =>
170+
session.On<SessionEvent>(evt =>
171171
{
172172
if (evt is AssistantMessageDeltaEvent delta)
173173
{
@@ -180,7 +180,7 @@ public static class StreamingEventsExample
180180
<!-- /docs-validate: hidden -->
181181

182182
```csharp
183-
session.On(evt =>
183+
session.On<SessionEvent>(evt =>
184184
{
185185
if (evt is AssistantMessageDeltaEvent delta)
186186
{

0 commit comments

Comments
 (0)