File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
core/src/main/java/com/google/adk Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 31
31
*
32
32
* <p>This tool operates internally within the model and does not require or perform local code
33
33
* execution.
34
+ *
35
+ * <p>Usage example in an LlmAgent:
36
+ *
37
+ * <pre>{@code
38
+ * LlmAgent agent = LlmAgent.builder()
39
+ * .addTool(GoogleSearchTool.INSTANCE)
40
+ * .build();
41
+ * }</pre>
34
42
*/
35
43
public final class GoogleSearchTool extends BaseTool {
44
+ public static final GoogleSearchTool INSTANCE = new GoogleSearchTool ();
36
45
37
46
public GoogleSearchTool () {
38
47
super ("google_search" , "google_search" );
Original file line number Diff line number Diff line change 41
41
*
42
42
* <p>This tool informs the model about available artifacts and provides their content when
43
43
* requested by the model through a function call.
44
+ *
45
+ * <p>The declaration of this tool is consistent with the Python version. Refer to:
46
+ * https://github.com/google/adk-python/blob/main/src/google/adk/tools/load_artifacts_tool.py
47
+ *
48
+ * <p>Usage example in an LlmAgent:
49
+ *
50
+ * <pre>{@code
51
+ * LlmAgent agent = LlmAgent.builder()
52
+ * .addTool(LoadArtifactsTool.INSTANCE)
53
+ * .build();
54
+ * }</pre>
44
55
*/
45
56
public final class LoadArtifactsTool extends BaseTool {
57
+ public static final LoadArtifactsTool INSTANCE = new LoadArtifactsTool ();
58
+
46
59
public LoadArtifactsTool () {
47
60
super ("load_artifacts" , "Loads the artifacts and adds them to the session." );
48
61
}
Original file line number Diff line number Diff line change @@ -96,8 +96,8 @@ private void initializePreWiredEntries() {
96
96
registerAdkAgentClass (ParallelAgent .class );
97
97
registerAdkAgentClass (SequentialAgent .class );
98
98
99
- registerAdkToolInstance ("google_search" , new GoogleSearchTool () );
100
- registerAdkToolInstance ("load_artifacts" , new LoadArtifactsTool () );
99
+ registerAdkToolInstance ("google_search" , GoogleSearchTool . INSTANCE );
100
+ registerAdkToolInstance ("load_artifacts" , LoadArtifactsTool . INSTANCE );
101
101
registerAdkToolInstance ("exit_loop" , ExitLoopTool .INSTANCE );
102
102
103
103
registerAdkToolClass (AgentTool .class );
You can’t perform that action at this time.
0 commit comments