update plugins doc (#1305)

This commit is contained in:
澄潭
2024-09-12 21:48:40 +08:00
committed by GitHub
parent 0f9113ed82
commit c7c4ae1da2
80 changed files with 7373 additions and 2368 deletions

View File

@@ -1,7 +1,19 @@
# 简介
低代码开发插件通过LLM对请求/响应的header以及body进行修改。
---
title: AI 请求响应转换
keywords: [higress,AI transformer]
description: AI 请求响应转换插件配置参考
---
# 配置说明
## 功能说明
AI 请求响应转换插件通过LLM对请求/响应的header以及body进行修改。
## 运行属性
插件执行阶段:`认证阶段`
插件执行优先级:`410`
## 配置说明
| Name | Type | Requirement | Default | Description |
| :- | :- | :- | :- | :- |
| request.enable | bool | requried | - | 是否在request阶段开启转换 |
@@ -12,7 +24,7 @@
| provider.domain | string | requried | - | LLM服务域名 |
| provider.apiKey | string | requried | - | 阿里云dashscope服务的API Key |
# 配置示例
## 配置示例
```yaml
request:
enable: false

View File

@@ -0,0 +1,85 @@
---
title: AI Request-Response Transformation
keywords: [higress, AI transformer]
description: AI Request-Response Transformation plugin configuration reference
---
## Function Description
The AI Request-Response Transformation plugin modifies the header and body of requests/responses using LLM.
## Execution Attributes
Plugin execution phase: `Authentication Phase`
Plugin execution priority: `410`
## Configuration Description
| Name | Type | Requirement | Default | Description |
| :- | :- | :- | :- | :- |
| request.enable | bool | required | - | Whether to enable transformation in the request phase |
| request.prompt | string | required | - | Prompt used for transformation in the request phase |
| response.enable | bool | required | - | Whether to enable transformation in the response phase |
| response.prompt | string | required | - | Prompt used for transformation in the response phase |
| provider.serviceName | string | required | - | DNS type service name, currently only supports Qwen |
| provider.domain | string | required | - | LLM service domain |
| provider.apiKey | string | required | - | Alibaba Cloud Dashscope service API Key |
## Configuration Example
```yaml
request:
enable: false
prompt: "If the request path starts with /httpbin, please remove the /httpbin prefix and do not change anything else."
response:
enable: true
prompt: "Please modify the following HTTP response information with the requirements: 1. change content-type to application/json; 2. convert body from xml to json; 3. remove content-length."
provider:
serviceName: qwen
domain: dashscope.aliyuncs.com
apiKey: xxxxxxxxxxxxx
```
Accessing the original httpbin's /xml interface yields:
```
<?xml version='1.0' encoding='us-ascii'?>
<!-- A SAMPLE set of slides -->
<slideshow
title="Sample Slide Show"
date="Date of publication"
author="Yours Truly"
>
<!-- TITLE SLIDE -->
<slide type="all">
<title>Wake up to WonderWidgets!</title>
</slide>
<!-- OVERVIEW -->
<slide type="all">
<title>Overview</title>
<item>Why <em>WonderWidgets</em> are great</item>
<item/>
<item>Who <em>buys</em> WonderWidgets</item>
</slide>
</slideshow>
```
Using the above configuration, accessing the httpbin's /xml interface through the gateway yields:
```
{
"slideshow": {
"title": "Sample Slide Show",
"date": "Date of publication",
"author": "Yours Truly",
"slides": [
{
"type": "all",
"title": "Wake up to WonderWidgets!"
},
{
"type": "all",
"title": "Overview",
"items": [
"Why <em>WonderWidgets</em> are great",
"",
"Who <em>buys</em> WonderWidgets"
]
}
]
}
}
```