Moderate text using the Typescript SDK
text.moderate
method. This method takes in a text string and returns a Promise
that resolves to a TextModerationResponse
object.
id
property.
Some bad text
TextModerationResponse
object contains the following properties:
27fbdc0b-b295-46ce-93f5-81b2fc08a381
true
90
positive
90
90
["politics", "sports"]
[{"category": "sexual", "severity": 90}]
{"profanity": true, "totalFlags": 1, "contentRating": "G", "language": "en"}
{"reject": true, "review": true}
This is the original text
This is a filtered text
{"requestId": "27fbdc0b-b295-46ce-93f5-81b2fc08a381", "timestamp": "2023-04-05T12:00:00.000Z"}
{"userId": "12345"}
93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa