ADK for TypeScript: API Reference
    Preparing search index...

    Function asRunnableRoot

    • Normalizes whatever was handed in as a root into a RunnableRoot.

      An agent and a workflow are both roots already and pass through as themselves. Anything else node-like — a tool, a plain function, an already-built node — becomes the single node of a one-node workflow, exactly what edges: [['START', value]] spells by hand, so {agent: node} and {agent: new Workflow({edges: [['START', node]]})} are the same request spelled two ways.

      The value is built before it reaches the graph parser, which would build it anyway, because the built node is what carries the name and description the wrapping workflow takes.

      Parameters

      Returns RunnableRoot

      if root is not something an edge would accept.