This library is deprecated, no longer maintained and might be outdated, use at your own risk.
.Net Standard Library for the Perspective API. The Perspective API can be used to analyze messages based on certain models, like toxicity.
To be able to make calls to the API you need to instantiate a client to work with. That should be done like this:
var client = PerspectiveClientFactory.Create(new HttpClient(), "YourToken");then you can start making requests by doing:
var response = await client.AnalyzeCommentAsync("This is stupid!", builder => builder.WithModel(Model.Toxicity | Model.ToxicitySevere));This will return a response with the respective properties for Toxicity, SevereToxicity and Spam populated. The other models will be null.
For reference how the response is structured please utilize the Perspective API reference.
Documentation will be available in a GitHub Wiki. This ReadMe is only a temporary solution.