Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ aiPrompt 插件用于在转发请求之前动态注入预设的 Prompt 内容(

**注意**:aiPrompt插件依赖于aiProxy插件, 常的调用流程中,应先用 **AiPrompt**(如果需要注入 prompt),再用 **AiTokenLimiter** 做令牌统计/限流(如果需要token限流),最后由 **AiProxy** 将请求转发给 LLM 服务。确保在 “插件管理” 中,**AiTokenLimiter** 的 **sort** 值 **小于** **AiProxy**,并 **大于** **AiPrompt**。

![](/static/img/shenyu/plugin/ai-prompt/ai-prompt-selector-zh.png)
![](/img/shenyu/plugin/ai-prompt/ai-prompt-selector-zh.png)

![ai-proxy-rule-zh](/static/img/shenyu/plugin/ai-prompt/ai-prompt-rule-zh.png)
![ai-proxy-rule-zh](/img/shenyu/plugin/ai-prompt/ai-prompt-rule-zh.png)



Expand All @@ -54,4 +54,4 @@ curl --location --request POST 'http://localhost:9195/ai/proxy/v1/chat/completio

示例截图

![ai-proxy-api](/static/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
![ai-proxy-api](/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ aiProxy 插件用作 LLM 请求的转发代理,支持主流大模型服务。

Selector 匹配路径后,Rule 中配置提供商、模型、API Key、上游地址等参数。

![](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-selector-zh.png)
![](/img/shenyu/plugin/ai-proxy/ai-proxy-selector-zh.png)

![ai-proxy-rule-zh](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-rule-zh.png)
![ai-proxy-rule-zh](/img/shenyu/plugin/ai-proxy/ai-proxy-rule-zh.png)

注意, 在该设置下, 还需要进行contextPath插件的设置, 以移除匹配前缀头, 拼接正确调用url, 请参考:[contextPath插件设置](../http-process/contextPath-plugin.md)

Expand Down Expand Up @@ -60,4 +60,4 @@ curl --location --request POST 'http://localhost:9195/ai/proxy/v1/chat/completio

示例截图

![ai-proxy-api](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
![ai-proxy-api](/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ aiPrompt 插件用于在转发请求之前动态注入预设的 Prompt 内容(

**注意**:aiPrompt插件依赖于aiProxy插件, 常的调用流程中,应先用 **AiPrompt**(如果需要注入 prompt),再用 **AiTokenLimiter** 做令牌统计/限流(如果需要token限流),最后由 **AiProxy** 将请求转发给 LLM 服务。确保在 “插件管理” 中,**AiTokenLimiter** 的 **sort** 值 **小于** **AiProxy**,并 **大于** **AiPrompt**。

![](/static/img/shenyu/plugin/ai-prompt/ai-prompt-selector-zh.png)
![](/img/shenyu/plugin/ai-prompt/ai-prompt-selector-zh.png)

![ai-proxy-rule-zh](/static/img/shenyu/plugin/ai-prompt/ai-prompt-rule-zh.png)
![ai-proxy-rule-zh](/img/shenyu/plugin/ai-prompt/ai-prompt-rule-zh.png)



Expand All @@ -54,4 +54,4 @@ curl --location --request POST 'http://localhost:9195/ai/proxy/v1/chat/completio

示例截图

![ai-proxy-api](/static/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
![ai-proxy-api](/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ aiProxy 插件用作 LLM 请求的转发代理,支持主流大模型服务。

Selector 匹配路径后,Rule 中配置提供商、模型、API Key、上游地址等参数。

![](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-selector-zh.png)
![](/img/shenyu/plugin/ai-proxy/ai-proxy-selector-zh.png)

![ai-proxy-rule-zh](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-rule-zh.png)
![ai-proxy-rule-zh](/img/shenyu/plugin/ai-proxy/ai-proxy-rule-zh.png)

注意, 在该设置下, 还需要进行contextPath插件的设置, 以移除匹配前缀头, 拼接正确调用url, 请参考:[contextPath插件设置](../http-process/contextPath-plugin.md)

Expand Down Expand Up @@ -60,4 +60,4 @@ curl --location --request POST 'http://localhost:9195/ai/proxy/v1/chat/completio

示例截图

![ai-proxy-api](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
![ai-proxy-api](/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ aiPrompt 插件用于在转发请求之前动态注入预设的 Prompt 内容(

**注意**:aiPrompt插件依赖于aiProxy插件, 常的调用流程中,应先用 **AiPrompt**(如果需要注入 prompt),再用 **AiTokenLimiter** 做令牌统计/限流(如果需要token限流),最后由 **AiProxy** 将请求转发给 LLM 服务。确保在 “插件管理” 中,**AiTokenLimiter** 的 **sort** 值 **小于** **AiProxy**,并 **大于** **AiPrompt**。

![](/static/img/shenyu/plugin/ai-prompt/ai-prompt-selector-zh.png)
![](/img/shenyu/plugin/ai-prompt/ai-prompt-selector-zh.png)

![ai-proxy-rule-zh](/static/img/shenyu/plugin/ai-prompt/ai-prompt-rule-zh.png)
![ai-proxy-rule-zh](/img/shenyu/plugin/ai-prompt/ai-prompt-rule-zh.png)



Expand All @@ -54,4 +54,4 @@ curl --location --request POST 'http://localhost:9195/ai/proxy/v1/chat/completio

示例截图

![ai-proxy-api](/static/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
![ai-proxy-api](/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ aiProxy 插件用作 LLM 请求的转发代理,支持主流大模型服务。

Selector 匹配路径后,Rule 中配置提供商、模型、API Key、上游地址等参数。

![](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-selector-zh.png)
![](/img/shenyu/plugin/ai-proxy/ai-proxy-selector-zh.png)

![ai-proxy-rule-zh](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-rule-zh.png)
![ai-proxy-rule-zh](/img/shenyu/plugin/ai-proxy/ai-proxy-rule-zh.png)

注意, 在该设置下, 还需要进行contextPath插件的设置, 以移除匹配前缀头, 拼接正确调用url, 请参考:[contextPath插件设置](../http-process/contextPath-plugin.md)

Expand Down Expand Up @@ -60,4 +60,4 @@ curl --location --request POST 'http://localhost:9195/ai/proxy/v1/chat/completio

示例截图

![ai-proxy-api](../../../../../../static/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)
![ai-proxy-api](/img/shenyu/plugin/ai-proxy/ai-proxy-api.png)