Class ExitLoopTool

java.lang.Object
com.google.adk.tools.ExitLoopTool

public final class ExitLoopTool extends Object
Tool for exiting execution of LoopAgent.
  • Field Details

  • Method Details

    • exitLoop

      public static void exitLoop(ToolContext toolContext)
      Exit the LoopAgent execution.

      Usage example in an LlmAgent:

      LlmAgent subAgent = LlmAgent.builder()
          .addTool(ExitLoopTool.INSTANCE)
          .build();
      

      The @Schema name and description is consistent with the Python version.

      Refer to: https://github.com/google/adk-python/blob/main/src/google/adk/tools/exit_loop_tool.py