Rate this page:

Agent

Represents a CCAI Agent instance.

Constructors

constructor

Copy URL

Parameters

  • agentId:

    string

  • region:

    string

    Optional

Methods

addEventListener

Copy URL
addEventListener(event: 

Agent

,
callback:

Function

):

void

Adds a handler for the specified CCAI.Events.Agent event. Use only functions as handlers; anything except a function leads to an error and scenario termination when a handler is called

Parameters

  • event:

    Agent

    Event class (i.e., CCAI.Events.Agent.Started)

  • callback:

    Function

    Callback function to execute

Returns

  • type:

    void

destroy

Copy URL
destroy(): 

void

Destroys a CCAI Agent instance.

Returns

  • type:

    void

removeEventListener

Copy URL
removeEventListener(event: 

Agent

,
callback:

Function

):

void

Removes a handler for the specified CCAI.Events.Agent event

Parameters

  • event:

    Agent

    Event class (i.e., CCAI.Events.Agent.Started)

  • callback:

    Function

    Optional

    Callback function to execute. If not specified, all event listeners are removed

Returns

  • type:

    void