Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/src/main/java/com/google/adk/tools/GoogleSearchTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@
*
* <p>This tool operates internally within the model and does not require or perform local code
* execution.
*
* <p>Usage example in an LlmAgent:
*
* <pre>{@code
* LlmAgent agent = LlmAgent.builder()
* .addTool(GoogleSearchTool.INSTANCE)
* .build();
* }</pre>
*/
public final class GoogleSearchTool extends BaseTool {
public static final GoogleSearchTool INSTANCE = new GoogleSearchTool();

public GoogleSearchTool() {
super("google_search", "google_search");
Expand Down
13 changes: 13 additions & 0 deletions core/src/main/java/com/google/adk/tools/LoadArtifactsTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,21 @@
*
* <p>This tool informs the model about available artifacts and provides their content when
* requested by the model through a function call.
*
* <p>The declaration of this tool is consistent with the Python version. Refer to:
* https://github.com/google/adk-python/blob/main/src/google/adk/tools/load_artifacts_tool.py
*
* <p>Usage example in an LlmAgent:
*
* <pre>{@code
* LlmAgent agent = LlmAgent.builder()
* .addTool(LoadArtifactsTool.INSTANCE)
* .build();
* }</pre>
*/
public final class LoadArtifactsTool extends BaseTool {
public static final LoadArtifactsTool INSTANCE = new LoadArtifactsTool();

public LoadArtifactsTool() {
super("load_artifacts", "Loads the artifacts and adds them to the session.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ private void initializePreWiredEntries() {
registerAdkAgentClass(ParallelAgent.class);
registerAdkAgentClass(SequentialAgent.class);

registerAdkToolInstance("google_search", new GoogleSearchTool());
registerAdkToolInstance("load_artifacts", new LoadArtifactsTool());
registerAdkToolInstance("google_search", GoogleSearchTool.INSTANCE);
registerAdkToolInstance("load_artifacts", LoadArtifactsTool.INSTANCE);
registerAdkToolInstance("exit_loop", ExitLoopTool.INSTANCE);

registerAdkToolClass(AgentTool.class);
Expand Down