Class NodeViewAgent
java.lang.Object
com.google.adk.workflow.BaseNode
com.google.adk.agents.BaseAgent
com.google.adk.agents.NodeViewAgent
- All Implemented Interfaces:
Node
A read-only agent that stands in for a non-agent workflow node so code reading the agent of an
app, runner, or invocation keeps working when they run a node. It never runs; the runner runs the
node itself.
-
Nested Class Summary
Nested classes/interfaces inherited from class BaseAgent
BaseAgent.Builder<B>Modifier and TypeClassDescriptionstatic classBaseAgent.Builder<B extends BaseAgent.Builder<B>>Base Builder for all agents. -
Constructor Summary
ConstructorsConstructorDescriptionNodeViewAgent(Node node) Creates an agent that stands in fornode, using its name and description. -
Method Summary
Modifier and TypeMethodDescriptionnode()Returns the node this agent stands in for.io.reactivex.rxjava3.core.Flowable<Event> runAsync(InvocationContext parentContext) Runs the agent asynchronously.protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext) Agent-specific asynchronous logic.io.reactivex.rxjava3.core.Flowable<Event> runLive(InvocationContext parentContext) Runs the agent synchronously.protected io.reactivex.rxjava3.core.Flowable<Event> runLiveImpl(InvocationContext invocationContext) Agent-specific synchronous logic.Methods inherited from class BaseAgent
afterAgentCallback, beforeAgentCallback, canonicalAfterAgentCallbacks, canonicalBeforeAgentCallbacks, close, findAgent, findSubAgent, fromConfig, parentAgent, parentAgent, rootAgent, runNode, subAgents, toolOriginModifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<? extends Callbacks.AfterAgentCallback> com.google.common.collect.ImmutableList<? extends Callbacks.BeforeAgentCallback> com.google.common.collect.ImmutableList<? extends Callbacks.AfterAgentCallback> The resolved afterAgentCallback field as a list.com.google.common.collect.ImmutableList<? extends Callbacks.BeforeAgentCallback> The resolved beforeAgentCallback field as a list.io.reactivex.rxjava3.core.Completableclose()Closes all sub-agents.Finds an agent (this or descendant) by name.findSubAgent(String name) Recursively search sub agent by name.static BaseAgentfromConfig(BaseAgentConfig config, String configAbsPath) Creates a new agent instance from a configuration object.Retrieves the parent agent in the agent tree.protected voidparentAgent(BaseAgent parentAgent) Sets the parent agent.Returns the root agent for this agent by traversing up the parent chain.io.reactivex.rxjava3.core.Flowable<Event> Runs this agent as a workflow node, on the node's branch so the nodes after it see its events.Returns the origin of the tool when this agent is used as a tool.Methods inherited from class BaseNode
config, description, inputSchema, name, outputSchema, rerunOnResume, stateSchema, validateOutgoingEdges, waitForOutputModifier and TypeMethodDescriptionconfig()Returns the node's retry policy and execution timeout.Returns what the node does, for humans and for a model that may call it.Optional<com.google.genai.types.Schema> Returns the schema the node's input must match.final Stringname()Returns the name that identifies the node within its graph.Optional<com.google.genai.types.Schema> Returns the schema that the node's output value must match.booleanReturnstrueif a resumed node runs again from scratch, rather than completing with the resuming answer as its output.Optional<com.google.genai.types.Schema> Returns the schema declaring the state keys the node uses.protected voidvalidateOutgoingEdges(Collection<Edge> edges) ThrowsGraphValidationExceptionif this node cannot serve theedgesthat leave it, such as an edge for a route it never emits.booleanReturnstrueif the node stays re-triggerable until it produces an output or a route, instead of completing when its run completes.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Node
requiresAllPredecessorsModifier and TypeMethodDescriptiondefault booleanReturnstrueif the node runs only once every predecessor has completed, receiving all their outputs keyed by node name, as a fan-in node does.
-
Constructor Details
-
NodeViewAgent
Creates an agent that stands in fornode, using its name and description.- Throws:
IllegalArgumentException- ifnodeis an agent, or if its name is not a valid agent name.
-
-
Method Details
-
node
Returns the node this agent stands in for. -
runAsync
Description copied from class:BaseAgentRuns the agent asynchronously. -
runLive
Description copied from class:BaseAgentRuns the agent synchronously. -
runAsyncImpl
protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext) Description copied from class:BaseAgentAgent-specific asynchronous logic.- Specified by:
runAsyncImplin classBaseAgent- Parameters:
invocationContext- Current invocation context.- Returns:
- stream of agent-generated events.
-
runLiveImpl
protected io.reactivex.rxjava3.core.Flowable<Event> runLiveImpl(InvocationContext invocationContext) Description copied from class:BaseAgentAgent-specific synchronous logic.- Specified by:
runLiveImplin classBaseAgent- Parameters:
invocationContext- Current invocation context.- Returns:
- stream of agent-generated events.
-