-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathPreToolUseHandler.java
More file actions
35 lines (31 loc) · 1.11 KB
/
PreToolUseHandler.java
File metadata and controls
35 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.sdk.json;
import java.util.concurrent.CompletableFuture;
/**
* Handler for pre-tool-use hooks.
* <p>
* This hook is called before a tool is executed, allowing you to:
* <ul>
* <li>Approve or deny tool execution</li>
* <li>Modify tool arguments</li>
* <li>Add additional context for the model</li>
* </ul>
*
* @since 1.0.6
*/
@FunctionalInterface
public interface PreToolUseHandler {
/**
* Handles a pre-tool-use hook invocation.
*
* @param input
* the hook input containing tool name and arguments
* @param invocation
* context information about the invocation
* @return a future that resolves with the hook output, or {@code null} to use
* defaults
*/
CompletableFuture<PreToolUseHookOutput> handle(PreToolUseHookInput input, HookInvocation invocation);
}