ConversationAIController conversationAIController = client .getConversationAIController ();
ConversationAIController
CompletableFuture <Void > createIntentAsync (
final CreateIntentRequest body )
void
CreateIntentRequest body = new CreateIntentRequest ();
body .setAiName ("[AI_NAME]" );
body .setDisplayName ("[DISPLAY_NAME" );
body .setTrainingPhrases ("[TRAINING_PHRASE,SPARATED BY ;]" );
body .setMessageTexts ("[RESPONSE_TEXT SPARATED BY ;]" );
conversationAIController .createIntentAsync (body ).thenAccept (result -> {
// TODO success callback handler
}).exceptionally (exception -> {
// TODO failure callback handler
return null ;
});
CompletableFuture <IntentQuery > intentQueryAsync (
final IntentQueryRequest body )
IntentQuery
IntentQueryRequest body = new IntentQueryRequest ();
body .setAiName ("[AI_NAME]" );
body .setTrainingPhrases ("[TRAINING_PHRASE]" );
conversationAIController .intentQueryAsync (body ).thenAccept (result -> {
// TODO success callback handler
}).exceptionally (exception -> {
// TODO failure callback handler
return null ;
});
Example Response (as JSON)
{
"response" : true ,
"message_texts" : " Saya tidak dengar Anda bilang apa. Bisa ulangi lagi?"
}
CompletableFuture <IntentList > intentListAsync ()
IntentList
conversationAIController .intentListAsync ().thenAccept (result -> {
// TODO success callback handler
}).exceptionally (exception -> {
// TODO failure callback handler
return null ;
});
Example Response (as JSON)
{
"response" : true ,
"data" : [
{
"id" : 14 ,
"ai_name" : " BANK_BKKN" ,
"display_name" : " sahabat" ,
"training_phrases" : " sahabatmu siapa" ,
"message_texts" : " nggak punya deh" ,
"create_date" : " 2022-08-22T19:59:06.000Z"
},
{
"id" : 15 ,
"ai_name" : " BANK_BKKN" ,
"display_name" : " terima kasih" ,
"training_phrases" : " terima kasih" ,
"message_texts" : " pulang saja kamu sana!" ,
"create_date" : " 2022-08-23T14:45:39.000Z"
},
{
"id" : 16 ,
"ai_name" : " BANK_BKKN" ,
"display_name" : " teman" ,
"training_phrases" : " temanmu siapa" ,
"message_texts" : " nggak punya juga" ,
"create_date" : " 2022-08-24T02:11:58.000Z"
},
{
"id" : 17 ,
"ai_name" : " BANK_BKKN" ,
"display_name" : " kamu siapa yang buat" ,
"training_phrases" : " kamu siapa yang buat;siapa yang buat;programmermu siapa" ,
"message_texts" : " Aku lahir dari batu !" ,
"create_date" : " 2022-08-25T18:53:35.000Z"
},
{
"id" : 19 ,
"ai_name" : " BANK_BKKN" ,
"display_name" : " Hidayat" ,
"training_phrases" : " hidayat" ,
"message_texts" : " jelek banget" ,
"create_date" : " 2022-09-01T17:02:54.000Z"
}
]
}
CompletableFuture <IntentEdit > intentEditAsync (
final IntentEditRequest body )
IntentEdit
IntentEditRequest body = new IntentEditRequest ();
body .setAiName ("[AI_NAME]" );
body .setDisplayName ("[DISPLAY_NAME]" );
body .setTrainingPhrases ("[TRAINING_PHRASE,SPARATED BY ;]" );
body .setMessageTexts ("[RESPONSE_TEXT SPARATED BY ;]" );
conversationAIController .intentEditAsync (body ).thenAccept (result -> {
// TODO success callback handler
}).exceptionally (exception -> {
// TODO failure callback handler
return null ;
});
Example Response (as JSON)
{
"response" : true ,
"message" : " Update intent success"
}
CompletableFuture <AIName > aINameAsync ()
AIName
conversationAIController .aINameAsync ().thenAccept (result -> {
// TODO success callback handler
}).exceptionally (exception -> {
// TODO failure callback handler
return null ;
});
Example Response (as JSON)
{
"response" : true ,
"data" : [
{
"id" : 1 ,
"ai_name" : " BANK_BKKN" ,
"create_date" : " 2022-08-15T17:13:43.000Z"
}
]
}
CompletableFuture <IntentDelete > intentDeleteAsync (
final IntentDeleteRequest body )
IntentDelete
IntentDeleteRequest body = new IntentDeleteRequest ();
body .setAiName ("[AI_NAME]" );
body .setDisplayName ("[DISPLAY_NAME]" );
conversationAIController .intentDeleteAsync (body ).thenAccept (result -> {
// TODO success callback handler
}).exceptionally (exception -> {
// TODO failure callback handler
return null ;
});
Example Response (as JSON)
{
"response" : true ,
"message" : " Delete intent success"
}