GITBOOK-24: change request with no subject merged in GitBook

pull/25/head
zorroj 2023-11-08 03:51:24 +00:00 committed by gitbook-bot
parent bccfaac88c
commit f0396310a3
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
3 changed files with 6 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

View File

@ -20,4 +20,9 @@ OpenAI 和大多数 LLM 公司提供的模型,都带有内容审查功能,
不同的企业内部往往有着不同的敏感词审查机制,企业在开发自己的 AI 应用如企业内部知识库 ChatBot需要对员工输入的查询内容作敏感词审查。为此开发者可以根据自己企业内部的敏感词审查机制写一个 API 扩展,具体可参考 [moderation.md](../../advanced/extension/api\_based\_extension/moderation.md "mention"),从而在 Dify 上调用,实现敏感词审查的高度自定义和隐私保护。
<figure><img src="../../.gitbook/assets/moderation4.png" alt=""><figcaption><p>Moderation 扩展</p></figcaption></figure>
<figure><img src="../../.gitbook/assets/moderation_settings.png" alt=""><figcaption><p>Moderation Settings</p></figcaption></figure>
比如我们在自己的本地服务中自定义敏感词审查规则:不能查询有关美国总统的名字的问题。当用户在`query`变量输入"Trump",则在对话时会返回 "Your content violates our usage policy." 测试效果如下:
<figure><img src="../../.gitbook/assets/moderation_tet.png" alt=""><figcaption><p>Moderation Test</p></figcaption></figure>