mirror of
https://github.com/alibaba/higress.git
synced 2026-05-26 13:47:27 +08:00
[feature] add checking of maliciousUrl & modelHallucination, and adjust consumer specific configs (#3024)
This commit is contained in:
@@ -37,8 +37,9 @@ description: 阿里云内容安全检测
|
||||
| `sensitiveDataLevelBar` | string | optional | S4 | 敏感内容检测拦截风险等级,取值为 `S4`, `S3`, `S2` or `S1` |
|
||||
| `timeout` | int | optional | 2000 | 调用内容安全服务时的超时时间 |
|
||||
| `bufferLimit` | int | optional | 1000 | 调用内容安全服务时每段文本的长度限制 |
|
||||
| `consumerSpecificRequestCheckService` | map | optional | - | 为不同消费者指定特定的请求检测服务 |
|
||||
| `consumerSpecificResponseCheckService` | map | optional | - | 为不同消费者指定特定的响应检测服务 |
|
||||
| `consumerRequestCheckService` | map | optional | - | 为不同消费者指定特定的请求检测服务 |
|
||||
| `consumerResponseCheckService` | map | optional | - | 为不同消费者指定特定的响应检测服务 |
|
||||
| `consumerRiskLevel` | map | optional | - | 为不同消费者指定各维度的拦截风险等级 |
|
||||
|
||||
补充说明一下 `denyMessage`,对非法请求的处理逻辑为:
|
||||
- 如果配置了 `denyMessage`,返回内容为 `denyMessage` 配置内容,格式为openai格式的流式/非流式响应
|
||||
@@ -70,6 +71,20 @@ description: 阿里云内容安全检测
|
||||
|
||||

|
||||
|
||||
阿里云内容安全配置示例:
|
||||
|
||||
```yaml
|
||||
requestCheckService: llm_query_moderation
|
||||
responseCheckService: llm_response_moderation
|
||||
```
|
||||
|
||||
阿里云AI安全护栏配置示例:
|
||||
|
||||
```yaml
|
||||
requestCheckService: query_security_check
|
||||
responseCheckService: response_security_check
|
||||
```
|
||||
|
||||
### 检测输入内容是否合规
|
||||
|
||||
```yaml
|
||||
|
||||
Reference in New Issue
Block a user