Przejdź do głównej zawartości

Class: ReActAgent

Hierarchy

  • AgentRunner<LLM, ReACTAgentStore>

    ReActAgent

Constructors

constructor

new ReActAgent(params): ReActAgent

Parameters

NameType
paramsReACTAgentParamsWithTools | ReACTAgentParamsWithToolRetriever

Returns

ReActAgent

Overrides

AgentRunner&lt;LLM, ReACTAgentStore&gt;.constructor

Defined in

packages/core/src/agent/react.ts:345

Properties

#chatHistory

Private #chatHistory: ChatMessage<object>[]

Inherited from

AgentRunner.#chatHistory

Defined in

packages/core/src/agent/base.ts:230


#llm

Private Readonly #llm: LLM<object, object>

Inherited from

AgentRunner.#llm

Defined in

packages/core/src/agent/base.ts:225


#runner

Private Readonly #runner: AgentWorker<LLM<object, object>, ReACTAgentStore, object>

Inherited from

AgentRunner.#runner

Defined in

packages/core/src/agent/base.ts:231


#systemPrompt

Private Readonly #systemPrompt: null | MessageContent = null

Inherited from

AgentRunner.#systemPrompt

Defined in

packages/core/src/agent/base.ts:229


#tools

Private Readonly #tools: BaseToolWithCall[] | (query: MessageContent) => Promise<BaseToolWithCall[]>

Inherited from

AgentRunner.#tools

Defined in

packages/core/src/agent/base.ts:226


#verbose

Private Readonly #verbose: boolean

Inherited from

AgentRunner.#verbose

Defined in

packages/core/src/agent/base.ts:232


taskHandler

Static taskHandler: TaskHandler<LLM<object, object>, ReACTAgentStore>

Defined in

packages/core/src/agent/react.ts:367

Accessors

chatHistory

get chatHistory(): ChatMessage<AdditionalMessageOptions>[]

Returns

ChatMessage<AdditionalMessageOptions>[]

Inherited from

AgentRunner.chatHistory

Defined in

packages/core/src/agent/base.ts:259


llm

get llm(): AI

Returns

AI

Inherited from

AgentRunner.llm

Defined in

packages/core/src/agent/base.ts:255


verbose

get verbose(): boolean

Returns

boolean

Inherited from

AgentRunner.verbose

Defined in

packages/core/src/agent/base.ts:263

Methods

chat

chat(params): Promise<AgentChatResponse<object>>

Parameters

NameType
paramsChatEngineParamsNonStreaming

Returns

Promise<AgentChatResponse<object>>

Inherited from

AgentRunner.chat

Defined in

packages/core/src/agent/base.ts:329

chat(params): Promise<ReadableStream<AgentStreamChatResponse<object>>>

Parameters

NameType
paramsChatEngineParamsStreaming

Returns

Promise<ReadableStream<AgentStreamChatResponse<object>>>

Inherited from

AgentRunner.chat

Defined in

packages/core/src/agent/base.ts:332


createStore

createStore(): Object

Returns

Object

NameType
reasonsnever[]

Overrides

AgentRunner.createStore

Defined in

packages/core/src/agent/react.ts:361


createTask

createTask(message, stream?, verbose?): ReadableStream<TaskStepOutput<LLM<object, object>, ReACTAgentStore, object>>

Parameters

NameTypeDefault value
messageMessageContentundefined
streambooleanfalse
verboseundefined | booleanundefined

Returns

ReadableStream<TaskStepOutput<LLM<object, object>, ReACTAgentStore, object>>

Inherited from

AgentRunner.createTask

Defined in

packages/core/src/agent/base.ts:290


getTools

getTools(query): BaseToolWithCall[] | Promise<BaseToolWithCall[]>

Parameters

NameType
queryMessageContent

Returns

BaseToolWithCall[] | Promise<BaseToolWithCall[]>

Inherited from

AgentRunner.getTools

Defined in

packages/core/src/agent/base.ts:271


reset

reset(): void

Returns

void

Inherited from

AgentRunner.reset

Defined in

packages/core/src/agent/base.ts:267


defaultCreateStore

defaultCreateStore(): object

Returns

object

Inherited from

AgentRunner.defaultCreateStore

Defined in

packages/core/src/agent/base.ts:237


shouldContinue

shouldContinue<AI, Store, AdditionalMessageOptions>(task): boolean

Type parameters

NameType
AIextends LLM<object, object>
Storeextends object = {}
AdditionalMessageOptionsextends object = AI extends LLM<object, AdditionalMessageOptions> ? AdditionalMessageOptions : never

Parameters

NameType
taskReadonly<TaskStep<AI, Store, AdditionalMessageOptions>>

Returns

boolean

Inherited from

AgentRunner.shouldContinue

Defined in

packages/core/src/agent/base.ts:277