Class: ReActAgent
An agent that uses OpenAI's API to generate text.
Hierarchy
-
AgentRunner
↳
ReActAgent
Constructors
constructor
• new ReActAgent(«destructured»
): ReActAgent
Parameters
Name | Type |
---|---|
«destructured» | Partial <ReActAgentParams > |
Returns
Overrides
AgentRunner.constructor
Defined in
packages/core/src/agent/react/base.ts:26
Properties
agentWorker
• agentWorker: AgentWorker
Inherited from
AgentRunner.agentWorker
Defined in
packages/core/src/agent/runner/base.ts:45
callbackManager
• callbackManager: CallbackManager
Inherited from
AgentRunner.callbackManager
Defined in
packages/core/src/agent/runner/base.ts:48
defaultToolChoice
• defaultToolChoice: string
Inherited from
AgentRunner.defaultToolChoice
Defined in
packages/core/src/agent/runner/base.ts:51
deleteTaskOnFinish
• deleteTaskOnFinish: boolean
Inherited from
AgentRunner.deleteTaskOnFinish
Defined in
packages/core/src/agent/runner/base.ts:50
initTaskStateKwargs
• initTaskStateKwargs: Record
<string
, any
>
Inherited from
AgentRunner.initTaskStateKwargs
Defined in
packages/core/src/agent/runner/base.ts:49
memory
• memory: BaseMemory
Inherited from
AgentRunner.memory
Defined in
packages/core/src/agent/runner/base.ts:47
state
• state: AgentState
Inherited from
AgentRunner.state
Defined in
packages/core/src/agent/runner/base.ts:46
Methods
_chat
▸ _chat(«destructured»
): Promise
<AgentChatResponse
>
Parameters
Name | Type |
---|---|
«destructured» | ChatEngineAgentParams |
Returns
Promise
<AgentChatResponse
>
Inherited from
AgentRunner._chat
Defined in
packages/core/src/agent/runner/base.ts:265
▸ _chat(«destructured»
): Promise
<StreamingAgentChatResponse
>
Parameters
Name | Type |
---|---|
«destructured» | ChatEngineAgentParams & { stream : true } |
Returns
Promise
<StreamingAgentChatResponse
>
Inherited from
AgentRunner._chat
Defined in
packages/core/src/agent/runner/base.ts:270
_getPromptModules
▸ _getPromptModules(): string
[]
Returns
string
[]
Inherited from
AgentRunner._getPromptModules
Defined in
packages/core/src/agent/runner/base.ts:351
_getPrompts
▸ _getPrompts(): string
[]
Returns
string
[]
Inherited from
AgentRunner._getPrompts
Defined in
packages/core/src/agent/runner/base.ts:355
chat
▸ chat(«destructured»
): Promise
<AgentChatResponse
>
Sends a message to the LLM and returns the response.
Parameters
Name | Type |
---|---|
«destructured» | ChatEngineAgentParams & { stream? : false } |
Returns
Promise
<AgentChatResponse
>
Inherited from
AgentRunner.chat
Defined in
packages/core/src/agent/runner/base.ts:313
▸ chat(«destructured»
): Promise
<StreamingAgentChatResponse
>
Parameters
Name | Type |
---|---|
«destructured» | ChatEngineAgentParams & { stream : true } |
Returns
Promise
<StreamingAgentChatResponse
>
Inherited from
AgentRunner.chat
Defined in
packages/core/src/agent/runner/base.ts:321
createTask
▸ createTask(input
, kwargs?
): Task
Creates a task.
Parameters
Name | Type |
---|---|
input | string |
kwargs? | any |
Returns
Inherited from
AgentRunner.createTask
Defined in
packages/core/src/agent/runner/base.ts:77
deleteTask
▸ deleteTask(taskId
): void
Deletes the task.
Parameters
Name | Type |
---|---|
taskId | string |
Returns
void
Inherited from
AgentRunner.deleteTask
Defined in
packages/core/src/agent/runner/base.ts:120
finalizeResponse
▸ finalizeResponse(taskId
, stepOutput
, kwargs?
): Promise
<AgentChatResponse
| StreamingAgentChatResponse
>
Finalizes the response and returns it.
Parameters
Name | Type |
---|---|
taskId | string |
stepOutput | TaskStepOutput |
kwargs? | any |
Returns
Promise
<AgentChatResponse
| StreamingAgentChatResponse
>
Inherited from
AgentRunner.finalizeResponse
Defined in
packages/core/src/agent/runner/base.ts:230