SequentialAgent

class SequentialAgent(val name: String, val description: String = "", val subAgents: List<BaseAgent> = emptyList(), val beforeAgentCallbacks: List<BeforeAgentCallback> = emptyList(), val afterAgentCallbacks: List<AfterAgentCallback> = emptyList()) : BaseAgent

A shell agent that runs its sub-agents in sequence.

Constructors

Link copied to clipboard
constructor(name: String, description: String = "", subAgents: List<BaseAgent> = emptyList(), beforeAgentCallbacks: List<BeforeAgentCallback> = emptyList(), afterAgentCallbacks: List<AfterAgentCallback> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

List of callbacks to run after the agent executes.

Link copied to clipboard

List of callbacks to run before the agent executes.

Link copied to clipboard

The description of the agent.

Link copied to clipboard

When true, the framework will not route the next user turn back to this agent after the parent transfers control to it; instead the next turn falls back to the root agent. Set this on utility sub-agents the parent calls and returns from (translators, summarizers, classifiers). Leave at the default false for sub-agents that should keep handling follow-up turns directly (e.g. billing, support).

Link copied to clipboard

When true, prevents this agent from transferring sideways to a peer agent under the same parent. Typically set together with disallowTransferToParent on one-shot utility agents. Violations are surfaced by the runner as IllegalArgumentException.

Link copied to clipboard

The name of the agent.

Link copied to clipboard

List of sub-agents.

Functions

Link copied to clipboard
fun BaseAgent.findAgent(targetName: String): BaseAgent?

Finds an agent with the given name in this agent's subtree (including itself).

Link copied to clipboard
fun runAsync(parentContext: InvocationContext): Flow<Event>

Public entry point for executing the agent asynchronously (text-based).