Skip to content

Content moderation system error results in code 'validation' instead of 'safety' #2

Description

@zspiler

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

  1. API returns invalidProviderContent
  2. SAFETY_CODES does not contain invalidProviderContent
  3. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions