Package com.google.adk.agents
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 com.google.adk.agents.BaseAgent
BaseAgent.Builder<B extends BaseAgent.Builder<B>> -
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 com.google.adk.agents.BaseAgent
afterAgentCallback, beforeAgentCallback, canonicalAfterAgentCallbacks, canonicalBeforeAgentCallbacks, close, findAgent, findSubAgent, fromConfig, parentAgent, parentAgent, rootAgent, runNode, subAgents, toolOriginMethods inherited from class com.google.adk.workflow.BaseNode
config, description, inputSchema, name, outputSchema, rerunOnResume, stateSchema, waitForOutputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.adk.workflow.Node
requiresAllPredecessors
-
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.
-