Skip to content

Instantly share code, notes, and snippets.

@kajornsakp
Created April 16, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kajornsakp/7e08d977a352a8baf0e248fa795a9c90 to your computer and use it in GitHub Desktop.
Save kajornsakp/7e08d977a352a8baf0e248fa795a9c90 to your computer and use it in GitHub Desktop.
naturalLanguage.smartReply().suggestReplies(for: conversation) { result, error in
guard error == nil, let result = result else {
return
}
if (result.status == .notSupportedLanguage) {
// The conversation's language isn't supported, so the
// the result doesn't contain any suggestions.
} else if (result.status == .success) {
// Successfully suggested smart replies.
// ...
let _ = result.suggestions.map { print($0.text) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment