When the language is not automatically detected the perspective-api-client will throw the error:
response error unable to detect language
The easiest workaround to this issue would be making sure to add a default option as suggested by the official documentation. I'd propose adding this following code example to the readme
const result = await perspective.analyze({ comment: { text }, languages: ["en"], })
There also needs to be something in getAnalyzeCommentPayload to the effect of if (opts.languages) resource.languages = opts.languages; I created a branch, but there are not push permissions aside from @sloria
When the language is not automatically detected the perspective-api-client will throw the error:
response error unable to detect language
The easiest workaround to this issue would be making sure to add a default option as suggested by the official documentation. I'd propose adding this following code example to the readme
const result = await perspective.analyze({ comment: { text }, languages: ["en"], })