This is not an officially supported Google product. It is a reference implementation.
A Cloud Function that uses Retext.js to monitor the inclusive language of ad copy.
Run the command:
gcloud functions deploy AdLanguageMonitor \
--runtime nodejs14 \
--memory 1GB \
--timeout 540s \
--trigger-http
Install dependencies:
yarn
Run the tests:
yarn test
Run the development environment:
yarn start
Send a payload to the development function:
curl -X POST http://localhost:8080/ -H "Content-Type:application/json" -d '{ "text": "He’s pretty set on beating your butt for sheriff." }'
Note: You can use either the HTTP query string or the JSON body to generate a response.