GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — requireAgent | ADK for TypeScript: API Reference - v2.5.0

  • requireAgent

Function requireAgent

  • requireAgent(ctx: InvocationContext): BaseAgent

    The agent driving ctx, for code that only runs because one is.

    An LLM flow, an agent transfer, a tool call: each is reached from inside an agent's own execution, so InvocationContext.agent is set by construction. Going through here says that out loud, and turns a violated assumption into a named error rather than a property access on undefined several frames away.

    A free function rather than an accessor on the class, because a good deal of code (and most tests) passes a duck-typed context object; a getter would be simply absent on those, which fails less clearly than not having the agent.

    Parameters

    • ctx: InvocationContext

    Returns BaseAgent

    Throws

    if the invocation is driving a bare node rather than an agent.

    • Defined in core/src/agents/invocation_context.ts:399
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.