/claim #290
AWSComprehendRedactor, AWSComprehendPIIRedactor, and AWSComprehendRestClient exports from the JS SDK AI package.chat() wrapping, and stream/operator helpers for observable-style chains.JS/edgechains/examples/aws-comprehend-redaction that works without AWS credentials by using a deterministic mock client.JS/edgechains/examples: yesnpx vitest run src/ai/src/tests/awsComprehendRedactor.test.tsnpm run buildnpm start from JS/edgechains/examples/aws-comprehend-redactionShort demo GIF:
The example prints the original prompt, the redacted prompt, the endpoint-wrapped response, and the stream output. It can also use live AWS Comprehend when USE_LIVE_AWS_COMPREHEND=true and AWS credentials are present.
Full demo transcript, included so the output remains reviewable even if GitHub clips the embedded media:
EdgeChains #290 demo: AWS Comprehend redaction
Runnable example with deterministic mock client; live AWS supported by env vars.
$ cd JS/edgechains/examples/aws-comprehend-redaction
$ npm start
Original prompt:
My name is Jane Doe. Email me at jane@example.com and call 555-0100 about invoice INV-42.
Redacted prompt:
My name is [REDACTED_NAME]. Email me at [REDACTED_EMAIL] and call [REDACTED_PHONE] about invoice INV-42.
Endpoint response:
Prompt received by endpoint: My name is [REDACTED_NAME]. Email me at [REDACTED_EMAIL] and call [REDACTED_PHONE] about invoice INV-42.
Stream output:
My name is [REDACTED_NAME]. Email me at [REDACTED_EMAIL] and call [REDACTED_PHONE] about invoice INV-42.
✓ npx vitest run src/ai/src/tests/awsComprehendRedactor.test.ts
jonahsills
@jonahsills
Arakoo.ai
@arakoodev
gittare
@gittare