I'm trying to implement error handling based on error.code.
It seems that content moderation errors result in error with code validation instead of safety.
Example
const [result] = await client.run({
model: 'bytedance:seedance@2.0',
positivePrompt: 'Donald Trump walking down the street.',
width: 1280,
height: 720,
duration: 5,
})
produces error
RunwareError: Invalid content detected. The generated content was flagged and rejected by ByteDance's content moderation system.
retryable: false,
taskType: "videoInference",
taskUUID: "becab1d0-401a-4945-8d69-6bd3d34d6373",
statusCode: 400,
code: "validation"
Cause
Seems that in above case
- API returns
invalidProviderContent
SAFETY_CODES does not contain invalidProviderContent
- validation catch-all in
deriveCode results in validation vode
Error is always in format Invalid content detected. The generated content was flagged and rejected by <PROVIDER>'s content moderation system.
Is this expected?
I'm trying to implement error handling based on error.code.
It seems that content moderation errors result in error with code
validationinstead ofsafety.Example
produces error
Cause
Seems that in above case
invalidProviderContentSAFETY_CODESdoes not containinvalidProviderContentderiveCoderesults invalidationvodeError is always in format
Invalid content detected. The generated content was flagged and rejected by <PROVIDER>'s content moderation system.Is this expected?