Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.moderation.input 扩展点 ,当flagged为false时,返回数据格式问题 #64

Open
anyfeng opened this issue Apr 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@anyfeng
Copy link

anyfeng commented Apr 15, 2024

No description provided.

Copy link

dosubot bot commented Apr 15, 2024

When the flagged parameter is set to true in the app.moderation.input extension point, the format of the returned data depends on the specified action. For action set to direct_output, the format should be:

{
    "flagged": true,
    "action": "direct_output",
    "preset_response": "Your content violates our usage policy."
}

This indicates a direct response to the violation. If the action is overrided, the format changes to:

{
    "flagged": true,
    "action": "overrided",
    "inputs": {
        "var_1": "I will *** you.",
        "var_2": "I will *** you."
    },
    "query": "Happy everydays."
}

Here, inputs contain the variables to be overridden, and query is the new query. This setup allows for a customized response based on the moderation outcome.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the bug Something isn't working label Apr 15, 2024
@anyfeng anyfeng changed the title app.moderation.input 扩展点 ,当flagged为true时,返回数据格式问题 app.moderation.input 扩展点 ,当flagged为false时,返回数据格式问题 Apr 15, 2024
@anyfeng
Copy link
Author

anyfeng commented Apr 15, 2024

When the flagged parameter is set to true in the app.moderation.input extension point, the format of the returned data depends on the specified action. For action set to direct_output, the format should be:

{
    "flagged": true,
    "action": "direct_output",
    "preset_response": "Your content violates our usage policy."
}

This indicates a direct response to the violation. If the action is overrided, the format changes to:

{
    "flagged": true,
    "action": "overrided",
    "inputs": {
        "var_1": "I will *** you.",
        "var_2": "I will *** you."
    },
    "query": "Happy everydays."
}

Here, inputs contain the variables to be overridden, and query is the new query. This setup allows for a customized response based on the moderation outcome.

Sources

About Dosu

sorry, i made a mistake;doc has that,but when flagged is false, the doc not displayed

@anyfeng
Copy link
Author

anyfeng commented Apr 15, 2024

this is my api result
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant