Set the llm-api-key field of the ai-search plugin to optional (#1846)

This commit is contained in:
澄潭
2025-03-03 20:42:15 +08:00
committed by GitHub
parent 188914a16b
commit 0905cd0fc0
3 changed files with 2 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ description: higress 支持通过集成搜索引擎Google/Bing/Arxiv/Elastics
|------|----------|----------|--------|------|
| llmServiceName | string | 必填 | - | LLM服务名称 |
| llmServicePort | number | 必填 | - | LLM服务端口 |
| llmApiKey | string | 填 | - | LLM服务API密钥 |
| llmApiKey | string | 填 | - | LLM服务API密钥 |
| llmUrl | string | 必填 | - | LLM服务API地址 |
| llmModelName | string | 必填 | - | LLM模型名称 |
| timeoutMillisecond | number | 选填 | 30000 | API调用超时时间毫秒 |

View File

@@ -39,7 +39,7 @@ It is strongly recommended to enable this feature when using Arxiv or Elasticsea
|------|-----------|-------------|---------------|-------------|
| llmServiceName | string | Required | - | LLM service name |
| llmServicePort | number | Required | - | LLM service port |
| llmApiKey | string | Required | - | LLM service API key |
| llmApiKey | string | Optional | - | LLM service API key |
| llmUrl | string | Required | - | LLM service API URL |
| llmModelName | string | Required | - | LLM model name |
| timeoutMillisecond | number | Optional | 30000 | API call timeout (milliseconds) |

View File

@@ -196,9 +196,6 @@ func parseConfig(json gjson.Result, config *Config, log wrapper.Log) error {
Port: llmServicePort,
})
llmApiKey := searchRewriteJson.Get("llmApiKey").String()
if llmApiKey == "" {
return errors.New("llmApiKey not found")
}
searchRewrite.apiKey = llmApiKey
llmUrl := searchRewriteJson.Get("llmUrl").String()
if llmUrl == "" {