Skip to main content

selectChat

chat.selectChat({ id: TID, agent: TID });

This method selects a specific chat session by its unique identifier and optionally specifies the agent responsible for that chat.

Parameters:

  • id: The unique identifier of the chat session. This is a required parameter.
  • agent: The unique identifier of the agent. This parameter is optional and can be used to specify which agent should be associated with the chat session.

The following are common use-cases for the selectChat method:

Select a specific chat by its ID

chat.selectChat({ id: 'chat1234' });

This snippet selects the chat session with the unique identifier 'chat1234'.

Select a specific chat by its ID and specify an agent

chat.selectChat({ id: 'chat1234', agent: 'agent5678' });

This snippet selects the chat session with the unique identifier 'chat1234' and also associates the agent with the identifier 'agent5678' to this chat session.