Class AgentTransfer

java.lang.Object
com.google.adk.flows.llmflows.AgentTransfer
All Implemented Interfaces:
RequestProcessor

public final class AgentTransfer extends Object implements RequestProcessor
RequestProcessor that handles agent transfer for LLM flow.
  • Constructor Details

    • AgentTransfer

      public AgentTransfer()
  • Method Details

    • processRequest

      public io.reactivex.rxjava3.core.Single<RequestProcessor.RequestProcessingResult> processRequest(InvocationContext context, LlmRequest request)
      Description copied from interface: RequestProcessor
      Process the LLM request as part of the pre-processing stage.
      Specified by:
      processRequest in interface RequestProcessor
      Parameters:
      context - the invocation context.
      request - the LLM request to process.
      Returns:
      a list of events generated during processing (if any).
    • transferToAgent

      public static void transferToAgent(String agentName, ToolContext toolContext)
    • legacyTransferToAgent

      public static void legacyTransferToAgent(String agentName, ToolContext toolContext)
      Backwards compatible transferToAgent that uses camel-case naming instead of the ADK's snake_case convention.

      It exists only to support users who already use literal "transferToAgent" function call to instruct ADK to transfer the question to another agent.