Skip to content

Moderation doesn't work #496

@remixtedi

Description

@remixtedi

Describe the bug
I'm trying to check the prompt for inappropriate language before it goes to the ChatCompletions endpoint but it returns "404 Resource not found" Error.

I'm using OpenAI services on Azure and URL looks like this:
https://MYOPENAISERVICE.openai.azure.com/openai/deployments/Gpt4-model-0125-Deployment/moderations?api-version=2023-12-01-preview

Your code piece

 var moderationResponse = await AzureOpenAIService.CreateModeration(createModerationRequest);
        if (!moderationResponse.Successful)
            throw new ValidationException(moderationResponse.Error.Message ??
                                          "Input text is not appropriate for the audience because it might contain hate, sexual, violence, and self-harm content, please try again with different input.");

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