# Interface LlmAgentConfig

The configuration options for creating an LLM-based agent.

interface LlmAgentConfig {
afterAgentCallback?: AfterAgentCallback;
afterModelCallback?: AfterModelCallback;
afterToolCallback?: AfterToolCallback;
beforeAgentCallback?: BeforeAgentCallback;
beforeModelCallback?: BeforeModelCallback;
beforeToolCallback?: BeforeToolCallback;
codeExecutor?: BaseCodeExecutor;
description?: string;
disallowTransferToParent?: boolean;
disallowTransferToPeers?: boolean;
generateContentConfig?: GenerateContentConfig;
globalInstruction?: string | InstructionProvider;
includeContents?: "none" | "default";
inputSchema?: LlmAgentSchema;
instruction?: string | InstructionProvider;
model?: string | BaseLlm;
name: string;
outputKey?: string;
outputSchema?: LlmAgentSchema;
parentAgent?: BaseAgent;
requestProcessors?: BaseLlmRequestProcessor[];
responseProcessors?: BaseLlmResponseProcessor[];
subAgents?: BaseAgent[];
tools?: ToolUnion[];
}

#### Hierarchy (View Summary)

- BaseAgentConfig
  - LlmAgentConfig

- Defined in agents/llm_agent.ts:195

## Properties

### `Optional` afterAgentCallback

afterAgentCallback?: AfterAgentCallback

Inherited from BaseAgentConfig.afterAgentCallback

- Defined in agents/base_agent.ts:48

### `Optional` afterModelCallback

afterModelCallback?: AfterModelCallback

Callbacks to be called after calling the LLM.

- Defined in agents/llm_agent.ts:275

### `Optional` afterToolCallback

afterToolCallback?: AfterToolCallback

Callbacks to be called after calling the tool.

- Defined in agents/llm_agent.ts:285

### `Optional` beforeAgentCallback

beforeAgentCallback?: BeforeAgentCallback

Inherited from BaseAgentConfig.beforeAgentCallback

- Defined in agents/base_agent.ts:47

### `Optional` beforeModelCallback

beforeModelCallback?: BeforeModelCallback

Callbacks to be called before calling the LLM.

- Defined in agents/llm_agent.ts:270

### `Optional` beforeToolCallback

beforeToolCallback?: BeforeToolCallback

Callbacks to be called before calling the tool.

- Defined in agents/llm_agent.ts:280

### `Optional` codeExecutor

codeExecutor?: BaseCodeExecutor

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

- Defined in agents/llm_agent.ts:300

### `Optional` description

description?: string

Inherited from BaseAgentConfig.description

- Defined in agents/base_agent.ts:44

### `Optional` disallowTransferToParent

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.

- Defined in agents/llm_agent.ts:236

### `Optional` disallowTransferToPeers

disallowTransferToPeers?: boolean

Disallows LLM-controlled transferring to the peer agents.

- Defined in agents/llm_agent.ts:239

### `Optional` generateContentConfig

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.

- Defined in agents/llm_agent.ts:226

### `Optional` globalInstruction

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.

- Defined in agents/llm_agent.ts:212

### `Optional` includeContents

includeContents?: "none" | "default"

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

- Defined in agents/llm_agent.ts:250

### `Optional` inputSchema

inputSchema?: LlmAgentSchema

The input schema when agent is used as a tool.

- Defined in agents/llm_agent.ts:253

### `Optional` instruction

instruction?: string | InstructionProvider

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

- Defined in agents/llm_agent.ts:202

### `Optional` model

model?: string | BaseLlm

The model to use for the agent.

- Defined in agents/llm_agent.ts:199

### name

name: string

Inherited from BaseAgentConfig.name

- Defined in agents/base_agent.ts:43

### `Optional` outputKey

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.

- Defined in agents/llm_agent.ts:265

### `Optional` outputSchema

outputSchema?: LlmAgentSchema

The output schema when agent replies.

- Defined in agents/llm_agent.ts:256

### `Optional` parentAgent

parentAgent?: BaseAgent

Inherited from BaseAgentConfig.parentAgent

- Defined in agents/base_agent.ts:45

### `Optional` requestProcessors

requestProcessors?: BaseLlmRequestProcessor[]

Processors to run before the LLM request is sent.

- Defined in agents/llm_agent.ts:290

### `Optional` responseProcessors

responseProcessors?: BaseLlmResponseProcessor[]

Processors to run after the LLM response is received.

- Defined in agents/llm_agent.ts:295

### `Optional` subAgents

subAgents?: BaseAgent[]

Inherited from BaseAgentConfig.subAgents

- Defined in agents/base_agent.ts:46

### `Optional` tools

tools?: ToolUnion[]

Tools available to this agent.

- Defined in agents/llm_agent.ts:215