Created
April 16, 2019 17:34
-
-
Save kajornsakp/7e08d977a352a8baf0e248fa795a9c90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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