When you send a message from the bot, you can add the autocomplete options to the activity's channel data. Then in Web Chat, you can use a custom store middleware to retrieve the options and update the JQuery Auto complete widget.
Bot Framework SDK v4 (C#)
var reply = turnContext.Activity.CreateReply();
reply.Text = "Hello, World!";
reply.ChannelData = JObject.FromObject( new {
autocompleteOptions = new List<string>() { "Option 1", "Option 2", "Option 3" }
});
await turnContext.SendActivityAsync(reply);
Web Chat v4
const store = createStore(
{},
({ dispatch }) => next => action => {
if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY') {
const { payload: { activity: { channelData: { autcompleteOptions } = {}}}} = action;
if (autcompleteOptions) {
// Update JQuery Autcomplete Widget with `autocompleteOptions`
}
}
return next(action);
}
);
For more details take a look at the Incoming Event Web Chat Sample and this Stack Overflow answer.
Hope this helps!