Class: ReActAgentWorker
ReAct agent worker.
Implements
AgentWorker
<ChatParams
>
Constructors
constructor
• new ReActAgentWorker(«destructured»
): ReActAgentWorker
Parameters
Name | Type |
---|---|
«destructured» | ReActAgentWorkerParams |
Returns
Defined in
packages/core/src/agent/react/worker.ts:70
Properties
_getTools
• _getTools: (message
: string
) => Promise
<BaseTool
[]>
Type declaration
▸ (message
): Promise
<BaseTool
[]>
Parameters
Name | Type |
---|---|
message | string |
Returns
Promise
<BaseTool
[]>
Defined in
packages/core/src/agent/react/worker.ts:68
llm
• llm: LLM
<Record
<string
, unknown
>, Record
<string
, unknown
>>
Defined in
packages/core/src/agent/react/worker.ts:62
maxInteractions
• maxInteractions: number
= 10
Defined in
packages/core/src/agent/react/worker.ts:64
outputParser
• outputParser: ReActOutputParser
Defined in
packages/core/src/agent/react/worker.ts:66
reactChatFormatter
• reactChatFormatter: ReActChatFormatter
Defined in
packages/core/src/agent/react/worker.ts:65
Methods
_getResponse
▸ _getResponse(currentReasoning
, sources
): AgentChatResponse
Parameters
Name | Type |
---|---|
currentReasoning | BaseReasoningStep [] |
sources | ToolOutput [] |
Returns
Defined in
packages/core/src/agent/react/worker.ts:221
_getTaskStepResponse
▸ _getTaskStepResponse(agentResponse
, step
, isDone
): TaskStepOutput
Parameters
Name | Type |
---|---|
agentResponse | AgentChatResponse |
step | TaskStep |
isDone | boolean |
Returns
Defined in
packages/core/src/agent/react/worker.ts:244
_processActions
▸ _processActions(task
, tools
, output
, isStreaming?
): Promise
<[BaseReasoningStep
[], boolean
]>
Parameters
Name | Type | Default value |
---|---|---|
task | Task | undefined |
tools | BaseTool [] | undefined |
output | ChatResponse <Record <string , unknown >> | undefined |
isStreaming | boolean | false |
Returns
Promise
<[BaseReasoningStep
[], boolean
]>
Defined in
packages/core/src/agent/react/worker.ts:164
_runStep
▸ _runStep(step
, task
): Promise
<TaskStepOutput
>
Parameters
Name | Type |
---|---|
step | TaskStep |
task | Task |
Returns
Promise
<TaskStepOutput
>
Defined in
packages/core/src/agent/react/worker.ts:260
extractReasoningStep
▸ extractReasoningStep(output
, isStreaming
): [string
, BaseReasoningStep
[], boolean
]
Parameters
Name | Type |
---|---|
output | ChatResponse <Record <string , unknown >> |
isStreaming | boolean |
Returns
[string
, BaseReasoningStep
[], boolean
]
Defined in
packages/core/src/agent/react/worker.ts:119
finalizeTask
▸ finalizeTask(task
): void
Parameters
Name | Type |
---|---|
task | Task |
Returns
void
Implementation of
Defined in
packages/core/src/agent/react/worker.ts:312
initializeStep
▸ initializeStep(task
): TaskStep
Parameters
Name | Type |
---|---|
task | Task |
Returns
Implementation of
Defined in
packages/core/src/agent/react/worker.ts:96
runStep
▸ runStep(step
, task
): Promise
<TaskStepOutput
>