Class NodeInfo

java.lang.Object
com.google.adk.workflow.NodeInfo

@Experimental public abstract class NodeInfo extends Object
The identity of the workflow-node activation that emitted an Event.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder for NodeInfo.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    abstract boolean
    Returns true if this event's content is the node's output, so no separate output event follows.
    Returns the emitting node's name: the last segment of path() without its run ID, such as a for wf@1/a@2, or empty when the path is empty.
    abstract com.google.common.collect.ImmutableList<String>
    Returns the node paths this event's output counts for: the emitting node's path, followed by the paths of the ancestors that use this output as their own, such as the workflow of a terminal node or a node that ran the emitting node with useAsOutput.
    Returns the run ID of the emitting node's parent: the part after @ in the second-to-last segment of path(), such as 1 for wf@1/a@2.
    abstract String
    Returns the emitting node's path.
    Returns the emitting node's run ID: the part after @ in the last segment of path(), such as 2 for wf@1/a@2, or empty when the segment has none.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NodeInfo

      public NodeInfo()
  • Method Details

    • path

      public abstract String path()
      Returns the emitting node's path. Segments are /-separated and each is name@runId, so a node of workflow wf reads wf@1/a@1; an empty path means the event did not come from a workflow node.
    • outputFor

      public abstract com.google.common.collect.ImmutableList<String> outputFor()
      Returns the node paths this event's output counts for: the emitting node's path, followed by the paths of the ancestors that use this output as their own, such as the workflow of a terminal node or a node that ran the emitting node with useAsOutput. It is set on an event that carries the node's output, either in its output field or as a message-as-output event whose content is the output; an empty list means the output counts for no node.
    • messageAsOutput

      public abstract boolean messageAsOutput()
      Returns true if this event's content is the node's output, so no separate output event follows.
    • name

      public final Optional<String> name()
      Returns the emitting node's name: the last segment of path() without its run ID, such as a for wf@1/a@2, or empty when the path is empty. ADK Python's NodeInfo.name returns an empty string instead.
    • runId

      public final Optional<String> runId()
      Returns the emitting node's run ID: the part after @ in the last segment of path(), such as 2 for wf@1/a@2, or empty when the segment has none. ADK Python's NodeInfo.run_id returns an empty string instead.
    • parentRunId

      public final Optional<String> parentRunId()
      Returns the run ID of the emitting node's parent: the part after @ in the second-to-last segment of path(), such as 1 for wf@1/a@2. Empty when the path has no parent segment or that segment has no run ID, as in ADK Python's NodeInfo.parent_run_id.
    • builder

      public static NodeInfo.Builder builder()
    • toBuilder

      public abstract NodeInfo.Builder toBuilder()