API Reference DetoxifySh v#0.1.0
Copy MarkdownModules
The Detoxify API: toxicity scores for any text, from one call.
The account is suspended until its unpaid usage is paid (account_suspended).
The API key was not accepted (unauthorized).
Keeps recent results in memory, so analyzing the same text again neither calls the API nor is charged (the API charges for its own cache hits).
A configured client, made by DetoxifySh.new/1. It is plain data: keep one in your
application's configuration or a module attribute and share it between processes.
An error from the API that no more specific exception describes, including codes newer than this client. Every exception the client returns has the same fields
The request was not valid (invalid_request), or the text too long (payload_too_large).
The API could not be reached, or did not answer in time. Retried automatically first. Its
:code and :status are nil.
The allowance is used up: the free plan's month (quota_exceeded) or the day's calls without a
key (anonymous_quota_exceeded). :help_url says where to get more.
Too many requests in a short time (rate_limited). Retried automatically first.
What DetoxifySh.analyze/2 returns: the model that produced the scores, and the scores.
Probabilities from 0 to 1 that the text is each of these.
The service could not answer right now. Retried automatically first, except internal_error.