I am trying to intercept the request and response that are sent to a virtual agent bot using DirectLine (Bot Framework). I have subscribed to the directline's activity using:
`directLine.activity$.subscribe(message => console.log(message));`
From this I get the message object which I can manipulate before displaying it in the client. What I want is to find the topic (i.e. the virtual agent topic) that the bot has selected (using the trigger phrase) for the conversation. Based on the topic I want to do different things, how can I get it ?
Here is an example of the message I get:
{
type: 'message',
id: 'IvkoXGKm9ZKIHdjv6foMM6-in|0000001',
timestamp: '2023-03-20T05:26:13.7251392Z',
channelId: 'directline',
from: { id: '5903103d-ad35-496c-acb4-9f797198ab51', name: 'John' },
conversation: { id: 'IvkoXGKm9ZKIHdjv6foMM6-in' },
textFormat: 'markdown',
membersAdded: [],
membersRemoved: [],
reactionsAdded: [],
reactionsRemoved: [],
text: 'Can you tell me your name ?',
speak: '<speak version="1.0" xml:lang="en-US" xmlns:mstts="http://www.w3.org/2001/mstts" xmlns="http://www.w3.org/2001/10/synthesis">Can you tell me your name ?</speak>',
attachments: [],
entities: [],
replyToId: 'IvkoXGKm9ZKIHdjv6foMM6-in|0000000',
listenFor: [],
textHighlights: []
}
I expect that there should be a way to get the topic from the message. Any help would be appreciated. Thanks!