Skip to main content

Class: BaseSingleActionAgent

agents.BaseSingleActionAgent

Hierarchy

Constructors

constructor

new BaseSingleActionAgent()

Inherited from

BaseAgent.constructor

Accessors

allowedTools

get allowedTools(): undefined | string[]

Returns

undefined | string[]

Inherited from

BaseAgent.allowedTools

Defined in

langchain/src/agents/agent.ts:35


inputKeys

Abstract get inputKeys(): string[]

Returns

string[]

Inherited from

BaseAgent.inputKeys

Defined in

langchain/src/agents/agent.ts:29


returnValues

get returnValues(): string[]

Returns

string[]

Inherited from

BaseAgent.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

BaseAgent._agentType

Defined in

langchain/src/agents/agent.ts:42


plan

Abstract 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.

Defined in

langchain/src/agents/agent.ts:84


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

BaseAgent.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

BaseAgent.returnStoppedResponse

Defined in

langchain/src/agents/agent.ts:49