Copilot commented on code in PR #13206:
URL: https://github.com/apache/apisix/pull/13206#discussion_r3076970666


##########
docs/zh/latest/plugins/ai-prompt-decorator.md:
##########
@@ -27,83 +27,264 @@ description: 本文档包含有关 Apache APISIX ai-prompt-decorator 插件的
 #
 -->
 
+<head>
+  <link rel="canonical" href="https://docs.api7.ai/hub/ai-prompt-decorator"; />
+</head>
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
 ## 描述
 
-`ai-prompt-decorator` 插件通过在请求中追加或前置提示,简化了对 LLM 提供商(如 OpenAI 和 
Anthropic)及其模型的访问。
+`ai-prompt-decorator` 
插件通过在用户输入提示前后添加预设提示来修改用户输入,以在内容生成中设定上下文。这种做法有助于模型在交互过程中按照预期的指导方针运行。
 
 ## 插件属性
 
-| **字段**          | **必选项**      | **类型** | **描述**                             
        |
-| ----------------- | --------------- | -------- | 
-------------------------------------------- |
-| `prepend`         | 条件必选\*      | Array    | 要前置的提示对象数组                      
   |
-| `prepend.role`    | 是              | String   | 
消息的角色(`system`、`user`、`assistant`) |
-| `prepend.content` | 是              | String   | 消息的内容。最小长度:1                 
     |
-| `append`          | 条件必选\*      | Array    | 要追加的提示对象数组                      
   |
-| `append.role`     | 是              | String   | 
消息的角色(`system`、`user`、`assistant`) |
-| `append.content`  | 是              | String   | 消息的内容。最小长度:1                 
     |
+| **字段** | **必选项** | **类型** | **描述** |
+| --- | --- | --- | --- |
+| `prepend` | 条件必选\* | array | 要前置的提示对象数组。 |
+| `prepend.role` | True | string | 消息的角色。可选值为 `system`、`user` 和 `assistant`。 |
+| `prepend.content` | True | string | 消息的内容(提示)。最小长度:1。 |
+| `append` | 条件必选\* | array | 要追加的提示对象数组。 |
+| `append.role` | True | string | 消息的角色。可选值为 `system`、`user` 和 `assistant`。 |
+| `append.content` | True | string | 消息的内容(提示)。最小长度:1。 |

Review Comment:
   此处插件属性表的 **必选项** 列使用了 `True`,并且类型使用了小写 `array/string`。这与中文插件文档中常见的写法(`是否必填` 
列用 `是/否`,类型用 `Array/String/Object`,例如 
`docs/zh/latest/plugins/ai-prompt-template.md:40-48`)不一致。建议统一必选项取值与类型大小写,避免中英文混用。
   ```suggestion
   | `prepend` | 条件必选\* | Array | 要前置的提示对象数组。 |
   | `prepend.role` | 是 | String | 消息的角色。可选值为 `system`、`user` 和 `assistant`。 |
   | `prepend.content` | 是 | String | 消息的内容(提示)。最小长度:1。 |
   | `append` | 条件必选\* | Array | 要追加的提示对象数组。 |
   | `append.role` | 是 | String | 消息的角色。可选值为 `system`、`user` 和 `assistant`。 |
   | `append.content` | 是 | String | 消息的内容(提示)。最小长度:1。 |
   ```



##########
docs/zh/latest/plugins/ai-prompt-decorator.md:
##########
@@ -27,83 +27,264 @@ description: 本文档包含有关 Apache APISIX ai-prompt-decorator 插件的
 #
 -->
 
+<head>
+  <link rel="canonical" href="https://docs.api7.ai/hub/ai-prompt-decorator"; />
+</head>
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
 ## 描述
 
-`ai-prompt-decorator` 插件通过在请求中追加或前置提示,简化了对 LLM 提供商(如 OpenAI 和 
Anthropic)及其模型的访问。
+`ai-prompt-decorator` 
插件通过在用户输入提示前后添加预设提示来修改用户输入,以在内容生成中设定上下文。这种做法有助于模型在交互过程中按照预期的指导方针运行。
 
 ## 插件属性
 
-| **字段**          | **必选项**      | **类型** | **描述**                             
        |
-| ----------------- | --------------- | -------- | 
-------------------------------------------- |
-| `prepend`         | 条件必选\*      | Array    | 要前置的提示对象数组                      
   |
-| `prepend.role`    | 是              | String   | 
消息的角色(`system`、`user`、`assistant`) |
-| `prepend.content` | 是              | String   | 消息的内容。最小长度:1                 
     |
-| `append`          | 条件必选\*      | Array    | 要追加的提示对象数组                      
   |
-| `append.role`     | 是              | String   | 
消息的角色(`system`、`user`、`assistant`) |
-| `append.content`  | 是              | String   | 消息的内容。最小长度:1                 
     |
