diff --git a/docs/_docs/04-03-additional-plugins.md b/docs/_docs/04-03-additional-plugins.md index 55ab1749b..b9f4d4067 100644 --- a/docs/_docs/04-03-additional-plugins.md +++ b/docs/_docs/04-03-additional-plugins.md @@ -94,6 +94,7 @@ Configuration: - `TALK_PERSPECTIVE_TIMEOUT` - The timeout for sending a comment to be processed before it will skip the toxicity analysis, parsed by [ms](https://www.npmjs.com/package/ms){:target="_blank"}. (Default `300ms`) +- `TALK_PERSPECTIVE_DO_NOT_STORE` - Whether the API is permitted to store comment and context from this request. Stored comments will be used for future research and community model building purposes to improve the API over time. (Default `true`) [Perspective API - Analize Comment Request](https://github.com/conversationai/perspectiveapi/blob/master/api_reference.md#analyzecomment-request){:target="_blank"} ## talk-plugin-subscriber diff --git a/plugins/talk-plugin-toxic-comments/server/config.js b/plugins/talk-plugin-toxic-comments/server/config.js index e60d56dd1..b6c32417f 100644 --- a/plugins/talk-plugin-toxic-comments/server/config.js +++ b/plugins/talk-plugin-toxic-comments/server/config.js @@ -5,6 +5,7 @@ const config = { API_KEY: process.env.TALK_PERSPECTIVE_API_KEY, THRESHOLD: process.env.TALK_TOXICITY_THRESHOLD || 0.8, API_TIMEOUT: ms(process.env.TALK_PERSPECTIVE_TIMEOUT || '300ms'), + DO_NOT_STORE: process.env.TALK_PERSPECTIVE_DO_NOT_STORE || true, }; if (process.env.NODE_ENV !== 'test' && !config.API_KEY) { diff --git a/plugins/talk-plugin-toxic-comments/server/perspective.js b/plugins/talk-plugin-toxic-comments/server/perspective.js index fba81b3d2..863466af4 100644 --- a/plugins/talk-plugin-toxic-comments/server/perspective.js +++ b/plugins/talk-plugin-toxic-comments/server/perspective.js @@ -1,5 +1,5 @@ const fetch = require('node-fetch'); -const {API_ENDPOINT, API_KEY, THRESHOLD, API_TIMEOUT} = require('./config'); +const {API_ENDPOINT, API_KEY, THRESHOLD, API_TIMEOUT, DO_NOT_STORE} = require('./config'); /** * Get scores from the perspective api @@ -20,6 +20,7 @@ async function getScores(text) { // TODO: support other languages. languages: ['en'], + doNotStore: DO_NOT_STORE, requestedAttributes: { TOXICITY: {}, SEVERE_TOXICITY: {},