Skip to content

Commit d0854eb

Browse files
committed
docs: use enterprise-safe examples and localize zh/ja examples
1 parent eb80f64 commit d0854eb

6 files changed

Lines changed: 39 additions & 45 deletions

File tree

en/use-dify/workspace/api-extension/moderation-api-extension.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ When **Content Moderation > Review Input Content** is enabled in applications su
4141
"params": {
4242
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
4343
"inputs": {
44-
"var_1": "I will kill you.",
45-
"var_2": "I will fuck you."
44+
"var_1": "My SSN is 123-45-6789.",
45+
"var_2": "My phone number is 415-555-0142."
4646
},
47-
"query": "Happy everydays."
47+
"query": "Please help me update my account."
4848
}
4949
}
5050
```
@@ -81,10 +81,10 @@ When **Content Moderation > Review Input Content** is enabled in applications su
8181
"flagged": true,
8282
"action": "overridden",
8383
"inputs": {
84-
"var_1": "I will *** you.",
85-
"var_2": "I will *** you."
84+
"var_1": "My SSN is ***-**-****.",
85+
"var_2": "My phone number is ***-***-****."
8686
},
87-
"query": "Happy everydays."
87+
"query": "Please help me update my account."
8888
}
8989
```
9090

@@ -110,7 +110,7 @@ When **Content Moderation > Review Output Content** is enabled in applications s
110110
"point": "app.moderation.output",
111111
"params": {
112112
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
113-
"text": "I will kill you."
113+
"text": "My SSN is 123-45-6789."
114114
}
115115
}
116116
```
@@ -141,7 +141,7 @@ When **Content Moderation > Review Output Content** is enabled in applications s
141141
{
142142
"flagged": true,
143143
"action": "overridden",
144-
"text": "I will *** you."
144+
"text": "My SSN is ***-**-****."
145145
}
146146
```
147147

