Readonly[A unique symbol to identify ADK agent classes.
Readonly[Brand identifying this object as a BaseNode (see isBaseNode).
Readonly[A unique symbol to identify ADK LLM agent class.
ReadonlyafterCallback or list of callbacks to be invoked after the agent run.
When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return undefined.
Each callback takes a single Context argument. Returning Content
emits it as the agent's response, appended to the event history; return
undefined to leave the response as the agent produced it.
OptionalafterOptionalafterReadonlybeforeCallback or list of callbacks to be invoked before the agent run.
When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return undefined.
Each callback takes a single Context argument. Returning Content
skips this agent's own run — its runAsyncImpl body and its
afterAgentCallback — and emits the returned content as this agent's
response; return undefined to let the run proceed.
That skip is scoped to this agent. It sets endInvocation on the
invocation context the agent created for itself, which is a copy of its
parent's, so callers above are unaffected: a SequentialAgent still runs
the remaining sub-agents.
OptionalbeforeOptionalbeforeOptionalcodeProtected ReadonlyconfigThe config this agent was constructed from.
Stored so clone can rebuild the agent by re-running the concrete constructor with overrides applied, which re-derives all state correctly instead of copying an already-mutated instance. Shallow-copied so later external mutation of the caller's object does not leak into clones.
ReadonlydescriptionOptionalgenerateReadonlyincludeWhether includeContents was set by the caller rather than defaulted.
A workflow node runs its agent for a single turn on the input the graph
handed it, so the agent must not also read the surrounding conversation —
unless the author asked for it. Mirrors Python checking
'include_contents' in agent.model_fields_set.
OptionalinputOptional ReadonlyinputThe input schema exactly as it was supplied, before conversion into the genai dialect.
inputSchema is normalized to a genai Schema because that is what the
model API and function declarations require, but that conversion is lossy:
a Zod refinement, transform, or custom error message has no genai
equivalent. Validation therefore uses the original, falling back to the
converted form when the schema was given in the genai dialect to begin
with.
Optional ReadonlyisolationOptionalmodeOptionalmodelReadonlynameThe agent's name. Agent name must be a JS identifier and unique within the agent tree. Agent name cannot be "user", since it's reserved for end-user's input.
OptionaloutputOptionaloutputOptional ReadonlyoutputThe output schema as supplied — see inputSchemaSource.
OptionalparentThe parent agent of this agent.
Note that an agent can ONLY be added as sub-agent once.
If you want to add one agent twice as sub-agent, consider to create two agent instances with identical config, but with different name and add them to the agent tree.
The parent agent is the agent that created this agent.
OptionalplannerOptional ReadonlypreparedThe retry config with its exception filter normalized once, up front (see prepareRetryConfig). Used by the node runner so the retry hot path never re-normalizes or throws on a malformed config mid-retry.
ReadonlyrerunOptional ReadonlyretryOptional ReadonlystateReadonlysubThe sub-agents of this agent.
Optional ReadonlytimeoutReadonlywaitThe resolved afterModelCallback field as a list of SingleAfterModelCallback.
This method is only for use by Agent Development Kit.
The resolved afterToolCallback field as a list of AfterToolCallback.
This method is only for use by Agent Development Kit.
The resolved beforeModelCallback field as a list of SingleBeforeModelCallback.
This method is only for use by Agent Development Kit.
The resolved beforeToolCallback field as a list of BeforeToolCallback.
This method is only for use by Agent Development Kit.
The resolved BaseLlm instance.
When not set, the agent will inherit the model from its ancestor.
The finish_task tool for this agent (task mode). Lazily created and cached
so its declaration (derived from outputSchema) is stable across turns.
Whether this node must wait for ALL of its predecessors to trigger before
it runs (fan-in barrier). Overridden by JoinNode.
Root agent of this agent. Computed dynamically by traversing up the parent chain.
ProtectedcallThe resolved globalInstruction field to construct global instruction.
This method is only for use by Agent Development Kit.
The context to retrieve the session state.
The resolved globalInstruction field.
The resolved instruction field to construct instruction for this agent.
This method is only for use by Agent Development Kit.
The context to retrieve the session state.
The resolved instruction field.
The resolved tools field as a list of BaseTool based on the context.
This method is only for use by Agent Development Kit.
Optionalcontext: ReadonlyContextCreates a copy of this agent with the given config fields overridden.
The clone is a detached root: its parentAgent is always undefined.
Sub-agents are recursively cloned (and re-parented to the clone) unless
subAgents is overridden. Rebuilding via the concrete constructor
re-derives all state, so a cloned LlmAgent gets a fresh
requestProcessors array rather than sharing the original's.
See google/adk-js#534.
Optionaloverrides: Partial<LlmAgentConfig>Config fields to override on the clone. Overriding
parentAgent is rejected: parentage is assigned only when a parent
agent is constructed with its sub-agents.
A new detached agent instance of the same concrete class.
ProtectedcreateCreates an invocation context for this agent.
The invocation context of the parent agent.
The invocation context for this agent.
Finds the agent with the given name in this agent and its descendants.
The name of the agent to find.
The agent with the given name, or undefined if not found.
Finds the agent with the given name in this agent's descendants.
The name of the agent to find.
The agent with the given name, or undefined if not found.
ProtectedhandleRuns the after agent callback if it exists.
The invocation context of the agent.
The event to return to the user, or undefined if no event is generated.
ProtectedhandleRuns the before agent callback if it exists.
The invocation context of the agent.
The event to return to the user, or undefined if no event is generated.
Runs the node, normalizing every yielded item into an Event. This
is what the engine (and ctx.runNode()) consumes. Validates the input
against inputSchema once, up front (skipping genai Content, which nodes
coerce themselves).
ProtectedrunEntry method to run an agent via text-based conversation.
The invocation context of the parent agent.
An AsyncGenerator that yields the events generated by the agent.
ProtectedrunCore logic to run this agent via text-based conversation.
The invocation context of the agent.
An AsyncGenerator that yields the events generated by the agent.
ProtectedrunRuns this agent as a workflow node.
Where BaseAgent.runImpl delegates straight to runAsync, an
LlmAgent has a node input to inject into the conversation, instruction
placeholders to resolve against it, a reply to promote to node output, and
— in task mode — a finish_task round-trip to drive. All of that lives
in runLlmAgentAsNode, mirroring adk-python's LlmAgent._run_impl
delegating to run_llm_agent_as_node.
Entry method to run an agent via video/audio-based conversation.
The invocation context of the parent agent.
An AsyncGenerator that yields the events generated by the agent.
ProtectedrunCore logic to run this agent via video/audio-based conversation.
The invocation context of the agent.
An AsyncGenerator that yields the events generated by the agent.
ProtectedtoNormalizes a single yielded item into an Event (or null to skip).
Subclasses may override for richer coercion (e.g. FunctionNode).
ProtectedvalidateValidates node input against inputSchema (Content passes through). Only
enforced for Zod schemas; a genai Schema is left unvalidated (see
parseWithSchema).
Validates a value against this agent's output schema, in whichever dialect it was declared, and returns the parsed value.
Prefers the schema as supplied (outputSchemaSource) over the genai form derived from it, since the conversion drops constraints Zod can express and genai cannot.
An agent that uses a large language model to generate responses.