Skip to content

Commit 7a43bfd

Browse files
Fix docs validation: add permission handler to getting-started.md examples
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 02c6a37 commit 7a43bfd

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

docs/getting-started.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,14 +1193,14 @@ Once the CLI is running in server mode, configure your SDK client to connect to
11931193
<summary><strong>Node.js / TypeScript</strong></summary>
11941194

11951195
```typescript
1196-
import { CopilotClient } from "@github/copilot-sdk";
1196+
import { CopilotClient, approveAll } from "@github/copilot-sdk";
11971197

11981198
const client = new CopilotClient({
11991199
cliUrl: "localhost:4321"
12001200
});
12011201

12021202
// Use the client normally
1203-
const session = await client.createSession();
1203+
const session = await client.createSession({ onPermissionRequest: approveAll });
12041204
// ...
12051205
```
12061206

@@ -1210,15 +1210,15 @@ const session = await client.createSession();
12101210
<summary><strong>Python</strong></summary>
12111211

12121212
```python
1213-
from copilot import CopilotClient
1213+
from copilot import CopilotClient, PermissionHandler
12141214

12151215
client = CopilotClient({
12161216
"cli_url": "localhost:4321"
12171217
})
12181218
await client.start()
12191219

12201220
# Use the client normally
1221-
session = await client.create_session()
1221+
session = await client.create_session({"on_permission_request": PermissionHandler.approve_all})
12221222
# ...
12231223
```
12241224

@@ -1241,7 +1241,9 @@ if err := client.Start(ctx); err != nil {
12411241
defer client.Stop()
12421242

12431243
// Use the client normally
1244-
session, err := client.CreateSession(ctx, nil)
1244+
session, err := client.CreateSession(ctx, &copilot.SessionConfig{
1245+
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
1246+
})
12451247
// ...
12461248
```
12471249

@@ -1260,7 +1262,10 @@ using var client = new CopilotClient(new CopilotClientOptions
12601262
});
12611263

12621264
// Use the client normally
1263-
await using var session = await client.CreateSessionAsync();
1265+
await using var session = await client.CreateSessionAsync(new()
1266+
{
1267+
OnPermissionRequest = PermissionHandler.ApproveAll
1268+
});
12641269
// ...
12651270
```
12661271

0 commit comments

Comments
 (0)