ja/use-dify/workspace/api-extension/moderation-api-extension.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ Chatflow、Agent、チャットアシスタントなどのアプリケーショ
4141
"params": {
4242
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
4343
"inputs": {
44-
"var_1": "I will kill you.",
45-
"var_2": "I will fuck you."
44+
"var_1": "私のマイナンバーは 1234-5678-9012 です。",
45+
"var_2": "私の電話番号は 090-1234-5678 です。"
4646
},
47-
"query": "Happy everydays."
47+
"query": "アカウント情報を更新してください。"
4848
}
4949
}
5050
```
@@ -72,7 +72,7 @@ Chatflow、Agent、チャットアシスタントなどのアプリケーショ
7272
{
7373
"flagged": true,
7474
"action": "direct_output",
75-
"preset_response": "Your content violates our usage policy."
75+
"preset_response": "貴社のご使用ポリシーに反するコンテンツとなっております。"
7676
}
7777
```
7878
* `action=overridden`
@@ -81,10 +81,10 @@ Chatflow、Agent、チャットアシスタントなどのアプリケーショ
8181
"flagged": true,
8282
"action": "overridden",
8383
"inputs": {
84-
"var_1": "I will *** you.",
85-
"var_2": "I will *** you."
84+
"var_1": "私のマイナンバーは ****-****-**** です。",
85+
"var_2": "私の電話番号は ***-****-**** です。"
8686
},
87-
"query": "Happy everydays."
87+
"query": "アカウント情報を更新してください。"
8888
}
8989
```
9090

@@ -110,7 +110,7 @@ Chatflow、Agent、チャットアシスタントなどのアプリケーショ
110110
"point": "app.moderation.output",
111111
"params": {
112112
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
113-
"text": "I will kill you."
113+
"text": "私のマイナンバーは 1234-5678-9012 です。"
114114
}
115115
}
116116
```
@@ -133,15 +133,15 @@ Chatflow、Agent、チャットアシスタントなどのアプリケーショ
133133
{
134134
"flagged": true,
135135
"action": "direct_output",
136-
"preset_response": "Your content violates our usage policy."
136+
"preset_response": "貴社のご使用ポリシーに反するコンテンツとなっております。"
137137
}
138138
```
139139
* `action=overridden`
140140
```
141141
{
142142
"flagged": true,
143143
"action": "overridden",
144-
"text": "I will *** you."
144+
"text": "私のマイナンバーは ****-****-**** です。"
145145
}
146146
```
147147

versions/3-0-x/en/user-guide/application-orchestrate/app-toolkits/moderation-tool.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ Now you can also directly call the OpenAI Moderation API on Dify; you can review
1616

1717
## Keywords
1818

19-
Developers can customize the sensitive words they need to review, such as using "kill" as a keyword to perform an audit action when users input. The preset reply content should be "The content is violating usage policies." It can be anticipated that when a user inputs a text chuck containing "kill" at the terminal, it will trigger the sensitive word review tool and return the preset reply content.
20-
21-
![Configuring Load Balancing from Add Model](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/application-orchestrate/app-toolkits/15652f65c3af15d931598a866a7baa17.png)
19+
Developers can customize the sensitive words they need to review, such as using "confidential" as a keyword to perform an audit action when users input. The preset reply content should be "The content is violating usage policies." It can be anticipated that when a user inputs a text chuck containing "confidential" at the terminal, it will trigger the sensitive word review tool and return the preset reply content.
2220

2321
## Moderation Extension
2422

versions/3-0-x/en/user-guide/extension/api-based-extension/moderation.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ This module is used to review the content input by end-users and the output cont
3838
"params": {
3939
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
4040
"inputs": {
41-
"var_1": "I will kill you.",
42-
"var_2": "I will fuck you."
41+
"var_1": "My SSN is 123-45-6789.",
42+
"var_2": "My phone number is 415-555-0142."
4343
},
44-
"query": "Happy everydays."
44+
"query": "Please help me update my account."
4545
}
4646
}
4747
```
@@ -77,10 +77,10 @@ This module is used to review the content input by end-users and the output cont
7777
"flagged": true,
7878
"action": "overridden",
7979
"inputs": {
80-
"var_1": "I will *** you.",
81-
"var_2": "I will *** you."
80+
"var_1": "My SSN is ***-**-****.",
81+
"var_2": "My phone number is ***-***-****."
8282
},
83-
"query": "Happy everydays."
83+
"query": "Please help me update my account."
8484
}
8585
```
8686

@@ -104,7 +104,7 @@ This module is used to review the content input by end-users and the output cont
104104
"point": "app.moderation.output",
105105
"params": {
106106
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
107-
"text": "I will kill you."
107+
"text": "My SSN is 123-45-6789."
108108
}
109109
}
110110
```
@@ -134,6 +134,6 @@ This module is used to review the content input by end-users and the output cont
134134
{
135135
"flagged": true,
136136
"action": "overridden",
137-
"text": "I will *** you."
137+
"text": "My SSN is ***-**-****."
138138
}
139139
```

versions/3-0-x/zh/user-guide/application-orchestrate/app-toolkits/moderation-tool.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@ OpenAI 和大多数 LLM 公司提供的模型,都带有内容审查功能,
1515

1616
### 功能二:自定义关键词
1717

18-
开发者可以自定义需要审查的敏感词,比如把“kill”作为关键词,在用户输入的时候作审核动作,要求预设回复内容为“The content is violating usage policies.”可以预见的结果是当用户在终端输入包含“kill”的语料片段,就会触发敏感词审查工具,返回预设回复内容。
19-
20-
![Keywords](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/application-orchestrate/app-toolkits/644c2b024f59497aed3cd8ac984c96e3.png)
18+
开发者可以自定义需要审查的敏感词,比如把“密钥”作为关键词,在用户输入的时候作审核动作,要求预设回复内容为“您的内容违反了我们的使用政策。”可以预见的结果是当用户在终端输入包含“密钥”的语料片段,就会触发敏感词审查工具,返回预设回复内容。
2119

2220
### 功能三: 敏感词审查 Moderation 扩展
2321

2422
不同的企业内部往往有着不同的敏感词审查机制,企业在开发自己的 AI 应用如企业内部知识库 ChatBot,需要对员工输入的查询内容作敏感词审查。为此,开发者可以根据自己企业内部的敏感词审查机制写一个 API 扩展,具体可参考 [敏感内容审查](/zh-hans/guides/tools/extensions/api-based/moderation),从而在 Dify 上调用,实现敏感词审查的高度自定义和隐私保护。
2523

2624
![Moderation Settings](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/application-orchestrate/app-toolkits/d8b6dff6fce6d70795b87aefc56eb02b.png)
2725

28-
比如我们在自己的本地服务中自定义敏感词审查规则:不能查询有关美国总统的名字的问题。当用户在`query`变量输入"Trump",则在对话时会返回 "Your content violates our usage policy." 测试效果如下:
29-
30-
![Moderation Test](https://assets-docs.dify.ai/dify-enterprise-mintlify/zh_CN/guides/application-orchestrate/app-toolkits/970c894a68f017def62c0f7253b0f44e.png)
26+
比如我们在自己的本地服务中自定义敏感词审查规则:不能查询有关公司内部薪资的问题。当用户在`query`变量输入"薪资",则在对话时会返回 "您的内容违反了我们的使用政策。"。

zh/use-dify/workspace/api-extension/moderation-api-extension.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ title: 敏感内容审查
4141
"params": {
4242
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
4343
"inputs": {
44-
"var_1": "I will kill you.",
45-
"var_2": "I will fuck you."
44+
"var_1": "我的身份证号是 11010119900307123X。",
45+
"var_2": "我的手机号是 138-0013-8000。"
4646
},
47-
"query": "Happy everydays."
47+
"query": "请帮我更新账户信息。"
4848
}
4949
}
5050
```
@@ -72,7 +72,7 @@ title: 敏感内容审查
7272
{
7373
"flagged": true,
7474
"action": "direct_output",
75-
"preset_response": "Your content violates our usage policy."
75+
"preset_response": "您的内容违反了我们的使用政策。"
7676
}
7777
```
7878
* `action=overridden`
@@ -81,10 +81,10 @@ title: 敏感内容审查
8181
"flagged": true,
8282
"action": "overridden",
8383
"inputs": {
84-
"var_1": "I will *** you.",
85-
"var_2": "I will *** you."
84+
"var_1": "我的身份证号是 ******************。",
85+
"var_2": "我的手机号是 ***-****-****。"
8686
},
87-
"query": "Happy everydays."
87+
"query": "请帮我更新账户信息。"
8888
}
8989
```
9090

@@ -110,7 +110,7 @@ title: 敏感内容审查
110110
"point": "app.moderation.output",
111111
"params": {
112112
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
113-
"text": "I will kill you."
113+
"text": "我的身份证号是 11010119900307123X。"
114114
}
115115
}
116116
```
@@ -133,15 +133,15 @@ title: 敏感内容审查
133133
{
134134
"flagged": true,
135135
"action": "direct_output",
136-
"preset_response": "Your content violates our usage policy."
136+
"preset_response": "您的内容违反了我们的使用政策。"
137137
}
138138
```
139139
* `action=overridden`
140140
```
141141
{
142142
"flagged": true,
143143
"action": "overridden",
144-
"text": "I will *** you."
144+
"text": "我的身份证号是 ******************。"
145145
}
146146
```
147147

0 commit comments

Comments
 (0)