mirror of
https://github.com/github/awesome-copilot.git
synced 2026-03-21 08:35:14 +00:00
Update .NET Copilot SDK recipes for explicit permission (fix for SDK v0.1.28) (#1033)
* Update .NET Copilot SDK recipes for explicit permission handling (fix breaking change in SDK v0.1.28) * Update .NET Copilot SDK recipes for explicit permission handling
This commit is contained in:
@@ -6,6 +6,7 @@ Use Copilot to intelligently organize files in a folder based on their metadata.
|
||||
>
|
||||
> ```bash
|
||||
> dotnet run recipe/managing-local-files.cs
|
||||
> dotnet run recipe/managing-local-files.cs -- /path/to/folder
|
||||
> ```
|
||||
|
||||
## Example scenario
|
||||
@@ -24,7 +25,8 @@ await client.StartAsync();
|
||||
// Define tools for file operations
|
||||
var session = await client.CreateSessionAsync(new SessionConfig
|
||||
{
|
||||
Model = "gpt-5"
|
||||
Model = "gpt-5",
|
||||
OnPermissionRequest = PermissionHandler.ApproveAll
|
||||
});
|
||||
|
||||
// Wait for completion
|
||||
@@ -49,8 +51,8 @@ session.On(evt =>
|
||||
}
|
||||
});
|
||||
|
||||
// Ask Copilot to organize files
|
||||
var targetFolder = @"C:\Users\Me\Downloads";
|
||||
// Use an explicit folder or default to the current directory
|
||||
var targetFolder = args.FirstOrDefault() ?? Environment.CurrentDirectory;
|
||||
|
||||
await session.SendAsync(new MessageOptions
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user