Provides feedback on invalid moderation results returned by Alibaba Cloud AI Guardrails for a text moderation task.
QPS limits
This operation supports up to 20 calls per second per account. Exceeding this limit triggers throttling, which may affect your business. Plan your call rate accordingly.
Request parameters
For common parameters required in all AI Guardrails API requests, see Common parameters.
The request body is a JSON array. Each element contains the following parameters.
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| taskId | String | Yes | taskid xxx | The ID of the moderation task, as returned by the AI Guardrails server, which uniquely identifies the moderation task. |
| dataId | String | No | test7fcmzGkKbNp7@JqPQRnwIe-1mwwZX | The ID of the moderated content, specified in the dataId parameter of the original moderation request. |
| content | String | No | foobar | The text content that was moderated. Maximum length: 10,000 characters. |
| label | String | No | spam | The expected moderation category for the text in the specified moderation scenario. For valid values, see Text moderation. |
| note | String | No | blabla... | A description of the moderated text, such as keywords in the content. |
The label value determines how the text is added to the feedback-based text library in the AI Guardrails console:normal: adds the text to the whitelistAny other value: adds the text to the block list
Response parameters
For common response parameters, see Common response parameters.
The data field in the response body is empty.
Examples
Sample request
http(s)://[Endpoint]/green/text/feedback
&<Common request parameters>
{
"dataId": "test7fcmzGkKbNp7@JqPQRnwIe-1mwwZX",
"taskId": "taskid xxx",
"content": "foobar",
"label": "spam",
"note": "blabla..."
}Sample response
{
"msg": "OK",
"code": 200,
"requestId": "02C418E7-81D4-4375-9732-900B64D07CEE"
}