Skip to content

Instantly share code, notes, and snippets.

@germanattanasio
Created February 4, 2016 16:16
Show Gist options
  • Save germanattanasio/6a586528b93c705fbff4 to your computer and use it in GitHub Desktop.
Save germanattanasio/6a586528b93c705fbff4 to your computer and use it in GitHub Desktop.
Dialog code snippet
// 1. Create the conversation
String message = "This is the first message";
Conversation conversation = new Conversation().workspaceId("dialog_id");
conversation = service.converse(message, conversation);
System.out.println(conversation);
// 2. Second message using the previous response
message = "This is the second message";
conversation = service.converse(message, conversation);
System.out.println(conversation);
// 3. Third message that change the conversation status
message = "This is the second message";
conversation.profile("foooo", 30).profile("bar","foo");
conversation = service.converse(message, conversation);
System.out.println(conversation);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment