Skip to main content

Class: LLMSingleActionAgent

agents.LLMSingleActionAgent

Hierarchy

Constructors

constructor

new LLMSingleActionAgent(input)

Parameters

NameType
inputLLMSingleActionAgentInput

Overrides

BaseSingleActionAgent.constructor

Defined in

langchain/src/agents/agent.ts:118

Properties

llmChain

llmChain: LLMChain

Defined in

langchain/src/agents/agent.ts:112


outputParser

outputParser: AgentActionOutputParser

Defined in

langchain/src/agents/agent.ts:114


stop

Optional stop: string[]

Defined in

langchain/src/agents/agent.ts:116

Accessors

allowedTools

get allowedTools(): undefined | string[]

Returns

undefined | string[]

Inherited from

BaseSingleActionAgent.allowedTools

Defined in

langchain/src/agents/agent.ts:35


inputKeys

get inputKeys(): string[]

Returns

string[]

Overrides

BaseSingleActionAgent.inputKeys

Defined in

langchain/src/agents/agent.ts:125


returnValues

get returnValues(): string[]

Returns

string[]

Inherited from

BaseSingleActionAgent.returnValues

Defined in

langchain/src/agents/agent.ts:31

Methods

_agentType

_agentType(): string

Return the string type key uniquely identifying this class of agent.

Returns

string

Inherited from

BaseSingleActionAgent._agentType

Defined in

langchain/src/agents/agent.ts:42


plan

plan(steps, inputs): Promise<AgentAction | AgentFinish>

Decide what to do given some input.

Parameters

NameTypeDescription
stepsAgentStep[]Steps the LLM has taken so far, along with observations from each.
inputsChainValuesUser inputs.

Returns

Promise<AgentAction | AgentFinish>

Action specifying what tool to use.

Overrides

BaseSingleActionAgent.plan

Defined in

langchain/src/agents/agent.ts:137


prepareForOutput

prepareForOutput(_returnValues, _steps): Promise<Record<string, any>>

Prepare the agent for output, if needed

Parameters

NameType
_returnValuesRecord<string, any>
_stepsAgentStep[]

Returns

Promise<Record<string, any>>

Inherited from

BaseSingleActionAgent.prepareForOutput

Defined in

langchain/src/agents/agent.ts:67


returnStoppedResponse

returnStoppedResponse(earlyStoppingMethod, _steps, _inputs): Promise<AgentFinish>

Return response when agent has been stopped due to max iterations

Parameters

NameType
earlyStoppingMethodStoppingMethod
_stepsAgentStep[]
_inputsChainValues

Returns

Promise<AgentFinish>

Inherited from

BaseSingleActionAgent.returnStoppedResponse

Defined in

langchain/src/agents/agent.ts:49