How To Use
Here you will find how to use SmartChat Assistant in your aplication
Since SmartChat Assistant is connected to a QuickBlox user, you can interact with it just like you would with a regular user. You have the option to create private or group dialogs with the assistant.
SmartChat Assistant is not available in the Public Dialogs
Create a private dialog with SmartChat Assistant
The easiest way to interact with the SmartChat Assistant is to create a private(1-to-1) dialog and the assistant will answer to any your message.
iOS
To create a private(1-to-1) dialog, you need to set the dialog type field to private
and ID of the opponent you want to create a chat with.
Android
To create a private(1-to-1) dialog, you need to set the dialog type to QBDialogType.PRIVATE
and ID of the opponent you want to create a chat with.
JavaScript
To create a private(1-to-1) dialog, you need to set the dialog type to 3
and ID of the opponent you want to create a chat with.
ReactNative
To create a private(1-to-1) dialog, you need to set the type to QB.chat.DIALOG_TYPE.CHAT
and ID of the opponent you want to create a chat with.
Flutter
To create a private(1-to-1) dialog, you need to set the type to QBChatDialogTypes.CHAT
and ID of the opponent you want to create a chat with.
Create a group dialog with SmartChat Assistant
Also, your users can interact with the SmartChat Assistant in group dialogs.
iOS
To create a group dialog for a predefined number of occupants, you need to set the dialog type field to group
and IDs of opponents you want to create a chat with.
Android
To create a group dialog for a predefined number of occupants, you need to set the dialog type to QBDialogType.GROUP
and IDs of opponents you want to create a chat with.
JavaScript
To create a group dialog for a predefined number of occupants, you need to set the dialog type to 2
and IDs of opponents, you want to create a chat with.
ReactNative
To create a group dialog for a predefined number of occupants, you need to set the dialog type to QB.chat.DIALOG_TYPE.GROUP_CHAT
and IDs of opponents you want to create a chat with.
Flutter
To create a group dialog for a predefined number of occupants, you need to set the dialog type to QBChatDialogTypes.GROUP_CHAT
and IDs of opponents you want to create a chat with.
Send message to assistant in group dialog with command
To be able to interact with an assistant in a group dialog next conditions should be met:
- Enable SmartChat Assistant for the group dialogs on the dasboard.
- Define the command for the assistant on the dashboard.
- SmartChat Assistant must be added to the group dialog and be present in the
occupant_ids
. - Your message must begin with a command.
For example, you defined your SmartChat Assistant command as “SuperHelpfulAssistant”.
In this case, your message may look like:
/SuperHelpfulAssistant Help me with something
Send message to assistant in a group dialog with mentions
To be able to interact with an assistant in a group dialog next conditions should be met:
- Enable SmartChat Assistant for the group dialogs on the dasboard.
- SmartChat Assistant must be added to the group dialog and be present in the
occupant_ids
. - The message must contain the assistant’s user ID in the
mentioned_user_ids
custom field.
If you want mention several users you must enumerate them joined by comma(,).
Example:
“34,45,55”
iOS
Android
JavaScript
ReactNative
Flutter
Was this page helpful?