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 3131 *
3232 * <p>This tool operates internally within the model and does not require or perform local code
3333 * 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>
3442 */
3543public final class GoogleSearchTool extends BaseTool {
44+ public static final GoogleSearchTool INSTANCE = new GoogleSearchTool ();
3645
3746 public GoogleSearchTool () {
3847 super ("google_search" , "google_search" );
Original file line number Diff line number Diff line change 4141 *
4242 * <p>This tool informs the model about available artifacts and provides their content when
4343 * 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>
4455 */
4556public final class LoadArtifactsTool extends BaseTool {
57+ public static final LoadArtifactsTool INSTANCE = new LoadArtifactsTool ();
58+
4659 public LoadArtifactsTool () {
4760 super ("load_artifacts" , "Loads the artifacts and adds them to the session." );
4861 }
Original file line number Diff line number Diff line change @@ -96,8 +96,8 @@ private void initializePreWiredEntries() {
9696 registerAdkAgentClass (ParallelAgent .class );
9797 registerAdkAgentClass (SequentialAgent .class );
9898
99- registerAdkToolInstance ("google_search" , new GoogleSearchTool () );
100- registerAdkToolInstance ("load_artifacts" , new LoadArtifactsTool () );
99+ registerAdkToolInstance ("google_search" , GoogleSearchTool . INSTANCE );
100+ registerAdkToolInstance ("load_artifacts" , LoadArtifactsTool . INSTANCE );
101101 registerAdkToolInstance ("exit_loop" , ExitLoopTool .INSTANCE );
102102
103103 registerAdkToolClass (AgentTool .class );
You can’t perform that action at this time.
0 commit comments