File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,11 @@ Create a new console project and add this to `Program.cs`:
210210using GitHub .Copilot .SDK ;
211211
212212await using var client = new CopilotClient ();
213- await using var session = await client .CreateSessionAsync (new SessionConfig { Model = " gpt-4.1" });
213+ await using var session = await client .CreateSessionAsync (new SessionConfig
214+ {
215+ Model = " gpt-4.1" ,
216+ OnPermissionRequest = PermissionHandler .ApproveAll
217+ });
214218
215219var response = await session .SendAndWaitAsync (new MessageOptions { Prompt = " What is 2 + 2?" });
216220Console .WriteLine (response ? .Data .Content );
@@ -368,6 +372,7 @@ await using var client = new CopilotClient();
368372await using var session = await client .CreateSessionAsync (new SessionConfig
369373{
370374 Model = " gpt-4.1" ,
375+ OnPermissionRequest = PermissionHandler .ApproveAll ,
371376 Streaming = true ,
372377});
373378
@@ -811,6 +816,7 @@ var getWeather = AIFunctionFactory.Create(
811816await using var session = await client .CreateSessionAsync (new SessionConfig
812817{
813818 Model = " gpt-4.1" ,
819+ OnPermissionRequest = PermissionHandler .ApproveAll ,
814820 Streaming = true ,
815821 Tools = [getWeather ],
816822});
@@ -1114,6 +1120,7 @@ await using var client = new CopilotClient();
11141120await using var session = await client .CreateSessionAsync (new SessionConfig
11151121{
11161122 Model = " gpt-4.1" ,
1123+ OnPermissionRequest = PermissionHandler .ApproveAll ,
11171124 Streaming = true ,
11181125 Tools = [getWeather ]
11191126});
You can’t perform that action at this time.
0 commit comments