Agent

A dynamic component for managing and rendering agent-based interactions with configurable widget display and debugging capabilities.


Agent is available in UI component using:

let agent = component.getAgent();

Agent is available in agent component using:

let agent = this.agent;

  • To debug agent code: lib/components-ui2/taskAgent/agent.js

  • To debug event handler code of UI Component: lib/components-ui2/base-component.js - handleEvent method


Fields

Name

Code

Data Type

Description

Data

data

object

Agent data

Agent ID

agentId

String

Id of agent

Saved

saved

boolean

Parent

parent

Agent

Returns parent agent that started this agent


Methods

Name

Description

getWidgets(event, name)

Returns widgets loaded during this agent's flow

emitEvent

Emit an event

getElement(elementId)

Retrieve a component in the agent process flow

startSubAgent(agentId, clearStack)

Loads a sub-agent and pushes it onto the stack

end

Ends the agent. If a parent agent exists, this agent is removed from the stack, and the parent becomes active

getActiveAgent

Retrieve the currently active agent

setData(key, value)

Saves agent data. Every field in the data is stored separately in the database

async save

Asynchronously saves the agent and all its unsaved data


Events

No events available for this component.