You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dotnet/README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,6 +504,26 @@ var safeLookup = CopilotTool.DefineTool(
504
504
505
505
If you want to use `AIFunctionFactory.Create` directly, you can set `skip_permission` in the tool's `AdditionalProperties`.
506
506
507
+
#### Deferring Tools
508
+
509
+
Set `CopilotToolOptions.Defer` to control whether a tool may be loaded lazily via tool search rather than always pre-loaded. Use `CopilotToolDefer.Auto` to allow the tool to be deferred and surfaced through tool search, or `CopilotToolDefer.Never` to force it to always be pre-loaded. Defaults to `CopilotToolDefer.Auto`.
510
+
511
+
```csharp
512
+
varlookupIssue=CopilotTool.DefineTool(
513
+
async ([Description("IssueID")] stringid) => {
514
+
// your logic
515
+
},
516
+
toolOptions: newCopilotToolOptions
517
+
{
518
+
Defer=CopilotToolDefer.Auto
519
+
},
520
+
factoryOptions: newAIFunctionFactoryOptions
521
+
{
522
+
Name="lookup_issue",
523
+
Description="Fetch issue details",
524
+
});
525
+
```
526
+
507
527
## Commands
508
528
509
529
Register slash commands so that users of the CLI's TUI can invoke custom actions via `/commandName`. Each command has a `Name`, optional `Description`, and a `Handler` called when the user executes it.
Copy file name to clipboardExpand all lines: go/README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -372,6 +372,18 @@ safeLookup := copilot.DefineTool("safe_lookup", "A read-only lookup that needs n
372
372
safeLookup.SkipPermission = true
373
373
```
374
374
375
+
#### Deferring Tools
376
+
377
+
Set `Defer` to control whether a tool may be loaded lazily via tool search rather than always pre-loaded. Use `copilot.ToolDeferAuto` to allow the tool to be deferred and surfaced through tool search, or `copilot.ToolDeferNever` to force it to always be pre-loaded. Defaults to `copilot.ToolDeferAuto`.
0 commit comments