From b8ff815100ae2c6a2994d6603e13930714df7baf Mon Sep 17 00:00:00 2001 From: Kent Dong Date: Mon, 25 May 2026 15:02:39 +0800 Subject: [PATCH] fix: Fix the description of basePath related fields of ai-proxy plugin (#3870) Signed-off-by: CH3CHO --- plugins/wasm-go/extensions/ai-proxy/README.md | 3 ++- plugins/wasm-go/extensions/ai-proxy/README_EN.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/wasm-go/extensions/ai-proxy/README.md b/plugins/wasm-go/extensions/ai-proxy/README.md index 9ba80ac7..6760bfa9 100644 --- a/plugins/wasm-go/extensions/ai-proxy/README.md +++ b/plugins/wasm-go/extensions/ai-proxy/README.md @@ -56,7 +56,8 @@ description: AI 代理插件配置参考 | `retryOnFailure` | object | 非必填 | - | 当请求失败时立即进行重试 | | `reasoningContentMode` | string | 非必填 | - | 如何处理大模型服务返回的推理内容。目前支持以下取值:passthrough(正常输出推理内容)、ignore(不输出推理内容)、concat(将推理内容拼接在常规输出内容之前)。默认为 passthrough。仅支持通义千问服务。 | | `capabilities` | map of string | 非必填 | - | 部分 provider 的部分 ai 能力原生兼容 openai/v1 格式,不需要重写,可以直接转发,通过此配置项指定来开启转发, key 表示的是采用的厂商协议能力,values 表示的真实的厂商该能力的 api path, 厂商协议能力当前支持: openai/v1/chatcompletions, openai/v1/embeddings, openai/v1/imagegeneration, openai/v1/audiospeech, cohere/v1/rerank | -| `subPath` | string | 非必填 | - | 如果配置了subPath,将会先移除请求path中该前缀,再进行后续处理 | +| `basePath` | string | 非必填 | - | 如果配置了 basePath,可用于在请求 path 中移除该前缀,或添加至请求 path 中,默认为进行移除 | +| `basePathHandling` | string | 非必填 | removePrefix | basePathHandling 用于指定 basePath 的处理方式。可选值:removePrefix(移除路径前缀,将请求转发给上游时去除 basePath 前缀后再拼接)、prepend(添加路径前缀,将请求转发给上游时在路径前面添加 basePath 前缀) | | `contextCleanupCommands` | array of string | 非必填 | - | 上下文清理命令列表。当请求的 messages 中存在完全匹配任意一个命令的 user 消息时,将该消息及之前所有非 system 消息清理掉,只保留 system 消息和该命令之后的消息。可用于主动清理对话上下文。 | `context`的配置字段说明如下: diff --git a/plugins/wasm-go/extensions/ai-proxy/README_EN.md b/plugins/wasm-go/extensions/ai-proxy/README_EN.md index 5a119d8f..f9d842ab 100644 --- a/plugins/wasm-go/extensions/ai-proxy/README_EN.md +++ b/plugins/wasm-go/extensions/ai-proxy/README_EN.md @@ -52,7 +52,8 @@ Plugin execution priority: `100` | `context` | object | Optional | - | Configuration for AI conversation context information | | `customSettings` | array of customSetting | Optional | - | Specifies overrides or fills parameters for AI requests | | `failover` | object | Optional | - | Configures apiToken failover. When an apiToken becomes unavailable, it is removed from the available token list and restored after a successful health check or after the cooldown period expires. | -| `subPath` | string | Optional | - | If subPath is configured, the prefix will be removed from the request path before further processing. | +| `basePath` | string | Optional | - | If configured, basePath can be used to remove the prefix from the request path, or prepend the prefix to the request path. Defaults to removal. | +| `basePathHandling` | string | Optional | removePrefix | basePathHandling specifies how basePath is processed. Possible values: removePrefix (removes the basePath prefix from the request path before forwarding to upstream), prepend (adds the basePath prefix to the request path when forwarding to upstream) | | `contextCleanupCommands` | array of string | Optional | - | List of context cleanup commands. When a user message in the request exactly matches any of the configured commands, that message and all non-system messages before it will be removed, keeping only system messages and messages after the command. This enables users to actively clear conversation history. | **Details for the `context` configuration fields:**