-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
backend/sdk/src/main/resources/plugins/ai-prompt-decorator/spec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: 1.0.0 | ||
info: | ||
category: custom | ||
name: ai-prompt-decorator | ||
title: AI提示词修饰器 | ||
x-title-i18n: | ||
zh-CN: AI提示词修饰器 | ||
description: 对LLM提示词进行修改 | ||
x-description-i18n: | ||
zh-CN: 对LLM提示词进行修改 | ||
iconUrl: https://img.alicdn.com/imgextra/i1/O1CN018iKKih1iVx287RltL_!!6000000004419-2-tps-42-42.png | ||
version: 1.0.0 | ||
contact: | ||
name: rinfx | ||
spec: | ||
phase: UNSPECIFIED_PHASE | ||
priority: 450 | ||
configSchema: | ||
openAPIV3Schema: | ||
type: object | ||
example: | ||
decorators: | ||
- name: hangzhou-guide | ||
decorator: | ||
prepend: | ||
- role: system | ||
content: "你将使用英语回答问题" | ||
- role: user | ||
content: "假设你现在所在地点为杭州" | ||
append: | ||
- role: user | ||
content: "在介绍杭州时,避开杭州的饮食" | ||
|
31 changes: 31 additions & 0 deletions
31
backend/sdk/src/main/resources/plugins/ai-prompt-template/spec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: 1.0.0 | ||
info: | ||
category: custom | ||
name: ai-prompt-template | ||
title: AI提示词模板 | ||
x-title-i18n: | ||
zh-CN: AI提示词模板 | ||
description: 基于模板构建LLM提示词 | ||
x-description-i18n: | ||
zh-CN: 基于模板构建LLM提示词 | ||
iconUrl: https://img.alicdn.com/imgextra/i1/O1CN018iKKih1iVx287RltL_!!6000000004419-2-tps-42-42.png | ||
version: 1.0.0 | ||
contact: | ||
name: rinfx | ||
spec: | ||
phase: UNSPECIFIED_PHASE | ||
priority: 500 | ||
configSchema: | ||
openAPIV3Schema: | ||
type: object | ||
example: | ||
templates: | ||
- name: developer-chat | ||
template: | ||
model: gpt-3.5-turbo | ||
messages: | ||
- role: system | ||
content: '你是一个 {{program}} 专家,编程语言为 {{language}}' | ||
- role: user | ||
content: '帮我写一个 {{program}} 程序' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: 1.0.0 | ||
info: | ||
category: custom | ||
name: ai-rag | ||
title: AI检索增强生成 | ||
x-title-i18n: | ||
zh-CN: AI检索增强生成 | ||
description: 通过RAG技术优化大模型生成内容 | ||
x-description-i18n: | ||
zh-CN: 通过RAG技术优化大模型生成内容 | ||
iconUrl: https://img.alicdn.com/imgextra/i1/O1CN018iKKih1iVx287RltL_!!6000000004419-2-tps-42-42.png | ||
version: 1.0.0 | ||
contact: | ||
name: rinfx | ||
spec: | ||
phase: UNSPECIFIED_PHASE | ||
priority: 400 | ||
configSchema: | ||
openAPIV3Schema: | ||
type: object | ||
example: | ||
dashscope: | ||
apiKey: xxxxxxxxxxxxxxxxxxxx | ||
serviceName: dashscope | ||
servicePort: 443 | ||
domain: dashscope.aliyuncs.com | ||
dashvector: | ||
apiKey: xxxxxxxxxxxxxxxxxxxx | ||
serviceName: dashvector | ||
servicePort: 443 | ||
domain: vrs-cn-xxxxxxxxxxxxxxxxxxxx.dashvector.cn-hangzhou.aliyuncs.com | ||
collection: news_embedings | ||
|
28 changes: 28 additions & 0 deletions
28
backend/sdk/src/main/resources/plugins/ai-security-guard/spec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: 1.0.0 | ||
info: | ||
category: custom | ||
name: ai-security-guard | ||
title: AI内容安全 | ||
x-title-i18n: | ||
zh-CN: AI内容安全 | ||
description: 基于阿里云内容安全对大模型的输入输出进行安全检测 | ||
x-description-i18n: | ||
zh-CN: 基于阿里云内容安全对大模型的输入输出进行安全检测 | ||
iconUrl: https://img.alicdn.com/imgextra/i1/O1CN018iKKih1iVx287RltL_!!6000000004419-2-tps-42-42.png | ||
version: 1.0.0 | ||
contact: | ||
name: rinfx | ||
spec: | ||
phase: UNSPECIFIED_PHASE | ||
priority: 300 | ||
configSchema: | ||
openAPIV3Schema: | ||
type: object | ||
example: | ||
serviceSource: dns | ||
serviceName: safecheck | ||
servicePort: 443 | ||
domain: green-cip.cn-shanghai.aliyuncs.com | ||
ak: xxxxxxxxxxxxxxxxxxxx | ||
sk: xxxxxxxxxxxxxxxxxxxx | ||
|
23 changes: 23 additions & 0 deletions
23
backend/sdk/src/main/resources/plugins/ai-statistics/spec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: 1.0.0 | ||
info: | ||
category: custom | ||
name: ai-statistics | ||
title: AI可观测 | ||
x-title-i18n: | ||
zh-CN: AI可观测 | ||
description: 生成AI可观测数据 | ||
x-description-i18n: | ||
zh-CN: 生成AI可观测数据 | ||
iconUrl: https://img.alicdn.com/imgextra/i1/O1CN018iKKih1iVx287RltL_!!6000000004419-2-tps-42-42.png | ||
version: 1.0.0 | ||
contact: | ||
name: rinfx | ||
spec: | ||
phase: UNSPECIFIED_PHASE | ||
priority: 200 | ||
configSchema: | ||
openAPIV3Schema: | ||
type: object | ||
example: | ||
enable: true | ||
|
33 changes: 33 additions & 0 deletions
33
backend/sdk/src/main/resources/plugins/ai-token-ratelimit/spec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: 1.0.0 | ||
info: | ||
category: custom | ||
name: ai-token-ratelimit | ||
title: AI Token 限流 | ||
x-title-i18n: | ||
zh-CN: AI Token 限流 | ||
description: 对大模型服务进行 Token 限流 | ||
x-description-i18n: | ||
zh-CN: 对大模型服务进行 Token 限流 | ||
iconUrl: https://img.alicdn.com/imgextra/i1/O1CN018iKKih1iVx287RltL_!!6000000004419-2-tps-42-42.png | ||
version: 1.0.0 | ||
contact: | ||
name: rinfx | ||
spec: | ||
phase: UNSPECIFIED_PHASE | ||
priority: 600 | ||
configSchema: | ||
openAPIV3Schema: | ||
type: object | ||
example: | ||
rule_name: default_rule | ||
rule_items: | ||
- limit_by_per_ip: from-remote-addr | ||
limit_keys: | ||
- key: 0.0.0.0/0 | ||
token_per_minute: 100 | ||
redis: | ||
service_name: redis.static | ||
service_port: 6379 | ||
username: default | ||
password: '123456' | ||
|
32 changes: 32 additions & 0 deletions
32
backend/sdk/src/main/resources/plugins/ai-transformer/spec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: 1.0.0 | ||
info: | ||
category: custom | ||
name: ai-transformer | ||
title: AI请求/响应转换 | ||
x-title-i18n: | ||
zh-CN: AI请求/响应转换 | ||
description: 基于LLM对请求/响应进行智能转换 | ||
x-description-i18n: | ||
zh-CN: 基于LLM对请求/响应进行智能转换 | ||
iconUrl: https://img.alicdn.com/imgextra/i1/O1CN018iKKih1iVx287RltL_!!6000000004419-2-tps-42-42.png | ||
version: 1.0.0 | ||
contact: | ||
name: rinfx | ||
spec: | ||
phase: UNSPECIFIED_PHASE | ||
priority: 550 | ||
configSchema: | ||
openAPIV3Schema: | ||
type: object | ||
example: | ||
request: | ||
enable: false | ||
prompt: "如果请求path是以/httpbin开头的,帮我去掉/httpbin前缀,其他的不要改。" | ||
response: | ||
enable: true | ||
prompt: "帮我修改以下HTTP应答信息,要求:1. content-type修改为application/json;2. body由xml转化为json;3.移除content-length。" | ||
provider: | ||
serviceName: qwen | ||
domain: dashscope.aliyuncs.com | ||
sk: sk-xxxxxxxxxxxxxxxxxxx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters