Skip to content

Commit

Permalink
set llm-api-key field optional of ai-search plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlanni committed Mar 3, 2025
1 parent 188914a commit 147ed35
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/wasm-go/extensions/ai-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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调用超时时间(毫秒) |
Expand Down
2 changes: 1 addition & 1 deletion plugins/wasm-go/extensions/ai-search/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
3 changes: 0 additions & 3 deletions plugins/wasm-go/extensions/ai-search/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down

0 comments on commit 147ed35

Please sign in to comment.