mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Add todo
This commit is contained in:
@@ -14,12 +14,18 @@ module.exports = {
|
||||
|
||||
const apiKey = require('./apiKey');
|
||||
const scores = await perspective.getScores(apiKey, input.body);
|
||||
if (input.checkToxicity && scores.SEVERE_TOXICITY.summaryScore > TOXICITY_THRESHOLD) {
|
||||
const isToxic = scores.SEVERE_TOXICITY.summaryScore > TOXICITY_THRESHOLD;
|
||||
if (input.checkToxicity && isToxic) {
|
||||
throw ErrToxic;
|
||||
}
|
||||
input.metadata = Object.assign({}, input.metadata, {
|
||||
perspective: scores,
|
||||
});
|
||||
|
||||
if (isToxic) {
|
||||
|
||||
// TODO: Flag comment as toxic and put in ?premod?.
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user