[Go to site: main page, start]

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

    Interface LlmAgentConfig

    The configuration options for creating an LLM-based agent.

    Hierarchy (View Summary)

    Properties

    afterAgentCallback?: AfterAgentCallback
    afterModelCallback?: AfterModelCallback

    Callbacks to be called after calling the LLM.

    afterToolCallback?: AfterToolCallback

    Callbacks to be called after calling the tool.

    beforeAgentCallback?: BeforeAgentCallback
    beforeModelCallback?: BeforeModelCallback

    Callbacks to be called before calling the LLM.

    beforeToolCallback?: BeforeToolCallback

    Callbacks to be called before calling the tool.

    codeExecutor?: BaseCodeExecutor

    Instructs the agent to make a plan and execute it step by step.

    contextCompactors?: BaseContextCompactor[]

    A list of context compactors to evaluate in priority order. Modifies the session history to keep context overhead within limits.

    description?: string
    disallowTransferToParent?: boolean

    Disallows LLM-controlled transferring to the parent agent.

    NOTE: Setting this as True also prevents this agent to continue reply to the end-user. This behavior prevents one-way transfer, in which end-user may be stuck with one agent that cannot transfer to other agents in the agent tree.

    disallowTransferToPeers?: boolean

    Disallows LLM-controlled transferring to the peer agents.

    generateContentConfig?: GenerateContentConfig

    The additional content generation configurations.

    NOTE: not all fields are usable, e.g. tools must be configured via tools, thinking_config must be configured via planner in LlmAgent.

    For example: use this config to adjust model temperature, configure safety settings, etc.

    globalInstruction?: string | InstructionProvider

    Instructions for all the agents in the entire agent tree.

    ONLY the globalInstruction in root agent will take effect.

    For example: use globalInstruction to make all agents have a stable identity or personality.

    Use GlobalInstructionPlugin instead.

    includeContents?: "default" | "none"

    Controls content inclusion in model requests.

    Options: default: Model receives relevant conversation history none: Model receives no prior history, operates solely on current instruction and input

    inputSchema?: LlmAgentSchema

    The input schema when agent is used as a tool.

    instruction?: string | InstructionProvider

    Instructions for the LLM model, guiding the agent's behavior.

    model?: string | BaseLlm

    The model to use for the agent.

    name: string
    outputKey?: string

    The key in session state to store the output of the agent.

    Typically use cases:

    • Extracts agent reply for later use, such as in tools, callbacks, etc.
    • Connects agents to coordinate with each other.
    outputSchema?: LlmAgentSchema

    The output schema when agent replies.

    parentAgent?: BaseAgent<BaseAgentConfig>
    requestProcessors?: BaseLlmRequestProcessor[]

    Processors to run before the LLM request is sent.

    responseProcessors?: BaseLlmResponseProcessor[]

    Processors to run after the LLM response is received.

    subAgents?: BaseAgent<BaseAgentConfig>[]
    tools?: ToolUnion[]

    Tools available to this agent.