mirror of
https://github.com/alibaba/higress.git
synced 2026-06-25 18:25:10 +08:00
fix: fix some typo errors (#3988)
Co-authored-by: woody <yaodiwu618@gmail.com>
This commit is contained in:
@@ -168,7 +168,7 @@ bool PluginRootContext::parsePluginConfig(const json& configuration,
|
||||
LOG_WARN("failed to parse configuration for block_bodys.");
|
||||
return false;
|
||||
}
|
||||
// compatiable
|
||||
// compatible
|
||||
if (!JsonArrayIterate(
|
||||
configuration, "block_bodies", [&](const json& item) -> bool {
|
||||
auto body = JsonValueAs<std::string>(item);
|
||||
|
||||
@@ -138,11 +138,11 @@ func parseOverrideRuleConfig(json gjson.Result, global config.PluginConfig, plug
|
||||
|
||||
pluginConfig.FromJson(json)
|
||||
if err := pluginConfig.Validate(); err != nil {
|
||||
log.Errorf("overriden rule config is invalid: %v", err)
|
||||
log.Errorf("overridden rule config is invalid: %v", err)
|
||||
return err
|
||||
}
|
||||
if err := pluginConfig.Complete(); err != nil {
|
||||
log.Errorf("failed to apply overriden rule config: %v", err)
|
||||
log.Errorf("failed to apply overridden rule config: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -577,7 +577,7 @@ func (c *ProviderConfig) FromJson(json gjson.Result) {
|
||||
if compatible := json.Get("qwenEnableCompatible"); compatible.Exists() {
|
||||
c.qwenEnableCompatible = compatible.Bool()
|
||||
} else {
|
||||
// Default use official compatiable mode
|
||||
// Default use official compatible mode
|
||||
c.qwenEnableCompatible = true
|
||||
}
|
||||
c.qwenDomain = json.Get("qwenDomain").String()
|
||||
|
||||
@@ -201,7 +201,7 @@ func parseConfig(json gjson.Result, config *Config) error {
|
||||
config.engine = append(config.engine, searchEngine)
|
||||
internetExists = true
|
||||
default:
|
||||
return fmt.Errorf("unkown search engine:%s", e.Get("type").String())
|
||||
return fmt.Errorf("unknown search engine:%s", e.Get("type").String())
|
||||
}
|
||||
}
|
||||
searchRewriteJson := json.Get("searchRewrite")
|
||||
@@ -271,7 +271,7 @@ func parseConfig(json gjson.Result, config *Config) error {
|
||||
config.searchRewrite = searchRewrite
|
||||
}
|
||||
if len(config.engine) == 0 {
|
||||
return fmt.Errorf("no avaliable search engine found")
|
||||
return fmt.Errorf("no available search engine found")
|
||||
}
|
||||
log.Debugf("ai search enabled, config: %#v", config)
|
||||
return nil
|
||||
@@ -529,7 +529,7 @@ func executeSearch(ctx wrapper.HttpContext, config Config, queryIndex int, body
|
||||
if err != nil {
|
||||
log.Errorf("modify request message content failed, err:%v, body:%s", err, body)
|
||||
} else {
|
||||
log.Debugf("modifeid body:%s", modifiedBody)
|
||||
log.Debugf("modified body:%s", modifiedBody)
|
||||
proxywasm.ReplaceHttpRequestBody(modifiedBody)
|
||||
if config.needReference {
|
||||
ctx.SetContext("References", strings.Join(formattedReferences, "\n\n"))
|
||||
|
||||
@@ -15,12 +15,12 @@ description: 阿里云内容安全检测
|
||||
## 配置说明
|
||||
| Name | Type | Requirement | Default | Description |
|
||||
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||
| `serviceName` | string | requried | - | 服务名 |
|
||||
| `servicePort` | string | requried | - | 服务端口 |
|
||||
| `serviceHost` | string | requried | - | 阿里云内容安全endpoint的域名 |
|
||||
| `accessKey` | string | requried | - | 阿里云AK |
|
||||
| `secretKey` | string | requried | - | 阿里云SK |
|
||||
| `action` | string | requried | - | 阿里云ai安全业务接口 |
|
||||
| `serviceName` | string | required | - | 服务名 |
|
||||
| `servicePort` | string | required | - | 服务端口 |
|
||||
| `serviceHost` | string | required | - | 阿里云内容安全endpoint的域名 |
|
||||
| `accessKey` | string | required | - | 阿里云AK |
|
||||
| `secretKey` | string | required | - | 阿里云SK |
|
||||
| `action` | string | required | - | 阿里云ai安全业务接口 |
|
||||
| `securityToken` | string | optional | - | 阿里云安全令牌(用于临时凭证) |
|
||||
| `checkRequest` | bool | optional | false | 检查提问内容是否合规 |
|
||||
| `checkResponse` | bool | optional | false | 检查大模型的回答内容是否合规,生效时会使流式响应变为非流式 |
|
||||
|
||||
@@ -16,12 +16,12 @@ Plugin Priority: `300`
|
||||
## Configuration
|
||||
| Name | Type | Requirement | Default | Description |
|
||||
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||
| `serviceName` | string | requried | - | service name |
|
||||
| `servicePort` | string | requried | - | service port |
|
||||
| `serviceHost` | string | requried | - | Host of Aliyun content security service endpoint |
|
||||
| `accessKey` | string | requried | - | Aliyun accesskey |
|
||||
| `secretKey` | string | requried | - | Aliyun secretkey |
|
||||
| `action` | string | requried | - | Aliyun ai guardrails business interface |
|
||||
| `serviceName` | string | required | - | service name |
|
||||
| `servicePort` | string | required | - | service port |
|
||||
| `serviceHost` | string | required | - | Host of Aliyun content security service endpoint |
|
||||
| `accessKey` | string | required | - | Aliyun accesskey |
|
||||
| `secretKey` | string | required | - | Aliyun secretkey |
|
||||
| `action` | string | required | - | Aliyun ai guardrails business interface |
|
||||
| `checkRequest` | bool | optional | false | check if the input is legal |
|
||||
| `checkResponse` | bool | optional | false | check if the output is legal |
|
||||
| `requestCheckService` | string | optional | llm_query_moderation | Aliyun yundun service name for input check |
|
||||
|
||||
@@ -16,13 +16,13 @@ AI 请求响应转换插件,通过LLM对请求/响应的header以及body进行
|
||||
## 配置说明
|
||||
| Name | Type | Requirement | Default | Description |
|
||||
| :- | :- | :- | :- | :- |
|
||||
| request.enable | bool | requried | - | 是否在request阶段开启转换 |
|
||||
| request.prompt | string | requried | - | request阶段转换使用的prompt |
|
||||
| response.enable | string | requried | - | 是否在response阶段开启转换 |
|
||||
| response.prompt | string | requried | - | response阶段转换使用的prompt |
|
||||
| provider.serviceName | string | requried | - | DNS类型的服务名,目前仅支持通义千问 |
|
||||
| provider.domain | string | requried | - | LLM服务域名 |
|
||||
| provider.apiKey | string | requried | - | 阿里云dashscope服务的API Key |
|
||||
| request.enable | bool | required | - | 是否在request阶段开启转换 |
|
||||
| request.prompt | string | required | - | request阶段转换使用的prompt |
|
||||
| response.enable | string | required | - | 是否在response阶段开启转换 |
|
||||
| response.prompt | string | required | - | response阶段转换使用的prompt |
|
||||
| provider.serviceName | string | required | - | DNS类型的服务名,目前仅支持通义千问 |
|
||||
| provider.domain | string | required | - | LLM服务域名 |
|
||||
| provider.apiKey | string | required | - | 阿里云dashscope服务的API Key |
|
||||
|
||||
## 配置示例
|
||||
```yaml
|
||||
|
||||
@@ -193,7 +193,7 @@ func awaitConvergence(t *testing.T, threshold int, maxTimeToConsistency time.Dur
|
||||
select {
|
||||
// Capture the overall timeout
|
||||
case <-to:
|
||||
t.Fatalf("timeout while waiting after %d attempts, %d/%d sucessess", attempts, successes, threshold)
|
||||
t.Fatalf("timeout while waiting after %d attempts, %d/%d successes", attempts, successes, threshold)
|
||||
// And the per-try delay
|
||||
case <-time.After(delay):
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ func awaitConvergence(t *testing.T, threshold int, maxTimeToConsistency time.Dur
|
||||
select {
|
||||
// Capture the overall timeout
|
||||
case <-to:
|
||||
t.Fatalf("timeout while waiting after %d attempts, %d/%d sucessess", attempts, successes, threshold)
|
||||
t.Fatalf("timeout while waiting after %d attempts, %d/%d successes", attempts, successes, threshold)
|
||||
// And the per-try delay
|
||||
case <-time.After(delay):
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user