+| **字段** | **必选项** | **类型** | **描述** |
+| --- | --- | --- | --- |
+| `prepend` | 条件必选\* | array | 要前置的提示对象数组。 |
+| `prepend.role` | True | string | 消息的角色。可选值为 `system`、`user` 和 `assistant`。 |
+| `prepend.content` | True | string | 消息的内容(提示)。最小长度:1。 |
+| `append` | 条件必选\* | array | 要追加的提示对象数组。 |
+| `append.role` | True | string | 消息的角色。可选值为 `system`、`user` 和 `assistant`。 |
+| `append.content` | True | string | 消息的内容(提示)。最小长度:1。 |
 
 \* **条件必选**:必须提供 `prepend` 或 `append` 中的至少一个。
 
-## 使用示例
+## 示例
+
+以下示例将使用 OpenAI 作为上游服务提供商。在开始之前,请创建一个 [OpenAI 账户](https://openai.com)和一个 [API 
密钥](https://openai.com/blog/openai-api)。你可以选择将密钥保存到环境变量中:

Review Comment:
   链接后缺少空格:中文排版中建议在英文链接与中文连词之间留一个空格,以免渲染后紧贴在一起(`...OpenAI 账户](...)和一个...`)。
   ```suggestion
   以下示例将使用 OpenAI 作为上游服务提供商。在开始之前,请创建一个 [OpenAI 账户](https://openai.com) 和一个 
[API 密钥](https://openai.com/blog/openai-api)。你可以选择将密钥保存到环境变量中:
   ```



##########
docs/en/latest/plugins/ai-prompt-decorator.md:
##########
@@ -27,83 +27,264 @@ description: This document contains information about the 
Apache APISIX ai-promp
 #
 -->
 
+<head>
+  <link rel="canonical" href="https://docs.api7.ai/hub/ai-prompt-decorator"; />
+</head>
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
 ## Description
 
-The `ai-prompt-decorator` plugin simplifies access to LLM providers, such as 
OpenAI and Anthropic, and their models by appending or prepending prompts into 
the request.
+The `ai-prompt-decorator` Plugin modifies user input prompts by prefixing and 
appending pre-engineered prompts to set contexts in content generation. This 
practice helps the model operate within desired guidelines during interactions.
 
 ## Plugin Attributes
 
-| **Field**         | **Required**    | **Type** | **Description**             
                        |
-| ----------------- | --------------- | -------- | 
--------------------------------------------------- |
-| `prepend`         | Conditionally\* | Array    | An array of prompt objects 
to be prepended          |
-| `prepend.role`    | Yes             | String   | Role of the message 
(`system`, `user`, `assistant`) |
-| `prepend.content` | Yes             | String   | Content of the message. 
Minimum length: 1           |
-| `append`          | Conditionally\* | Array    | An array of prompt objects 
to be appended           |
-| `append.role`     | Yes             | String   | Role of the message 
(`system`, `user`, `assistant`) |
-| `append.content`  | Yes             | String   | Content of the message. 
Minimum length: 1           |
+| **Field** | **Required** | **Type** | **Description** |
+| --- | --- | --- | --- |
+| `prepend` | Conditionally\* | array | An array of prompt objects to be 
prepended. |
+| `prepend.role` | True | string | Role of the message. Valid values are 
`system`, `user`, and `assistant`. |
+| `prepend.content` | True | string | Content of the message (prompt). Minimum 
length: 1. |
+| `append` | Conditionally\* | array | An array of prompt objects to be 
appended. |
+| `append.role` | True | string | Role of the message. Valid values are 
`system`, `user`, and `assistant`. |
+| `append.content` | True | string | Content of the message (prompt). Minimum 
length: 1. |

Review Comment:
   The attribute table uses `True` in the **Required** column and lowercase 
type names (`array`, `string`). This is inconsistent with other plugin docs 
which use `Yes/No` and `Array/String/Object` (e.g., 
`docs/en/latest/plugins/ai-prompt-template.md:40-48`). Please align the 
required values and type capitalization to the established docs convention for 
consistency.
   ```suggestion
   | `prepend` | Yes\* | Array | An array of prompt objects to be prepended. |
   | `prepend.role` | Yes | String | Role of the message. Valid values are 
`system`, `user`, and `assistant`. |
   | `prepend.content` | Yes | String | Content of the message (prompt). 
Minimum length: 1. |
   | `append` | Yes\* | Array | An array of prompt objects to be appended. |
   | `append.role` | Yes | String | Role of the message. Valid values are 
`system`, `user`, and `assistant`. |
   | `append.content` | Yes | String | Content of the message (prompt). Minimum 
length: 1. |
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to