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:71
Properties
_getTools
• _getTools: (message
: string
) => Promise
<BaseTool
<any
>[]>
Type declaration
▸ (message
): Promise
<BaseTool
<any
>[]>
Parameters
Name | Type |
---|---|
message | string |
Returns
Promise
<BaseTool
<any
>[]>
Defined in
packages/core/src/agent/react/worker.ts:69
llm
• llm: LLM
<object
, object
>
Defined in
packages/core/src/agent/react/worker.ts:63
maxInteractions
• maxInteractions: number
= 10
Defined in
packages/core/src/agent/react/worker.ts:65
outputParser
• outputParser: ReActOutputParser
Defined in
packages/core/src/agent/react/worker.ts:67
reactChatFormatter
• reactChatFormatter: ReActChatFormatter
Defined in
packages/core/src/agent/react/worker.ts:66
Methods
_getResponse
▸ _getResponse(currentReasoning
, sources
): AgentChatResponse
Parameters
Name | Type |
---|---|
currentReasoning | BaseReasoningStep [] |
sources | ToolOutput [] |
Returns
Defined in
packages/core/src/agent/react/worker.ts:230
_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:253
_processActions
▸ _processActions(task
, tools
, output
, isStreaming?
): Promise
<[BaseReasoningStep
[], boolean
]>
Parameters
Name | Type | Default value |
---|---|---|
task | Task | undefined |
tools | BaseTool <any >[] | undefined |
output | ChatResponse <object > | undefined |
isStreaming | boolean | false |
Returns
Promise
<[BaseReasoningStep
[], boolean
]>
Defined in
packages/core/src/agent/react/worker.ts:165
_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:269
extractReasoningStep
▸ extractReasoningStep(output
, isStreaming
): [string
, BaseReasoningStep
[], boolean
]
Parameters
Name | Type |
---|---|
output | ChatResponse <object > |
isStreaming | boolean |
Returns
[string
, BaseReasoningStep
[], boolean
]
Defined in
packages/core/src/agent/react/worker.ts:120
finalizeTask
▸ finalizeTask(task
): void
Parameters
Name | Type |
---|---|
task | Task |
Returns
void
Implementation of
Defined in
packages/core/src/agent/react/worker.ts:321
initializeStep
▸ initializeStep(task
): TaskStep
Parameters
Name | Type |
---|---|
task | Task |
Returns
Implementation of
Defined in
packages/core/src/agent/react/worker.ts:97
runStep
▸ runStep(step
, task
): Promise
<TaskStepOutput
>
Parameters
Name | Type |
---|---|
step | TaskStep |
task | Task |
Returns
Promise
<TaskStepOutput
>
Implementation of
Defined in
packages/core/src/agent/react/worker.ts:313