/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { Event } from '../events/event.js'; import { BaseAgent, BaseAgentConfig } from './base_agent.js'; import { InvocationContext } from './invocation_context.js'; /** * The configuration options for creating a loop agent. */ export interface LoopAgentConfig extends BaseAgentConfig { /** * The maximum number of iterations the loop agent will run. * * If not provided, the loop agent will run indefinitely. */ maxIterations?: number; } /** * A unique symbol to identify ADK agent classes. * Defined once and shared by all LoopAgent instances. */ declare const LOOP_AGENT_SIGNATURE_SYMBOL: unique symbol; /** * Type guard to check if an object is an instance of LoopAgent. * @param obj The object to check. * @returns True if the object is an instance of LoopAgent, false otherwise. */ export declare function isLoopAgent(obj: unknown): obj is LoopAgent; /** * A shell agent that run its sub-agents in a loop. * * When sub-agent generates an event with escalate or max_iterations are * reached, the loop agent will stop. * * @deprecated Use `Workflow` instead, which expresses the same ordering as a * graph and adds routing, retries, HITL and resumability. This class will be * removed in a future version. Note that a `Workflow` cannot yet be an * `LlmAgent` sub-agent. */ export declare class LoopAgent extends BaseAgent { /** * A unique symbol to identify ADK loop agent class. */ readonly [LOOP_AGENT_SIGNATURE_SYMBOL] = true; readonly maxIterations: number; constructor(config: LoopAgentConfig); protected runAsyncImpl(context: InvocationContext): AsyncGenerator; protected runLiveImpl(context: InvocationContext): AsyncGenerator; } export {};