My question is that I am developing an AI Powered Banking Chat-bot using RASA, Can anyone guide me how to deploy it or integrate it on an Mobile Application (Android)?
Thanks in Advance.
My question is that I am developing an AI Powered Banking Chat-bot using RASA, Can anyone guide me how to deploy it or integrate it on an Mobile Application (Android)?
Thanks in Advance.
I assume you use retrofit/Gson, if not it's easy to get the idea at first you need to retrive JWT token, for that you need to call
@POST("api/auth/jwt")
fun authenticateAsync(@Body authRequest: AuthRequest): Deferred<AuthResponse>
where AuthRequest is
data class AuthRequest(
@SerializedName("conversation_id")
@Expose
val conversation_id: String = UUID.randomUUID().toString(),
@SerializedName("chat_token")
@Expose
val chat_token: String
)
where conversation id is some random string, chat_token is the token when you share the bot, smth like 87f7d34f9aa74d51asdqwe27fac62c44
after getting jwt token you can post messages with
@POST("api/conversations/{conversation_id}/messages?environment=production")
fun postMessageAsync(
@Header("Authorization") token: String,
@Path("conversation_id") conversation_id: String,
@Body messageRequest: MessageRequest
): Deferred<List<ChatMessageResponse>>
where
data class MessageRequest(
@SerializedName("message")
@Expose
val message: String
)
and
data class ChatMessageResponse(
@SerializedName("recipient_id")
@Expose
val recipient_id: String,
@SerializedName("text")
@Expose
val text: String,
@SerializedName("externalFields")
@Expose
val externalFields: List<String>,
@SerializedName("custom")
@Expose
val custom: CustomResponseData? = null
)
Hope it was helpful