kayx23 commented on code in PR #13206: URL: https://github.com/apache/apisix/pull/13206#discussion_r3084442273
########## 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 | +| Name | Type | Required | Default | Valid values | Description | +| --- | --- | --- | --- | --- | --- | +| `prepend` | array | Conditionally\* | | | An array of prompt objects to be prepended. | +| `prepend.role` | string | True | | [`system`, `user`, `assistant`] | Role of the message. | +| `prepend.content` | string | True | | `length >= 1` | Content of the message (prompt). | +| `append` | array | Conditionally\* | | | An array of prompt objects to be appended. | +| `append.role` | string | True | | [`system`, `user`, `assistant`] | Role of the message. | +| `append.content` | string | True | | `length >= 1` | Content of the message (prompt). | Review Comment: ```suggestion | `append.content` | string | True | | length >= 1 | Content of the message (prompt). | ``` ########## 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 | +| Name | Type | Required | Default | Valid values | Description | +| --- | --- | --- | --- | --- | --- | +| `prepend` | array | Conditionally\* | | | An array of prompt objects to be prepended. | +| `prepend.role` | string | True | | [`system`, `user`, `assistant`] | Role of the message. | +| `prepend.content` | string | True | | `length >= 1` | Content of the message (prompt). | Review Comment: ```suggestion | `prepend.content` | string | True | | length >= 1 | Content of the message (prompt). | ``` ########## 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` | string | 是 | | [`system`, `user`, `assistant`] | 消息的角色。 | +| `prepend.content` | string | 是 | | `length >= 1` | 消息的内容(提示)。 | Review Comment: ```suggestion | `prepend.content` | string | 是 | | length >= 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` | string | 是 | | [`system`, `user`, `assistant`] | 消息的角色。 | +| `prepend.content` | string | 是 | | `length >= 1` | 消息的内容(提示)。 | +| `append` | array | 条件必选\* | | | 要追加的提示对象数组。 | +| `append.role` | string | 是 | | [`system`, `user`, `assistant`] | 消息的角色。 | +| `append.content` | string | 是 | | `length >= 1` | 消息的内容(提示)。 | Review Comment: ```suggestion | `append.content` | string | 是 | | 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]
