mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 01:10:05 +08:00
Adding doNotStore
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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: {},
|
||||
|
||||
Reference in New Issue
Block a user