feat(canvas): 图片编辑 - 合并图片编辑工作流并保留近期项目基线
This commit is contained in:
BIN
plugin-packages/a6api.yingce-plugin
Normal file
BIN
plugin-packages/a6api.yingce-plugin
Normal file
Binary file not shown.
20
plugin-packages/a6api/README.md
Normal file
20
plugin-packages/a6api/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# A6api
|
||||
|
||||
A6api 模型网关协议插件。统一入口 `https://api.a6api.com`,OpenAI 兼容(`Authorization: Bearer <api_key>`)。
|
||||
|
||||
## Providers
|
||||
|
||||
| Provider | 能力 | 端点 |
|
||||
|---|---|---|
|
||||
| a6api-chat | text | POST /chat/completions |
|
||||
| a6api-image | image | POST /images/generations、POST /images/edits |
|
||||
|
||||
## 配置
|
||||
|
||||
在渠道中填写 API Key(A6api 控制台创建,形如 `sk-xxxxxxxx`),baseUrl 使用 `https://api.a6api.com`。
|
||||
|
||||
## 说明
|
||||
|
||||
- 模型名以 A6api 模型市场当前列表为准。
|
||||
- 图像编辑(带参考图)走 `/images/edits` multipart 请求。
|
||||
- 错误体为 OpenAI 风格,携带 `request_id`。
|
||||
522
plugin-packages/a6api/docs/interface.md
Normal file
522
plugin-packages/a6api/docs/interface.md
Normal file
@@ -0,0 +1,522 @@
|
||||
# A6api 接口说明
|
||||
|
||||
## 鉴权
|
||||
|
||||
`Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## 文本对话
|
||||
|
||||
POST `https://api.a6api.com/chat/completions`
|
||||
|
||||
请求体 OpenAI Chat Completions 格式:`model`、`messages`、`temperature`、`max_tokens`、`tools`、`tool_choice`、`response_format`、`stream` 等。
|
||||
|
||||
响应 `choices[0].message.content` 为正文,`choices[0].message.reasoning_content` 为推理内容,`usage` 为用量。
|
||||
|
||||
## 图像生成
|
||||
|
||||
POST `https://api.a6api.com/images/generations`
|
||||
|
||||
请求体:`model`、`prompt`、`n`、`size`、`quality`、`response_format`。
|
||||
|
||||
响应 `data[].url` 或 `data[].b64_json`。
|
||||
|
||||
## 图像编辑
|
||||
|
||||
POST `https://api.a6api.com/images/edits`(multipart,带参考图时使用)
|
||||
|
||||
## 模型列表
|
||||
|
||||
GET `https://api.a6api.com/models`
|
||||
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_START -->
|
||||
## Manifest 完整接口定义
|
||||
|
||||
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
|
||||
|
||||
```json
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "a6api",
|
||||
"name": "A6api",
|
||||
"version": "1.0.0",
|
||||
"author": "A6api",
|
||||
"description": "A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。",
|
||||
"permissions": [
|
||||
"generation.run",
|
||||
"media.read"
|
||||
],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "apiKey",
|
||||
"type": "secret",
|
||||
"label": "API Key",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "a6api-chat",
|
||||
"label": "A6api Chat",
|
||||
"capabilities": [
|
||||
"text"
|
||||
],
|
||||
"scopes": [
|
||||
"admin.system-channel",
|
||||
"user.custom-channel",
|
||||
"canvas",
|
||||
"creation",
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "https://api.a6api.com",
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "model",
|
||||
"description": "A6api 模型市场中的模型 ID。"
|
||||
},
|
||||
{
|
||||
"name": "messages",
|
||||
"type": "message[]",
|
||||
"required": true,
|
||||
"mapping": "provider message container",
|
||||
"description": "包含历史消息和当前用户输入。"
|
||||
},
|
||||
{
|
||||
"name": "instructions",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "system/instructions",
|
||||
"description": "系统指令。"
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"mapping": "temperature",
|
||||
"description": "采样温度。"
|
||||
},
|
||||
{
|
||||
"name": "top_p",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"mapping": "top_p",
|
||||
"description": "核采样参数。"
|
||||
},
|
||||
{
|
||||
"name": "max_tokens",
|
||||
"type": "integer",
|
||||
"required": false,
|
||||
"mapping": "max_tokens/max_output_tokens",
|
||||
"description": "最大输出 token。"
|
||||
},
|
||||
{
|
||||
"name": "tools",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"mapping": "tools/toolConfig",
|
||||
"description": "工具定义。"
|
||||
},
|
||||
{
|
||||
"name": "tool_choice",
|
||||
"type": "object|string",
|
||||
"required": false,
|
||||
"mapping": "tool_choice",
|
||||
"description": "工具选择策略。"
|
||||
},
|
||||
{
|
||||
"name": "response_format",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "response_format/text",
|
||||
"description": "结构化输出配置。"
|
||||
},
|
||||
{
|
||||
"name": "stream",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"mapping": "stream",
|
||||
"description": "流式开关;后台任务当前以最终响应归一。"
|
||||
},
|
||||
{
|
||||
"name": "providerOptions",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "provider-specific fields",
|
||||
"description": "插件命名空间内的厂商扩展字段。"
|
||||
}
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/chat/completions",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"model": {
|
||||
"$ref": "request.model"
|
||||
},
|
||||
"messages": {
|
||||
"$ref": "request.messages"
|
||||
},
|
||||
"temperature": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.temperature"
|
||||
}
|
||||
},
|
||||
"top_p": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.top_p"
|
||||
}
|
||||
},
|
||||
"max_tokens": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.extra.max_tokens"
|
||||
},
|
||||
{
|
||||
"$ref": "request.providerOptions.a6api-chat.max_tokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tools": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.tools"
|
||||
}
|
||||
},
|
||||
"tool_choice": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.tool_choice"
|
||||
}
|
||||
},
|
||||
"response_format": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.response_format"
|
||||
}
|
||||
},
|
||||
"stream": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.stream"
|
||||
}
|
||||
},
|
||||
"stop": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.stop"
|
||||
}
|
||||
},
|
||||
"seed": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.seed"
|
||||
}
|
||||
},
|
||||
"frequency_penalty": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.frequency_penalty"
|
||||
}
|
||||
},
|
||||
"presence_penalty": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.presence_penalty"
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-chat.user"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": "succeeded",
|
||||
"textPaths": [
|
||||
"choices.0.message.content",
|
||||
"choices.0.text"
|
||||
],
|
||||
"reasoningPaths": [
|
||||
"choices.0.message.reasoning_content"
|
||||
],
|
||||
"usage": {
|
||||
"$ref": "response.usage"
|
||||
},
|
||||
"errorPaths": [
|
||||
"error.code"
|
||||
],
|
||||
"messagePaths": [
|
||||
"error.message"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "a6api-image",
|
||||
"label": "A6api Image",
|
||||
"capabilities": [
|
||||
"image"
|
||||
],
|
||||
"scopes": [
|
||||
"admin.system-channel",
|
||||
"user.custom-channel",
|
||||
"canvas",
|
||||
"creation",
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "https://api.a6api.com",
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "model",
|
||||
"description": "A6api 模型市场中的图像模型 ID。"
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "prompt",
|
||||
"description": "图片提示词。"
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "media[]",
|
||||
"required": false,
|
||||
"mapping": "provider image/reference fields",
|
||||
"description": "参考图或编辑源图,role 由业务层确定。"
|
||||
},
|
||||
{
|
||||
"name": "imageCount",
|
||||
"type": "integer",
|
||||
"required": false,
|
||||
"mapping": "n/sample_count",
|
||||
"description": "输出数量。"
|
||||
},
|
||||
{
|
||||
"name": "aspectRatio",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "size/aspect_ratio",
|
||||
"description": "比例或尺寸,语义按协议说明。"
|
||||
},
|
||||
{
|
||||
"name": "resolution",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "resolution/imageSize",
|
||||
"description": "分辨率档位。"
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "quality",
|
||||
"description": "质量档位。"
|
||||
},
|
||||
{
|
||||
"name": "providerOptions",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "provider-specific fields",
|
||||
"description": "插件命名空间内的厂商扩展字段。"
|
||||
}
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/images/generations",
|
||||
"pathTemplate": {
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$gt": [
|
||||
{
|
||||
"$len": {
|
||||
"$ref": "request.images"
|
||||
}
|
||||
},
|
||||
0
|
||||
]
|
||||
},
|
||||
"then": "/images/edits",
|
||||
"else": "/images/generations"
|
||||
}
|
||||
},
|
||||
"contentType": "application/json",
|
||||
"contentTypeTemplate": {
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$gt": [
|
||||
{
|
||||
"$len": {
|
||||
"$ref": "request.images"
|
||||
}
|
||||
},
|
||||
0
|
||||
]
|
||||
},
|
||||
"then": "multipart/form-data",
|
||||
"else": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"model": {
|
||||
"$ref": "request.model"
|
||||
},
|
||||
"prompt": {
|
||||
"$ref": "request.prompt"
|
||||
},
|
||||
"n": {
|
||||
"$omitEmpty": {
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$gt": [
|
||||
{
|
||||
"$ref": "request.imageCount"
|
||||
},
|
||||
0
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"$ref": "request.imageCount"
|
||||
},
|
||||
"else": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.aspectRatio"
|
||||
}
|
||||
},
|
||||
"quality": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.quality"
|
||||
}
|
||||
},
|
||||
"output_format": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.providerOptions.a6api-image.output_format"
|
||||
},
|
||||
"png"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response_format": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.providerOptions.a6api-image.response_format"
|
||||
},
|
||||
"b64_json"
|
||||
]
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.a6api-image.user"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"name": "image",
|
||||
"source": {
|
||||
"$filter": {
|
||||
"from": {
|
||||
"$ref": "request.images"
|
||||
},
|
||||
"as": "media",
|
||||
"where": {
|
||||
"$ne": [
|
||||
{
|
||||
"$ref": "media.role"
|
||||
},
|
||||
"mask"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"filename": "source.png"
|
||||
},
|
||||
{
|
||||
"name": "mask",
|
||||
"source": {
|
||||
"$filter": {
|
||||
"from": {
|
||||
"$ref": "request.images"
|
||||
},
|
||||
"as": "media",
|
||||
"where": {
|
||||
"$eq": [
|
||||
{
|
||||
"$ref": "media.role"
|
||||
},
|
||||
"mask"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"filename": "mask.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"status": "succeeded",
|
||||
"images": {
|
||||
"$map": {
|
||||
"from": {
|
||||
"$ref": "response.data"
|
||||
},
|
||||
"as": "item",
|
||||
"in": {
|
||||
"url": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "item.url"
|
||||
}
|
||||
},
|
||||
"dataUrl": {
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$ref": "item.b64_json"
|
||||
},
|
||||
"then": {
|
||||
"$concat": [
|
||||
"data:image/png;base64,",
|
||||
{
|
||||
"$ref": "item.b64_json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"else": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"usage": {
|
||||
"$ref": "response.usage"
|
||||
},
|
||||
"errorPaths": [
|
||||
"error.code"
|
||||
],
|
||||
"messagePaths": [
|
||||
"error.message"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>"
|
||||
}
|
||||
```
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_END -->
|
||||
484
plugin-packages/a6api/manifest.json
Normal file
484
plugin-packages/a6api/manifest.json
Normal file
File diff suppressed because one or more lines are too long
BIN
plugin-packages/antigravity-proxy.yingce-plugin
Normal file
BIN
plugin-packages/antigravity-proxy.yingce-plugin
Normal file
Binary file not shown.
41
plugin-packages/antigravity-proxy/README.md
Normal file
41
plugin-packages/antigravity-proxy/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Antigravity Proxy
|
||||
|
||||
Antigravity 中转渠道插件:OpenAI Chat Completions 兼容对话协议。
|
||||
|
||||
## 协议身份
|
||||
|
||||
- 插件 ID:`antigravity-proxy`
|
||||
- Provider ID:`antigravity-chat`
|
||||
- 能力:`text`
|
||||
- 默认 Base URL:`http://103.242.14.110:8317`
|
||||
- 鉴权驱动:`bearer`
|
||||
- 创建:`POST /chat/completions`
|
||||
- 生命周期:同步响应
|
||||
|
||||
## 配置字段
|
||||
|
||||
| 字段 | 类型 | 必填 | 含义 |
|
||||
| --- | --- | --- | --- |
|
||||
| `apiKey` | secret | 是 | 中转渠道 API Key |
|
||||
|
||||
## 模型
|
||||
|
||||
- `gemini-3.8-flash-high`
|
||||
- `gemini-pro-agent`
|
||||
|
||||
## 统一字段映射
|
||||
|
||||
| 统一字段 | 类型 | 必填 | 上游映射 |
|
||||
| --- | --- | --- | --- |
|
||||
| `model` | string | 是 | `model` |
|
||||
| `messages` | message[] | 是 | `messages` |
|
||||
| `instructions` | string | 否 | `system/instructions` |
|
||||
| `temperature` | number | 否 | `temperature` |
|
||||
| `top_p` | number | 否 | `top_p` |
|
||||
| `max_tokens` | integer | 否 | `max_tokens` |
|
||||
| `tools` | array | 否 | `tools` |
|
||||
| `tool_choice` | object\|string | 否 | `tool_choice` |
|
||||
| `response_format` | object | 否 | `response_format` |
|
||||
| `stream` | boolean | 否 | `stream` |
|
||||
|
||||
完整接口见 [docs/interface.md](docs/interface.md)。
|
||||
303
plugin-packages/antigravity-proxy/docs/interface.md
Normal file
303
plugin-packages/antigravity-proxy/docs/interface.md
Normal file
@@ -0,0 +1,303 @@
|
||||
# Antigravity Proxy 接口字段
|
||||
|
||||
## 协议身份
|
||||
|
||||
- 插件 ID:`antigravity-proxy`
|
||||
- Provider ID:`antigravity-chat`
|
||||
- 能力:`text`
|
||||
- 默认 Base URL:`http://103.242.14.110:8317`
|
||||
- 鉴权驱动:`bearer`
|
||||
- 创建:`POST /chat/completions`
|
||||
- 生命周期:同步响应
|
||||
|
||||
## 配置字段
|
||||
|
||||
| 字段 | 类型 | 必填 | 含义 |
|
||||
| --- | --- | --- | --- |
|
||||
| `apiKey` | secret | 是 | 中转渠道 API Key |
|
||||
|
||||
## 统一字段映射
|
||||
|
||||
| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `model` | string | 是 | `model` | 上游模型 ID。 |
|
||||
| `messages` | message[] | 是 | `messages` | 包含历史消息和当前用户输入。 |
|
||||
| `instructions` | string | 否 | `system/instructions` | 系统指令。 |
|
||||
| `temperature` | number | 否 | `temperature` | 采样温度。 |
|
||||
| `top_p` | number | 否 | `top_p` | 核采样参数。 |
|
||||
| `max_tokens` | integer | 否 | `max_tokens/max_output_tokens` | 最大输出 token。 |
|
||||
| `tools` | array | 否 | `tools/toolConfig` | 工具定义。 |
|
||||
| `tool_choice` | object\|string | 否 | `tool_choice` | 工具选择策略。 |
|
||||
| `response_format` | object | 否 | `response_format/text` | 结构化输出配置。 |
|
||||
| `stream` | boolean | 否 | `stream` | 流式开关。 |
|
||||
|
||||
## 上游请求模板
|
||||
|
||||
| 上游位置 | 值或转换表达式 |
|
||||
| --- | --- |
|
||||
| `create.method` | `"POST"` |
|
||||
| `create.path` | `"/chat/completions"` |
|
||||
| `create.contentType` | `"application/json"` |
|
||||
| `create.body.model` | `{"$ref":"request.model"}` |
|
||||
| `create.body.messages` | `{"$ref":"request.messages"}` |
|
||||
| `create.body.temperature` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.temperature"}}` |
|
||||
| `create.body.top_p` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.top_p"}}` |
|
||||
| `create.body.max_tokens` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.extra.max_tokens"},{"$ref":"request.providerOptions.antigravity-chat.max_tokens"}]}}` |
|
||||
| `create.body.tools` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tools"}}` |
|
||||
| `create.body.tool_choice` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tool_choice"}}` |
|
||||
| `create.body.response_format` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.response_format"}}` |
|
||||
| `create.body.stream` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stream"}}` |
|
||||
| `create.body.stop` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stop"}}` |
|
||||
| `create.body.seed` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.seed"}}` |
|
||||
| `create.body.frequency_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.frequency_penalty"}}` |
|
||||
| `create.body.presence_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.presence_penalty"}}` |
|
||||
| `create.body.user` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.user"}}` |
|
||||
|
||||
## 响应映射
|
||||
|
||||
| 映射位置 | 上游路径或转换表达式 |
|
||||
| --- | --- |
|
||||
| `response.status` | `"succeeded"` |
|
||||
| `response.textPaths[0]` | `"choices.0.message.content"` |
|
||||
| `response.textPaths[1]` | `"choices.0.text"` |
|
||||
| `response.reasoningPaths[0]` | `"choices.0.message.reasoning_content"` |
|
||||
| `response.usage` | `{"$ref":"response.usage"}` |
|
||||
| `response.errorPaths[0]` | `"error.code"` |
|
||||
| `response.messagePaths[0]` | `"error.message"` |
|
||||
|
||||
## 兼容边界
|
||||
|
||||
该包只代表 Antigravity 中转渠道的 OpenAI Chat Completions 线协议;其他端点或网关包装必须使用独立插件。
|
||||
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_START -->
|
||||
## Manifest 完整接口定义
|
||||
|
||||
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
|
||||
|
||||
```json
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "antigravity-proxy",
|
||||
"name": "Antigravity Proxy",
|
||||
"version": "1.0.0",
|
||||
"author": "Yingce",
|
||||
"description": "Antigravity 中转渠道插件:OpenAI 兼容对话(gemini-3.8-flash-high / gemini-pro-agent)。",
|
||||
"permissions": [
|
||||
"generation.run",
|
||||
"media.read"
|
||||
],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "apiKey",
|
||||
"type": "secret",
|
||||
"label": "API Key",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "antigravity-chat",
|
||||
"label": "Antigravity Chat",
|
||||
"capabilities": [
|
||||
"text"
|
||||
],
|
||||
"scopes": [
|
||||
"admin.system-channel",
|
||||
"user.custom-channel",
|
||||
"canvas",
|
||||
"creation",
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "http://103.242.14.110:8317",
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "model",
|
||||
"description": "模型 ID(gemini-3.8-flash-high / gemini-pro-agent)。"
|
||||
},
|
||||
{
|
||||
"name": "messages",
|
||||
"type": "message[]",
|
||||
"required": true,
|
||||
"mapping": "provider message container",
|
||||
"description": "包含历史消息和当前用户输入。"
|
||||
},
|
||||
{
|
||||
"name": "instructions",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "system/instructions",
|
||||
"description": "系统指令。"
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"mapping": "temperature",
|
||||
"description": "采样温度。"
|
||||
},
|
||||
{
|
||||
"name": "top_p",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"mapping": "top_p",
|
||||
"description": "核采样参数。"
|
||||
},
|
||||
{
|
||||
"name": "max_tokens",
|
||||
"type": "integer",
|
||||
"required": false,
|
||||
"mapping": "max_tokens/max_output_tokens",
|
||||
"description": "最大输出 token。"
|
||||
},
|
||||
{
|
||||
"name": "tools",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"mapping": "tools/toolConfig",
|
||||
"description": "工具定义。"
|
||||
},
|
||||
{
|
||||
"name": "tool_choice",
|
||||
"type": "object|string",
|
||||
"required": false,
|
||||
"mapping": "tool_choice",
|
||||
"description": "工具选择策略。"
|
||||
},
|
||||
{
|
||||
"name": "response_format",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "response_format/text",
|
||||
"description": "结构化输出配置。"
|
||||
},
|
||||
{
|
||||
"name": "stream",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"mapping": "stream",
|
||||
"description": "流式开关;后台任务当前以最终响应归一。"
|
||||
},
|
||||
{
|
||||
"name": "providerOptions",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "provider-specific fields",
|
||||
"description": "插件命名空间内的厂商扩展字段。"
|
||||
}
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/chat/completions",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"model": {
|
||||
"$ref": "request.model"
|
||||
},
|
||||
"messages": {
|
||||
"$ref": "request.messages"
|
||||
},
|
||||
"temperature": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.temperature"
|
||||
}
|
||||
},
|
||||
"top_p": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.top_p"
|
||||
}
|
||||
},
|
||||
"max_tokens": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.extra.max_tokens"
|
||||
},
|
||||
{
|
||||
"$ref": "request.providerOptions.antigravity-chat.max_tokens"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tools": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.tools"
|
||||
}
|
||||
},
|
||||
"tool_choice": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.tool_choice"
|
||||
}
|
||||
},
|
||||
"response_format": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.response_format"
|
||||
}
|
||||
},
|
||||
"stream": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.stream"
|
||||
}
|
||||
},
|
||||
"stop": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.stop"
|
||||
}
|
||||
},
|
||||
"seed": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.seed"
|
||||
}
|
||||
},
|
||||
"frequency_penalty": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.frequency_penalty"
|
||||
}
|
||||
},
|
||||
"presence_penalty": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.presence_penalty"
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.antigravity-chat.user"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": "succeeded",
|
||||
"textPaths": [
|
||||
"choices.0.message.content",
|
||||
"choices.0.text"
|
||||
],
|
||||
"reasoningPaths": [
|
||||
"choices.0.message.reasoning_content"
|
||||
],
|
||||
"usage": {
|
||||
"$ref": "response.usage"
|
||||
},
|
||||
"errorPaths": [
|
||||
"error.code"
|
||||
],
|
||||
"messagePaths": [
|
||||
"error.message"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>"
|
||||
}
|
||||
```
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_END -->
|
||||
224
plugin-packages/antigravity-proxy/manifest.json
Normal file
224
plugin-packages/antigravity-proxy/manifest.json
Normal file
File diff suppressed because one or more lines are too long
BIN
plugin-packages/image-tools.yingce-plugin
Normal file
BIN
plugin-packages/image-tools.yingce-plugin
Normal file
Binary file not shown.
10
plugin-packages/image-tools/README.md
Normal file
10
plugin-packages/image-tools/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Image Tools
|
||||
|
||||
影策图片工具协议插件,提供去背景和图层拆分两个异步能力。
|
||||
|
||||
## 能力
|
||||
|
||||
- `image-tools-remove-background`:`bria/remove-background`
|
||||
- `image-tools-layer-decomposition`:`bytedance/seedream-v5.0-pro/layer-decomposition`
|
||||
|
||||
两个 provider 都接受统一的 `images[]` 源图输入,结果 URL 会由宿主下载并持久化。
|
||||
303
plugin-packages/image-tools/docs/interface.md
Normal file
303
plugin-packages/image-tools/docs/interface.md
Normal file
@@ -0,0 +1,303 @@
|
||||
# Image Tools Interface
|
||||
|
||||
## Remove Background
|
||||
|
||||
- Provider: `image-tools-remove-background`
|
||||
- Upstream: `POST /bria/remove-background`
|
||||
- Input: first image in `images[]`
|
||||
- Output: asynchronous image result
|
||||
|
||||
## Layer Decomposition
|
||||
|
||||
- Provider: `image-tools-layer-decomposition`
|
||||
- Upstream: `POST /bytedance/seedream-v5.0-pro/layer-decomposition`
|
||||
- Input: first image in `images[]`
|
||||
- Output: asynchronous image result list
|
||||
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_START -->
|
||||
## Manifest 完整接口定义
|
||||
|
||||
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
|
||||
|
||||
```json
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "image-tools",
|
||||
"name": "Image Tools",
|
||||
"version": "1.0.0",
|
||||
"author": "影策",
|
||||
"description": "图片去背景与图层拆分工具协议插件。",
|
||||
"permissions": [
|
||||
"generation.run",
|
||||
"media.read"
|
||||
],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "apiKey",
|
||||
"type": "secret",
|
||||
"label": "WaveSpeed API Key",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>",
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "image-tools-remove-background",
|
||||
"label": "Image Tools Remove Background",
|
||||
"capabilities": [
|
||||
"image"
|
||||
],
|
||||
"scopes": [
|
||||
"admin.system-channel",
|
||||
"user.custom-channel",
|
||||
"canvas",
|
||||
"creation",
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "https://api.wavespeed.ai/api/v3",
|
||||
"requiresPublicMediaUrls": true,
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "model",
|
||||
"description": "默认 bria/remove-background。"
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "prompt",
|
||||
"description": "可选工具提示词。"
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "media[]",
|
||||
"required": true,
|
||||
"mapping": "source image",
|
||||
"description": "源图片。"
|
||||
},
|
||||
{
|
||||
"name": "providerOptions",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "provider-specific fields",
|
||||
"description": "工具扩展字段。"
|
||||
}
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/bria/remove-background",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"image": {
|
||||
"$first": {
|
||||
"$map": {
|
||||
"from": {
|
||||
"$ref": "request.images"
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"$ref": "media.value"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"prompt": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.prompt"
|
||||
}
|
||||
},
|
||||
"output_format": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.providerOptions.image-tools-remove-background.output_format"
|
||||
},
|
||||
"png"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"poll": {
|
||||
"method": "GET",
|
||||
"path": "/predictions/{{taskId}}/result"
|
||||
},
|
||||
"response": {
|
||||
"taskId": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.id"
|
||||
},
|
||||
{
|
||||
"$ref": "response.id"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.status"
|
||||
},
|
||||
{
|
||||
"$ref": "response.status"
|
||||
},
|
||||
"pending"
|
||||
]
|
||||
},
|
||||
"message": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.error"
|
||||
},
|
||||
{
|
||||
"$ref": "response.data.message"
|
||||
},
|
||||
{
|
||||
"$ref": "response.error.message"
|
||||
}
|
||||
]
|
||||
},
|
||||
"images": {
|
||||
"$ref": "response.data.outputs"
|
||||
},
|
||||
"errorPaths": [
|
||||
"error.code"
|
||||
],
|
||||
"resultEphemeral": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "image-tools-layer-decomposition",
|
||||
"label": "Image Tools Layer Decomposition",
|
||||
"capabilities": [
|
||||
"image"
|
||||
],
|
||||
"scopes": [
|
||||
"admin.system-channel",
|
||||
"user.custom-channel",
|
||||
"canvas",
|
||||
"creation",
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "https://api.wavespeed.ai/api/v3",
|
||||
"requiresPublicMediaUrls": true,
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "model",
|
||||
"description": "默认 bytedance/seedream-v5.0-pro/layer-decomposition。"
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "prompt",
|
||||
"description": "描述需要拆分的图层。"
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "media[]",
|
||||
"required": true,
|
||||
"mapping": "source image",
|
||||
"description": "源图片。"
|
||||
},
|
||||
{
|
||||
"name": "providerOptions",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "provider-specific fields",
|
||||
"description": "工具扩展字段。"
|
||||
}
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/bytedance/seedream-v5.0-pro/layer-decomposition",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"image": {
|
||||
"$first": {
|
||||
"$map": {
|
||||
"from": {
|
||||
"$ref": "request.images"
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"$ref": "media.value"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"prompt": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.prompt"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"poll": {
|
||||
"method": "GET",
|
||||
"path": "/predictions/{{taskId}}/result"
|
||||
},
|
||||
"response": {
|
||||
"taskId": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.id"
|
||||
},
|
||||
{
|
||||
"$ref": "response.id"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.status"
|
||||
},
|
||||
{
|
||||
"$ref": "response.status"
|
||||
},
|
||||
"pending"
|
||||
]
|
||||
},
|
||||
"message": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.error"
|
||||
},
|
||||
{
|
||||
"$ref": "response.data.message"
|
||||
},
|
||||
{
|
||||
"$ref": "response.error.message"
|
||||
}
|
||||
]
|
||||
},
|
||||
"images": {
|
||||
"$ref": "response.data.outputs"
|
||||
},
|
||||
"errorPaths": [
|
||||
"error.code"
|
||||
],
|
||||
"resultEphemeral": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_END -->
|
||||
279
plugin-packages/image-tools/manifest.json
Normal file
279
plugin-packages/image-tools/manifest.json
Normal file
File diff suppressed because one or more lines are too long
BIN
plugin-packages/lxmone-video-suite.yingce-plugin
Normal file
BIN
plugin-packages/lxmone-video-suite.yingce-plugin
Normal file
Binary file not shown.
27
plugin-packages/lxmone-video-suite/README.md
Normal file
27
plugin-packages/lxmone-video-suite/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# 万有引力视频套件(lxmone.xyz)
|
||||
|
||||
该目录是万有引力中转站(`https://lxmone.xyz/v1`)视频协议的官方声明式插件源码。
|
||||
后端从生成的 `lxmone-video-suite.yingce-plugin` 包加载,不依赖系统内置 `host:` 适配器。
|
||||
|
||||
协议按中转站公开接口文档 `https://lxmone.xyz/docs/` 的 `/v1/videos` 与 `/v1/videos/generations`
|
||||
两套请求体形状编写,拆成 8 个 provider,覆盖该站点当前开放的全部视频模型:
|
||||
|
||||
| Provider ID | 覆盖模型 | 创建接口 |
|
||||
| --- | --- | --- |
|
||||
| `lxmone-wan-videos` | `wan3.0-video`、`wan3.0-video-prime` | `POST /v1/videos` |
|
||||
| `lxmone-wan-channel-s` | `wan3.0-video-s`、`wan3.0-video-prime-s` | `POST /v1/videos` |
|
||||
| `lxmone-seedance-videos` | `seedance-2-pro/fast/mini`、`seedance-2.5-pro`、`seedance2.0-a`~`seedance2.0-f`、`seedance2.5-a` | `POST /v1/videos` |
|
||||
| `lxmone-h3-max-videos` | `minimax-h3-max` | `POST /v1/videos` |
|
||||
| `lxmone-sd-videos` | `sd-2.0-a`、`sd-2.0-b`、`sd-2.0-c`、`sd-2.5-a`、`sd-2.5` | `POST /v1/videos` |
|
||||
| `lxmone-sd-mini-videos` | `sd-mini` | `POST /v1/videos` |
|
||||
| `lxmone-grok-videos` | `grok-imagine-video`、`grok-imagine-video-1.5`、`grok-imagine-video-1.5S` | `POST /v1/videos/generations` |
|
||||
| `lxmone-h3-workflow` | `minimax-h3-a`~`minimax-h3-e` | `POST /v1/videos/generations` |
|
||||
|
||||
完整字段、请求模板与响应映射见 [docs/interface.md](docs/interface.md)。
|
||||
|
||||
## 构建
|
||||
|
||||
```sh
|
||||
node plugin-packages/embed-documentation.mjs lxmone-video-suite
|
||||
sh plugin-packages/build-packages.sh
|
||||
```
|
||||
2391
plugin-packages/lxmone-video-suite/docs/interface.md
Normal file
2391
plugin-packages/lxmone-video-suite/docs/interface.md
Normal file
File diff suppressed because it is too large
Load Diff
2289
plugin-packages/lxmone-video-suite/manifest.json
Normal file
2289
plugin-packages/lxmone-video-suite/manifest.json
Normal file
File diff suppressed because one or more lines are too long
BIN
plugin-packages/metaso-h3.yingce-plugin
Normal file
BIN
plugin-packages/metaso-h3.yingce-plugin
Normal file
Binary file not shown.
22
plugin-packages/metaso-h3/README.md
Normal file
22
plugin-packages/metaso-h3/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# METASO MiniMax H3
|
||||
|
||||
秘塔 METASO MiniMax H3 文生视频 / 图生视频协议插件(异步任务模式)。
|
||||
|
||||
## Provider
|
||||
|
||||
| Provider | 能力 | 端点 |
|
||||
|---|---|---|
|
||||
| metaso-h3 | video | POST /api/minimax/v2/video_generation(创建)<br>GET /api/minimax/v2/query/video_generation/{taskId}(轮询) |
|
||||
|
||||
## 配置
|
||||
|
||||
在渠道中填写 API Key(METASO 控制台创建,形如 `mk-xxxxxxxx`),baseUrl 使用 `https://metaso.cn`。
|
||||
|
||||
## 说明
|
||||
|
||||
- 模型:`MiniMax-H3`(支持 768P / 2K,4-15 秒,文生图/图生视频/多模态参考),`MiniMax-H3-Max`(480P / 768P,5-15 秒)。
|
||||
- 文生视频:仅文本提示词,ratio 必填(21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16)。
|
||||
- 图生视频:图片 role 为 first_frame / last_frame(首尾帧)。
|
||||
- 多模态参考:图片 reference_image / 视频 reference_video / 音频 reference_audio。
|
||||
- 异步任务:创建后返回 task_id,轮询查询接口直到 status=succeeded,成片 URL 在 task.content.url。
|
||||
- 鉴权:`Authorization: Bearer mk-xxx`。
|
||||
437
plugin-packages/metaso-h3/docs/interface.md
Normal file
437
plugin-packages/metaso-h3/docs/interface.md
Normal file
@@ -0,0 +1,437 @@
|
||||
# METASO MiniMax H3 接口说明
|
||||
|
||||
## 鉴权
|
||||
|
||||
`Authorization: Bearer mk-xxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## 创建视频生成任务
|
||||
|
||||
POST `https://metaso.cn/api/minimax/v2/video_generation`
|
||||
|
||||
请求体:
|
||||
|
||||
```json
|
||||
{
|
||||
"model": "MiniMax-H3",
|
||||
"content": [
|
||||
{ "type": "text", "text": "视频描述" },
|
||||
{ "type": "image_url", "image_url": { "url": "https://..." }, "role": "first_frame" },
|
||||
{ "type": "video_url", "video_url": { "url": "https://..." }, "role": "reference_video" },
|
||||
{ "type": "audio_url", "audio_url": { "url": "https://..." }, "role": "reference_audio" }
|
||||
],
|
||||
"resolution": "768P",
|
||||
"duration": 5,
|
||||
"ratio": "16:9"
|
||||
}
|
||||
```
|
||||
|
||||
- content 必须包含一个非空 text 项。
|
||||
- 首尾帧(first_frame/last_frame)与多模态参考(reference_*)互斥。
|
||||
- 图片 ≤ 9 张、视频 ≤ 3 段、音频 ≤ 3 段;请求体总大小 ≤ 64 MB。
|
||||
|
||||
响应:
|
||||
|
||||
```json
|
||||
{ "task_id": "424010985738629" }
|
||||
```
|
||||
|
||||
## 查询任务
|
||||
|
||||
GET `https://metaso.cn/api/minimax/v2/query/video_generation/{task_id}`
|
||||
|
||||
响应:
|
||||
|
||||
```json
|
||||
{
|
||||
"task": {
|
||||
"id": "424010985738629",
|
||||
"status": "succeeded",
|
||||
"content": { "url": "https://.../output.mp4" },
|
||||
"resolution": "2K",
|
||||
"duration": 5,
|
||||
"usage": { "total_seconds": 5, "output_seconds": 5 }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
status 取值:queued / running / succeeded / failed / cancelled。
|
||||
|
||||
## 错误
|
||||
|
||||
创建与查询均返回 OpenAI 风格错误体,含 `error.type` / `error.message` / `request_id`;余额不足为 402,速率限制为 429。
|
||||
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_START -->
|
||||
## Manifest 完整接口定义
|
||||
|
||||
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
|
||||
|
||||
```json
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "metaso-h3",
|
||||
"name": "METASO MiniMax H3",
|
||||
"version": "1.0.0",
|
||||
"author": "METASO",
|
||||
"description": "秘塔 METASO MiniMax H3 文生视频/图生视频协议插件(异步任务)。",
|
||||
"permissions": [
|
||||
"generation.run",
|
||||
"media.read"
|
||||
],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "apiKey",
|
||||
"type": "secret",
|
||||
"label": "API Key",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "metaso-h3",
|
||||
"label": "METASO MiniMax H3",
|
||||
"capabilities": [
|
||||
"video"
|
||||
],
|
||||
"scopes": [
|
||||
"admin.system-channel",
|
||||
"user.custom-channel",
|
||||
"canvas",
|
||||
"creation",
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "https://metaso.cn",
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
},
|
||||
"requiresPublicMediaUrls": true,
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "model",
|
||||
"description": "视频模型 ID(MiniMax-H3 / MiniMax-H3-Max)。"
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "prompt/content/input",
|
||||
"description": "视频提示词。"
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "media[]",
|
||||
"required": false,
|
||||
"mapping": "first/last/reference image",
|
||||
"description": "显式 role 图片输入(首帧/尾帧/参考图)。"
|
||||
},
|
||||
{
|
||||
"name": "videos",
|
||||
"type": "media[]",
|
||||
"required": false,
|
||||
"mapping": "reference video",
|
||||
"description": "参考视频。"
|
||||
},
|
||||
{
|
||||
"name": "audios",
|
||||
"type": "media[]",
|
||||
"required": false,
|
||||
"mapping": "reference audio/voice",
|
||||
"description": "参考音频或音色。"
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"type": "integer",
|
||||
"required": false,
|
||||
"mapping": "duration/seconds",
|
||||
"description": "时长秒数(4-15)。"
|
||||
},
|
||||
{
|
||||
"name": "aspectRatio",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "ratio/aspect_ratio/size",
|
||||
"description": "画幅比例(16:9 等)。"
|
||||
},
|
||||
{
|
||||
"name": "resolution",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "resolution",
|
||||
"description": "分辨率档位(768P / 2K)。"
|
||||
},
|
||||
{
|
||||
"name": "watermark",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"mapping": "watermark",
|
||||
"description": "AIGC 水印开关。"
|
||||
},
|
||||
{
|
||||
"name": "providerOptions",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "provider-specific fields",
|
||||
"description": "插件命名空间内的厂商扩展字段。"
|
||||
}
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/api/minimax/v2/video_generation",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"model": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.model"
|
||||
},
|
||||
"MiniMax-H3"
|
||||
]
|
||||
},
|
||||
"content": {
|
||||
"$concatArrays": [
|
||||
{
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$gt": [
|
||||
{
|
||||
"$len": {
|
||||
"$ref": "request.prompt"
|
||||
}
|
||||
},
|
||||
0
|
||||
]
|
||||
},
|
||||
"then": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"$ref": "request.prompt"
|
||||
}
|
||||
}
|
||||
],
|
||||
"else": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"$map": {
|
||||
"from": {
|
||||
"$ref": "request.images"
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "media.url"
|
||||
},
|
||||
{
|
||||
"$ref": "media.dataUrl"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"role": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "media.role"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$map": {
|
||||
"from": {
|
||||
"$ref": "request.videos"
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"type": "video_url",
|
||||
"video_url": {
|
||||
"url": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "media.url"
|
||||
},
|
||||
{
|
||||
"$ref": "media.dataUrl"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"role": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "media.role"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$map": {
|
||||
"from": {
|
||||
"$ref": "request.audios"
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"type": "audio_url",
|
||||
"audio_url": {
|
||||
"url": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "media.url"
|
||||
},
|
||||
{
|
||||
"$ref": "media.dataUrl"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"role": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "media.role"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"resolution": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.resolution"
|
||||
},
|
||||
{
|
||||
"$ref": "request.providerOptions.metaso-h3.resolution"
|
||||
},
|
||||
"768P"
|
||||
]
|
||||
}
|
||||
},
|
||||
"duration": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.duration"
|
||||
},
|
||||
{
|
||||
"$ref": "request.providerOptions.metaso-h3.duration"
|
||||
},
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
"ratio": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.aspectRatio"
|
||||
},
|
||||
{
|
||||
"$ref": "request.providerOptions.metaso-h3.ratio"
|
||||
},
|
||||
"16:9"
|
||||
]
|
||||
}
|
||||
},
|
||||
"aigc_watermark": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.metaso-h3.aigc_watermark"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"poll": {
|
||||
"method": "GET",
|
||||
"path": "/api/minimax/v2/query/video_generation/{{taskId}}"
|
||||
},
|
||||
"response": {
|
||||
"taskId": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.task_id"
|
||||
},
|
||||
{
|
||||
"$ref": "response.taskId"
|
||||
},
|
||||
{
|
||||
"$ref": "response.data.task_id"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.task.status"
|
||||
},
|
||||
{
|
||||
"$ref": "response.status"
|
||||
},
|
||||
{
|
||||
"$ref": "response.data.status"
|
||||
},
|
||||
"pending"
|
||||
]
|
||||
},
|
||||
"message": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.task.error.message"
|
||||
},
|
||||
{
|
||||
"$ref": "response.task.fail_reason"
|
||||
},
|
||||
{
|
||||
"$ref": "response.error.message"
|
||||
},
|
||||
{
|
||||
"$ref": "response.message"
|
||||
}
|
||||
]
|
||||
},
|
||||
"videos": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.task.content.url"
|
||||
},
|
||||
{
|
||||
"$ref": "response.task.content.video_url"
|
||||
},
|
||||
{
|
||||
"$ref": "response.content.url"
|
||||
},
|
||||
{
|
||||
"$ref": "response.data.url"
|
||||
}
|
||||
]
|
||||
},
|
||||
"usage": {
|
||||
"$ref": "response.task.usage"
|
||||
},
|
||||
"errorPaths": [
|
||||
"task.error.type",
|
||||
"error.type",
|
||||
"error.code"
|
||||
],
|
||||
"resultEphemeral": true,
|
||||
"messagePaths": [
|
||||
"task.error.message",
|
||||
"error.message"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>"
|
||||
}
|
||||
```
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_END -->
|
||||
367
plugin-packages/metaso-h3/manifest.json
Normal file
367
plugin-packages/metaso-h3/manifest.json
Normal file
File diff suppressed because one or more lines are too long
34
plugin-packages/package-selected.ps1
Normal file
34
plugin-packages/package-selected.ps1
Normal file
@@ -0,0 +1,34 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
|
||||
$root = Split-Path -Parent $PSCommandPath
|
||||
$ids = if ($args.Count -gt 0) { $args } else { throw 'Pass one or more plugin directory names.' }
|
||||
|
||||
foreach ($id in $ids) {
|
||||
$source = Join-Path $root $id
|
||||
$output = Join-Path $root ($id + '.yingce-plugin')
|
||||
$temporary = Join-Path $root ('.' + $id + '.yingce-plugin.tmp')
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $source 'manifest.json'))) {
|
||||
throw "Missing manifest.json for $id"
|
||||
}
|
||||
if (Test-Path -LiteralPath $temporary) { Remove-Item -LiteralPath $temporary -Force }
|
||||
|
||||
$archive = [System.IO.Compression.ZipFile]::Open($temporary, [System.IO.Compression.ZipArchiveMode]::Create)
|
||||
try {
|
||||
Get-ChildItem -LiteralPath $source -Recurse -File | Where-Object {
|
||||
$_.Name -in @('manifest.json', 'README.md', 'LICENSE') -or
|
||||
$_.FullName -match '\\(docs|assets|web|backend)\\'
|
||||
} | ForEach-Object {
|
||||
$entryName = $_.FullName.Substring($source.Length + 1).Replace('\', '/')
|
||||
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile(
|
||||
$archive, $_.FullName, $entryName, [System.IO.Compression.CompressionLevel]::Optimal
|
||||
) | Out-Null
|
||||
}
|
||||
} finally {
|
||||
$archive.Dispose()
|
||||
}
|
||||
Move-Item -LiteralPath $temporary -Destination $output -Force
|
||||
Write-Output "$id -> $output"
|
||||
}
|
||||
20
plugin-packages/src-a6api/README.md
Normal file
20
plugin-packages/src-a6api/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# A6api
|
||||
|
||||
A6api 模型网关协议插件。统一入口 `https://api.a6api.com`,OpenAI 兼容(`Authorization: Bearer <api_key>`)。
|
||||
|
||||
## Providers
|
||||
|
||||
| Provider | 能力 | 端点 |
|
||||
|---|---|---|
|
||||
| a6api-chat | text | POST /chat/completions |
|
||||
| a6api-image | image | POST /images/generations、POST /images/edits |
|
||||
|
||||
## 配置
|
||||
|
||||
在渠道中填写 API Key(A6api 控制台创建,形如 `sk-xxxxxxxx`),baseUrl 使用 `https://api.a6api.com`。
|
||||
|
||||
## 说明
|
||||
|
||||
- 模型名以 A6api 模型市场当前列表为准。
|
||||
- 图像编辑(带参考图)走 `/images/edits` multipart 请求。
|
||||
- 错误体为 OpenAI 风格,携带 `request_id`。
|
||||
29
plugin-packages/src-a6api/docs/interface.md
Normal file
29
plugin-packages/src-a6api/docs/interface.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# A6api 接口说明
|
||||
|
||||
## 鉴权
|
||||
|
||||
`Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## 文本对话
|
||||
|
||||
POST `https://api.a6api.com/chat/completions`
|
||||
|
||||
请求体 OpenAI Chat Completions 格式:`model`、`messages`、`temperature`、`max_tokens`、`tools`、`tool_choice`、`response_format`、`stream` 等。
|
||||
|
||||
响应 `choices[0].message.content` 为正文,`choices[0].message.reasoning_content` 为推理内容,`usage` 为用量。
|
||||
|
||||
## 图像生成
|
||||
|
||||
POST `https://api.a6api.com/images/generations`
|
||||
|
||||
请求体:`model`、`prompt`、`n`、`size`、`quality`、`response_format`。
|
||||
|
||||
响应 `data[].url` 或 `data[].b64_json`。
|
||||
|
||||
## 图像编辑
|
||||
|
||||
POST `https://api.a6api.com/images/edits`(multipart,带参考图时使用)
|
||||
|
||||
## 模型列表
|
||||
|
||||
GET `https://api.a6api.com/models`
|
||||
143
plugin-packages/src-a6api/manifest.json
Normal file
143
plugin-packages/src-a6api/manifest.json
Normal file
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "a6api",
|
||||
"name": "A6api",
|
||||
"version": "1.0.0",
|
||||
"author": "A6api",
|
||||
"description": "A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。",
|
||||
"permissions": ["generation.run", "media.read"],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{ "name": "apiKey", "type": "secret", "label": "API Key", "required": true }
|
||||
]
|
||||
},
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "a6api-chat",
|
||||
"label": "A6api Chat",
|
||||
"capabilities": ["text"],
|
||||
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
|
||||
"baseUrl": "https://api.a6api.com",
|
||||
"auth": { "type": "bearer", "field": "apiKey" },
|
||||
"parameters": [
|
||||
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "A6api 模型市场中的模型 ID。" },
|
||||
{ "name": "messages", "type": "message[]", "required": true, "mapping": "provider message container", "description": "包含历史消息和当前用户输入。" },
|
||||
{ "name": "instructions", "type": "string", "required": false, "mapping": "system/instructions", "description": "系统指令。" },
|
||||
{ "name": "temperature", "type": "number", "required": false, "mapping": "temperature", "description": "采样温度。" },
|
||||
{ "name": "top_p", "type": "number", "required": false, "mapping": "top_p", "description": "核采样参数。" },
|
||||
{ "name": "max_tokens", "type": "integer", "required": false, "mapping": "max_tokens/max_output_tokens", "description": "最大输出 token。" },
|
||||
{ "name": "tools", "type": "array", "required": false, "mapping": "tools/toolConfig", "description": "工具定义。" },
|
||||
{ "name": "tool_choice", "type": "object|string", "required": false, "mapping": "tool_choice", "description": "工具选择策略。" },
|
||||
{ "name": "response_format", "type": "object", "required": false, "mapping": "response_format/text", "description": "结构化输出配置。" },
|
||||
{ "name": "stream", "type": "boolean", "required": false, "mapping": "stream", "description": "流式开关;后台任务当前以最终响应归一。" },
|
||||
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/chat/completions",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"model": { "$ref": "request.model" },
|
||||
"messages": { "$ref": "request.messages" },
|
||||
"temperature": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.temperature" } },
|
||||
"top_p": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.top_p" } },
|
||||
"max_tokens": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.extra.max_tokens" }, { "$ref": "request.providerOptions.a6api-chat.max_tokens" } ] } },
|
||||
"tools": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.tools" } },
|
||||
"tool_choice": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.tool_choice" } },
|
||||
"response_format": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.response_format" } },
|
||||
"stream": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.stream" } },
|
||||
"stop": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.stop" } },
|
||||
"seed": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.seed" } },
|
||||
"frequency_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.frequency_penalty" } },
|
||||
"presence_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.presence_penalty" } },
|
||||
"user": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.user" } }
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": "succeeded",
|
||||
"textPaths": ["choices.0.message.content", "choices.0.text"],
|
||||
"reasoningPaths": ["choices.0.message.reasoning_content"],
|
||||
"usage": { "$ref": "response.usage" },
|
||||
"errorPaths": ["error.code"],
|
||||
"messagePaths": ["error.message"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "a6api-image",
|
||||
"label": "A6api Image",
|
||||
"capabilities": ["image"],
|
||||
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
|
||||
"baseUrl": "https://api.a6api.com",
|
||||
"auth": { "type": "bearer", "field": "apiKey" },
|
||||
"parameters": [
|
||||
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "A6api 模型市场中的图像模型 ID。" },
|
||||
{ "name": "prompt", "type": "string", "required": true, "mapping": "prompt", "description": "图片提示词。" },
|
||||
{ "name": "images", "type": "media[]", "required": false, "mapping": "provider image/reference fields", "description": "参考图或编辑源图,role 由业务层确定。" },
|
||||
{ "name": "imageCount", "type": "integer", "required": false, "mapping": "n/sample_count", "description": "输出数量。" },
|
||||
{ "name": "aspectRatio", "type": "string", "required": false, "mapping": "size/aspect_ratio", "description": "比例或尺寸,语义按协议说明。" },
|
||||
{ "name": "resolution", "type": "string", "required": false, "mapping": "resolution/imageSize", "description": "分辨率档位。" },
|
||||
{ "name": "quality", "type": "string", "required": false, "mapping": "quality", "description": "质量档位。" },
|
||||
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/images/generations",
|
||||
"pathTemplate": {
|
||||
"$if": {
|
||||
"condition": { "$gt": [ { "$len": { "$ref": "request.images" } }, 0 ] },
|
||||
"then": "/images/edits",
|
||||
"else": "/images/generations"
|
||||
}
|
||||
},
|
||||
"contentType": "application/json",
|
||||
"contentTypeTemplate": {
|
||||
"$if": {
|
||||
"condition": { "$gt": [ { "$len": { "$ref": "request.images" } }, 0 ] },
|
||||
"then": "multipart/form-data",
|
||||
"else": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"model": { "$ref": "request.model" },
|
||||
"prompt": { "$ref": "request.prompt" },
|
||||
"n": { "$omitEmpty": { "$if": { "condition": { "$gt": [ { "$ref": "request.imageCount" }, 0 ] }, "then": { "$ref": "request.imageCount" }, "else": 1 } } },
|
||||
"size": { "$omitEmpty": { "$ref": "request.aspectRatio" } },
|
||||
"quality": { "$omitEmpty": { "$ref": "request.quality" } },
|
||||
"output_format": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.providerOptions.a6api-image.output_format" }, "png" ] } },
|
||||
"response_format": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.providerOptions.a6api-image.response_format" }, "b64_json" ] } },
|
||||
"user": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-image.user" } }
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"name": "image",
|
||||
"source": { "$filter": { "from": { "$ref": "request.images" }, "as": "media", "where": { "$ne": [ { "$ref": "media.role" }, "mask" ] } } },
|
||||
"filename": "source.png"
|
||||
},
|
||||
{
|
||||
"name": "mask",
|
||||
"source": { "$filter": { "from": { "$ref": "request.images" }, "as": "media", "where": { "$eq": [ { "$ref": "media.role" }, "mask" ] } } },
|
||||
"filename": "mask.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"status": "succeeded",
|
||||
"images": {
|
||||
"$map": {
|
||||
"from": { "$ref": "response.data" },
|
||||
"as": "item",
|
||||
"in": {
|
||||
"url": { "$omitEmpty": { "$ref": "item.url" } },
|
||||
"dataUrl": { "$if": { "condition": { "$ref": "item.b64_json" }, "then": { "$concat": [ "data:image/png;base64,", { "$ref": "item.b64_json" } ] }, "else": null } }
|
||||
}
|
||||
}
|
||||
},
|
||||
"usage": { "$ref": "response.usage" },
|
||||
"errorPaths": ["error.code"],
|
||||
"messagePaths": ["error.message"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
41
plugin-packages/src-antigravity-proxy/README.md
Normal file
41
plugin-packages/src-antigravity-proxy/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Antigravity Proxy
|
||||
|
||||
Antigravity 中转渠道插件:OpenAI Chat Completions 兼容对话协议。
|
||||
|
||||
## 协议身份
|
||||
|
||||
- 插件 ID:`antigravity-proxy`
|
||||
- Provider ID:`antigravity-chat`
|
||||
- 能力:`text`
|
||||
- 默认 Base URL:`http://103.242.14.110:8317`
|
||||
- 鉴权驱动:`bearer`
|
||||
- 创建:`POST /chat/completions`
|
||||
- 生命周期:同步响应
|
||||
|
||||
## 配置字段
|
||||
|
||||
| 字段 | 类型 | 必填 | 含义 |
|
||||
| --- | --- | --- | --- |
|
||||
| `apiKey` | secret | 是 | 中转渠道 API Key |
|
||||
|
||||
## 模型
|
||||
|
||||
- `gemini-3.8-flash-high`
|
||||
- `gemini-pro-agent`
|
||||
|
||||
## 统一字段映射
|
||||
|
||||
| 统一字段 | 类型 | 必填 | 上游映射 |
|
||||
| --- | --- | --- | --- |
|
||||
| `model` | string | 是 | `model` |
|
||||
| `messages` | message[] | 是 | `messages` |
|
||||
| `instructions` | string | 否 | `system/instructions` |
|
||||
| `temperature` | number | 否 | `temperature` |
|
||||
| `top_p` | number | 否 | `top_p` |
|
||||
| `max_tokens` | integer | 否 | `max_tokens` |
|
||||
| `tools` | array | 否 | `tools` |
|
||||
| `tool_choice` | object\|string | 否 | `tool_choice` |
|
||||
| `response_format` | object | 否 | `response_format` |
|
||||
| `stream` | boolean | 否 | `stream` |
|
||||
|
||||
完整接口见 [docs/interface.md](docs/interface.md)。
|
||||
70
plugin-packages/src-antigravity-proxy/docs/interface.md
Normal file
70
plugin-packages/src-antigravity-proxy/docs/interface.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Antigravity Proxy 接口字段
|
||||
|
||||
## 协议身份
|
||||
|
||||
- 插件 ID:`antigravity-proxy`
|
||||
- Provider ID:`antigravity-chat`
|
||||
- 能力:`text`
|
||||
- 默认 Base URL:`http://103.242.14.110:8317`
|
||||
- 鉴权驱动:`bearer`
|
||||
- 创建:`POST /chat/completions`
|
||||
- 生命周期:同步响应
|
||||
|
||||
## 配置字段
|
||||
|
||||
| 字段 | 类型 | 必填 | 含义 |
|
||||
| --- | --- | --- | --- |
|
||||
| `apiKey` | secret | 是 | 中转渠道 API Key |
|
||||
|
||||
## 统一字段映射
|
||||
|
||||
| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `model` | string | 是 | `model` | 上游模型 ID。 |
|
||||
| `messages` | message[] | 是 | `messages` | 包含历史消息和当前用户输入。 |
|
||||
| `instructions` | string | 否 | `system/instructions` | 系统指令。 |
|
||||
| `temperature` | number | 否 | `temperature` | 采样温度。 |
|
||||
| `top_p` | number | 否 | `top_p` | 核采样参数。 |
|
||||
| `max_tokens` | integer | 否 | `max_tokens/max_output_tokens` | 最大输出 token。 |
|
||||
| `tools` | array | 否 | `tools/toolConfig` | 工具定义。 |
|
||||
| `tool_choice` | object\|string | 否 | `tool_choice` | 工具选择策略。 |
|
||||
| `response_format` | object | 否 | `response_format/text` | 结构化输出配置。 |
|
||||
| `stream` | boolean | 否 | `stream` | 流式开关。 |
|
||||
|
||||
## 上游请求模板
|
||||
|
||||
| 上游位置 | 值或转换表达式 |
|
||||
| --- | --- |
|
||||
| `create.method` | `"POST"` |
|
||||
| `create.path` | `"/chat/completions"` |
|
||||
| `create.contentType` | `"application/json"` |
|
||||
| `create.body.model` | `{"$ref":"request.model"}` |
|
||||
| `create.body.messages` | `{"$ref":"request.messages"}` |
|
||||
| `create.body.temperature` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.temperature"}}` |
|
||||
| `create.body.top_p` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.top_p"}}` |
|
||||
| `create.body.max_tokens` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.extra.max_tokens"},{"$ref":"request.providerOptions.antigravity-chat.max_tokens"}]}}` |
|
||||
| `create.body.tools` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tools"}}` |
|
||||
| `create.body.tool_choice` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tool_choice"}}` |
|
||||
| `create.body.response_format` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.response_format"}}` |
|
||||
| `create.body.stream` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stream"}}` |
|
||||
| `create.body.stop` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stop"}}` |
|
||||
| `create.body.seed` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.seed"}}` |
|
||||
| `create.body.frequency_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.frequency_penalty"}}` |
|
||||
| `create.body.presence_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.presence_penalty"}}` |
|
||||
| `create.body.user` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.user"}}` |
|
||||
|
||||
## 响应映射
|
||||
|
||||
| 映射位置 | 上游路径或转换表达式 |
|
||||
| --- | --- |
|
||||
| `response.status` | `"succeeded"` |
|
||||
| `response.textPaths[0]` | `"choices.0.message.content"` |
|
||||
| `response.textPaths[1]` | `"choices.0.text"` |
|
||||
| `response.reasoningPaths[0]` | `"choices.0.message.reasoning_content"` |
|
||||
| `response.usage` | `{"$ref":"response.usage"}` |
|
||||
| `response.errorPaths[0]` | `"error.code"` |
|
||||
| `response.messagePaths[0]` | `"error.message"` |
|
||||
|
||||
## 兼容边界
|
||||
|
||||
该包只代表 Antigravity 中转渠道的 OpenAI Chat Completions 线协议;其他端点或网关包装必须使用独立插件。
|
||||
68
plugin-packages/src-antigravity-proxy/manifest.json
Normal file
68
plugin-packages/src-antigravity-proxy/manifest.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "antigravity-proxy",
|
||||
"name": "Antigravity Proxy",
|
||||
"version": "1.0.0",
|
||||
"author": "Yingce",
|
||||
"description": "Antigravity 中转渠道插件:OpenAI 兼容对话(gemini-3.8-flash-high / gemini-pro-agent)。",
|
||||
"permissions": ["generation.run", "media.read"],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{ "name": "apiKey", "type": "secret", "label": "API Key", "required": true }
|
||||
]
|
||||
},
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "antigravity-chat",
|
||||
"label": "Antigravity Chat",
|
||||
"capabilities": ["text"],
|
||||
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
|
||||
"baseUrl": "http://103.242.14.110:8317",
|
||||
"auth": { "type": "bearer", "field": "apiKey" },
|
||||
"parameters": [
|
||||
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "模型 ID(gemini-3.8-flash-high / gemini-pro-agent)。" },
|
||||
{ "name": "messages", "type": "message[]", "required": true, "mapping": "provider message container", "description": "包含历史消息和当前用户输入。" },
|
||||
{ "name": "instructions", "type": "string", "required": false, "mapping": "system/instructions", "description": "系统指令。" },
|
||||
{ "name": "temperature", "type": "number", "required": false, "mapping": "temperature", "description": "采样温度。" },
|
||||
{ "name": "top_p", "type": "number", "required": false, "mapping": "top_p", "description": "核采样参数。" },
|
||||
{ "name": "max_tokens", "type": "integer", "required": false, "mapping": "max_tokens/max_output_tokens", "description": "最大输出 token。" },
|
||||
{ "name": "tools", "type": "array", "required": false, "mapping": "tools/toolConfig", "description": "工具定义。" },
|
||||
{ "name": "tool_choice", "type": "object|string", "required": false, "mapping": "tool_choice", "description": "工具选择策略。" },
|
||||
{ "name": "response_format", "type": "object", "required": false, "mapping": "response_format/text", "description": "结构化输出配置。" },
|
||||
{ "name": "stream", "type": "boolean", "required": false, "mapping": "stream", "description": "流式开关;后台任务当前以最终响应归一。" },
|
||||
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/chat/completions",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"model": { "$ref": "request.model" },
|
||||
"messages": { "$ref": "request.messages" },
|
||||
"temperature": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.temperature" } },
|
||||
"top_p": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.top_p" } },
|
||||
"max_tokens": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.extra.max_tokens" }, { "$ref": "request.providerOptions.antigravity-chat.max_tokens" } ] } },
|
||||
"tools": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.tools" } },
|
||||
"tool_choice": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.tool_choice" } },
|
||||
"response_format": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.response_format" } },
|
||||
"stream": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.stream" } },
|
||||
"stop": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.stop" } },
|
||||
"seed": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.seed" } },
|
||||
"frequency_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.frequency_penalty" } },
|
||||
"presence_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.presence_penalty" } },
|
||||
"user": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.user" } }
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": "succeeded",
|
||||
"textPaths": ["choices.0.message.content", "choices.0.text"],
|
||||
"reasoningPaths": ["choices.0.message.reasoning_content"],
|
||||
"usage": { "$ref": "response.usage" },
|
||||
"errorPaths": ["error.code"],
|
||||
"messagePaths": ["error.message"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
22
plugin-packages/src-metaso-h3/README.md
Normal file
22
plugin-packages/src-metaso-h3/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# METASO MiniMax H3
|
||||
|
||||
秘塔 METASO MiniMax H3 文生视频 / 图生视频协议插件(异步任务模式)。
|
||||
|
||||
## Provider
|
||||
|
||||
| Provider | 能力 | 端点 |
|
||||
|---|---|---|
|
||||
| metaso-h3 | video | POST /api/minimax/v2/video_generation(创建)<br>GET /api/minimax/v2/query/video_generation/{taskId}(轮询) |
|
||||
|
||||
## 配置
|
||||
|
||||
在渠道中填写 API Key(METASO 控制台创建,形如 `mk-xxxxxxxx`),baseUrl 使用 `https://metaso.cn`。
|
||||
|
||||
## 说明
|
||||
|
||||
- 模型:`MiniMax-H3`(支持 768P / 2K,4-15 秒,文生图/图生视频/多模态参考),`MiniMax-H3-Max`(480P / 768P,5-15 秒)。
|
||||
- 文生视频:仅文本提示词,ratio 必填(21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16)。
|
||||
- 图生视频:图片 role 为 first_frame / last_frame(首尾帧)。
|
||||
- 多模态参考:图片 reference_image / 视频 reference_video / 音频 reference_audio。
|
||||
- 异步任务:创建后返回 task_id,轮询查询接口直到 status=succeeded,成片 URL 在 task.content.url。
|
||||
- 鉴权:`Authorization: Bearer mk-xxx`。
|
||||
61
plugin-packages/src-metaso-h3/docs/interface.md
Normal file
61
plugin-packages/src-metaso-h3/docs/interface.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# METASO MiniMax H3 接口说明
|
||||
|
||||
## 鉴权
|
||||
|
||||
`Authorization: Bearer mk-xxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## 创建视频生成任务
|
||||
|
||||
POST `https://metaso.cn/api/minimax/v2/video_generation`
|
||||
|
||||
请求体:
|
||||
|
||||
```json
|
||||
{
|
||||
"model": "MiniMax-H3",
|
||||
"content": [
|
||||
{ "type": "text", "text": "视频描述" },
|
||||
{ "type": "image_url", "image_url": { "url": "https://..." }, "role": "first_frame" },
|
||||
{ "type": "video_url", "video_url": { "url": "https://..." }, "role": "reference_video" },
|
||||
{ "type": "audio_url", "audio_url": { "url": "https://..." }, "role": "reference_audio" }
|
||||
],
|
||||
"resolution": "768P",
|
||||
"duration": 5,
|
||||
"ratio": "16:9"
|
||||
}
|
||||
```
|
||||
|
||||
- content 必须包含一个非空 text 项。
|
||||
- 首尾帧(first_frame/last_frame)与多模态参考(reference_*)互斥。
|
||||
- 图片 ≤ 9 张、视频 ≤ 3 段、音频 ≤ 3 段;请求体总大小 ≤ 64 MB。
|
||||
|
||||
响应:
|
||||
|
||||
```json
|
||||
{ "task_id": "424010985738629" }
|
||||
```
|
||||
|
||||
## 查询任务
|
||||
|
||||
GET `https://metaso.cn/api/minimax/v2/query/video_generation/{task_id}`
|
||||
|
||||
响应:
|
||||
|
||||
```json
|
||||
{
|
||||
"task": {
|
||||
"id": "424010985738629",
|
||||
"status": "succeeded",
|
||||
"content": { "url": "https://.../output.mp4" },
|
||||
"resolution": "2K",
|
||||
"duration": 5,
|
||||
"usage": { "total_seconds": 5, "output_seconds": 5 }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
status 取值:queued / running / succeeded / failed / cancelled。
|
||||
|
||||
## 错误
|
||||
|
||||
创建与查询均返回 OpenAI 风格错误体,含 `error.type` / `error.message` / `request_id`;余额不足为 402,速率限制为 429。
|
||||
100
plugin-packages/src-metaso-h3/manifest.json
Normal file
100
plugin-packages/src-metaso-h3/manifest.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "metaso-h3",
|
||||
"name": "METASO MiniMax H3",
|
||||
"version": "1.0.0",
|
||||
"author": "METASO",
|
||||
"description": "秘塔 METASO MiniMax H3 文生视频/图生视频协议插件(异步任务)。",
|
||||
"permissions": ["generation.run", "media.read"],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{ "name": "apiKey", "type": "secret", "label": "API Key", "required": true }
|
||||
]
|
||||
},
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "metaso-h3",
|
||||
"label": "METASO MiniMax H3",
|
||||
"capabilities": ["video"],
|
||||
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
|
||||
"baseUrl": "https://metaso.cn",
|
||||
"auth": { "type": "bearer", "field": "apiKey" },
|
||||
"requiresPublicMediaUrls": true,
|
||||
"parameters": [
|
||||
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "视频模型 ID(MiniMax-H3 / MiniMax-H3-Max)。" },
|
||||
{ "name": "prompt", "type": "string", "required": true, "mapping": "prompt/content/input", "description": "视频提示词。" },
|
||||
{ "name": "images", "type": "media[]", "required": false, "mapping": "first/last/reference image", "description": "显式 role 图片输入(首帧/尾帧/参考图)。" },
|
||||
{ "name": "videos", "type": "media[]", "required": false, "mapping": "reference video", "description": "参考视频。" },
|
||||
{ "name": "audios", "type": "media[]", "required": false, "mapping": "reference audio/voice", "description": "参考音频或音色。" },
|
||||
{ "name": "duration", "type": "integer", "required": false, "mapping": "duration/seconds", "description": "时长秒数(4-15)。" },
|
||||
{ "name": "aspectRatio", "type": "string", "required": false, "mapping": "ratio/aspect_ratio/size", "description": "画幅比例(16:9 等)。" },
|
||||
{ "name": "resolution", "type": "string", "required": false, "mapping": "resolution", "description": "分辨率档位(768P / 2K)。" },
|
||||
{ "name": "watermark", "type": "boolean", "required": false, "mapping": "watermark", "description": "AIGC 水印开关。" },
|
||||
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/api/minimax/v2/video_generation",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"model": { "$coalesce": [ { "$ref": "request.model" }, "MiniMax-H3" ] },
|
||||
"content": {
|
||||
"$concatArrays": [
|
||||
{ "$if": { "condition": { "$gt": [ { "$len": { "$ref": "request.prompt" } }, 0 ] }, "then": [ { "type": "text", "text": { "$ref": "request.prompt" } } ], "else": [] } },
|
||||
{ "$map": { "from": { "$ref": "request.images" }, "as": "media", "in": { "type": "image_url", "image_url": { "url": { "$coalesce": [ { "$ref": "media.url" }, { "$ref": "media.dataUrl" } ] } }, "role": { "$omitEmpty": { "$ref": "media.role" } } } } },
|
||||
{ "$map": { "from": { "$ref": "request.videos" }, "as": "media", "in": { "type": "video_url", "video_url": { "url": { "$coalesce": [ { "$ref": "media.url" }, { "$ref": "media.dataUrl" } ] } }, "role": { "$omitEmpty": { "$ref": "media.role" } } } } },
|
||||
{ "$map": { "from": { "$ref": "request.audios" }, "as": "media", "in": { "type": "audio_url", "audio_url": { "url": { "$coalesce": [ { "$ref": "media.url" }, { "$ref": "media.dataUrl" } ] } }, "role": { "$omitEmpty": { "$ref": "media.role" } } } } }
|
||||
]
|
||||
},
|
||||
"resolution": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.resolution" }, { "$ref": "request.providerOptions.metaso-h3.resolution" }, "768P" ] } },
|
||||
"duration": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.duration" }, { "$ref": "request.providerOptions.metaso-h3.duration" }, 5 ] } },
|
||||
"ratio": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.aspectRatio" }, { "$ref": "request.providerOptions.metaso-h3.ratio" }, "16:9" ] } },
|
||||
"aigc_watermark": { "$omitEmpty": { "$ref": "request.providerOptions.metaso-h3.aigc_watermark" } }
|
||||
}
|
||||
},
|
||||
"poll": {
|
||||
"method": "GET",
|
||||
"path": "/api/minimax/v2/query/video_generation/{{taskId}}"
|
||||
},
|
||||
"response": {
|
||||
"taskId": {
|
||||
"$coalesce": [
|
||||
{ "$ref": "response.task_id" },
|
||||
{ "$ref": "response.taskId" },
|
||||
{ "$ref": "response.data.task_id" }
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$coalesce": [
|
||||
{ "$ref": "response.task.status" },
|
||||
{ "$ref": "response.status" },
|
||||
{ "$ref": "response.data.status" },
|
||||
"pending"
|
||||
]
|
||||
},
|
||||
"message": {
|
||||
"$coalesce": [
|
||||
{ "$ref": "response.task.error.message" },
|
||||
{ "$ref": "response.task.fail_reason" },
|
||||
{ "$ref": "response.error.message" },
|
||||
{ "$ref": "response.message" }
|
||||
]
|
||||
},
|
||||
"videos": {
|
||||
"$coalesce": [
|
||||
{ "$ref": "response.task.content.url" },
|
||||
{ "$ref": "response.task.content.video_url" },
|
||||
{ "$ref": "response.content.url" },
|
||||
{ "$ref": "response.data.url" }
|
||||
]
|
||||
},
|
||||
"usage": { "$ref": "response.task.usage" },
|
||||
"errorPaths": ["task.error.type", "error.type", "error.code"],
|
||||
"resultEphemeral": true,
|
||||
"messagePaths": ["task.error.message", "error.message"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
plugin-packages/wavespeed-image-edit.yingce-plugin
Normal file
BIN
plugin-packages/wavespeed-image-edit.yingce-plugin
Normal file
Binary file not shown.
29
plugin-packages/wavespeed-image-edit/README.md
Normal file
29
plugin-packages/wavespeed-image-edit/README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# WaveSpeed Image Edit
|
||||
|
||||
WaveSpeed 图片编辑协议插件(异步任务式):把 WaveSpeed 平台的图片编辑模型以 provider 形式接入影策画布,现有画布与已接入渠道可直接调用。
|
||||
|
||||
## 接入的模型端点(编辑类)
|
||||
|
||||
| 端点 ID | 模型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `openai/gpt-image-2.5-sunburst/edit` | GPT Image 2.5 Sunburst | 高质量编辑,支持多图参考(≤16) |
|
||||
| `openai/gpt-image-2.5-flare/edit` | GPT Image 2.5 Flare | 快速编辑,支持多图参考(≤16) |
|
||||
| `bytedance/seedream-v5.0-pro/edit` | Seedream 5.0 Pro | 编辑与图层分解(≤10 图) |
|
||||
| `google/nano-banana-2/edit` | Nano Banana 2 | 编辑(≤10 图) |
|
||||
| `google/nano-banana-2-lite/edit` | Nano Banana 2 Lite | 轻量编辑 |
|
||||
| `google/nano-banana-pro/edit` | Nano Banana Pro | 编辑 |
|
||||
|
||||
## 接入的模型端点(工具类)
|
||||
|
||||
| 端点 ID | 模型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `bria/remove-background` | BRIA | 去背景 |
|
||||
| `bytedance/seedream-v5.0-pro/layer-decomposition` | Seedream 5.0 Pro | 图层拆分 |
|
||||
|
||||
## 使用方式
|
||||
|
||||
1. 在画布设置中安装本插件,填入 WaveSpeed API Key。
|
||||
2. 创建图片节点时选择「WaveSpeed Image Edit」渠道,模型选上述端点 ID。
|
||||
3. 提供编辑提示词与源图,等待异步任务完成即可。
|
||||
|
||||
完整接口见 [docs/interface.md](docs/interface.md)。
|
||||
297
plugin-packages/wavespeed-image-edit/docs/interface.md
Normal file
297
plugin-packages/wavespeed-image-edit/docs/interface.md
Normal file
@@ -0,0 +1,297 @@
|
||||
# WaveSpeed Image Edit 接口字段
|
||||
|
||||
## 协议身份
|
||||
|
||||
- 插件 ID:`wavespeed-image-edit`。
|
||||
- Provider ID:`wavespeed-image-edit`。
|
||||
- 能力:`image`。
|
||||
- 默认 Base URL:`https://api.wavespeed.ai/api/v3`。
|
||||
- 鉴权驱动:`bearer`。
|
||||
- 创建:`POST /{{model}}`(model 为 WaveSpeed 图片编辑端点,如 `openai/gpt-image-2.5-sunburst/edit`)。
|
||||
- 生命周期:异步任务(create 返回 task id,poll 轮询结果)。
|
||||
|
||||
## 配置字段
|
||||
|
||||
| 字段 | 类型 | 必填 | 含义 |
|
||||
| --- | --- | --- | --- |
|
||||
| `apiKey` | secret | 是 | WaveSpeed API Key |
|
||||
|
||||
## 统一字段映射
|
||||
|
||||
| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `model` | string | 是 | `model` | WaveSpeed 图片编辑模型端点 ID。 |
|
||||
| `prompt` | string | 是 | `prompt` | 编辑提示词。 |
|
||||
| `images` | media[] | 否 | `images` | 编辑源图或参考图,按数组顺序透传 URL。 |
|
||||
| `imageCount` | integer | 否 | `n/sample_count` | 输出数量(WaveSpeed 多数编辑模型不支持,留空)。 |
|
||||
| `aspectRatio` | string | 否 | `aspect_ratio` | 比例或尺寸,如 `1:1`、`16:9`。 |
|
||||
| `resolution` | string | 否 | `resolution/imageSize` | 分辨率档位(编辑模型一般不支持,留空)。 |
|
||||
| `quality` | string | 否 | `quality` | 质量档位:`low` / `medium` / `high`。 |
|
||||
| `providerOptions` | object | 否 | `provider-specific fields` | 插件命名空间内的厂商扩展字段。 |
|
||||
|
||||
## 上游请求模板逐字段清单
|
||||
|
||||
下表由插件请求模板生成,覆盖 body、query、headers 和 multipart 文件声明中的每个字段。
|
||||
|
||||
| 上游位置 | 值或转换表达式 |
|
||||
| --- | --- |
|
||||
| `create.method` | `"POST"` |
|
||||
| `create.path` | `"/{{model}}"` |
|
||||
| `create.contentType` | `"application/json"` |
|
||||
| `create.body.prompt` | `{"$ref":"request.prompt"}` |
|
||||
| `create.body.images` | `{"$map":{"from":{"$ref":"request.images"},"as":"media","in":{"$ref":"media.value"}}}` |
|
||||
| `create.body.aspect_ratio` | `{"$omitEmpty":{"$ref":"request.aspectRatio"}}` |
|
||||
| `create.body.quality` | `{"$omitEmpty":{"$ref":"request.quality"}}` |
|
||||
| `create.body.output_format` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.providerOptions.wavespeed-image-edit.output_format"},"png"]}}` |
|
||||
| `create.body.enable_base64_output` | `{"$omitEmpty":{"$ref":"request.providerOptions.wavespeed-image-edit.enable_base64_output"}}` |
|
||||
| `create.body.enable_sync_mode` | `{"$omitEmpty":{"$ref":"request.providerOptions.wavespeed-image-edit.enable_sync_mode"}}` |
|
||||
| `poll.method` | `"GET"` |
|
||||
| `poll.path` | `"/predictions/{{taskId}}/result"`(taskId 来自 create 响应 `data.id`) |
|
||||
| `poll.contentType` | `"application/json"` |
|
||||
|
||||
## Provider 扩展键
|
||||
|
||||
- `providerOptions.wavespeed-image-edit.output_format`
|
||||
- `providerOptions.wavespeed-image-edit.enable_base64_output`
|
||||
- `providerOptions.wavespeed-image-edit.enable_sync_mode`
|
||||
|
||||
动态模型或工作流允许使用文档声明的完整 `parameters/input/extra_body` 对象;该对象是协议本身的开放 schema,不会被宿主裁剪。
|
||||
|
||||
## 响应映射逐字段清单
|
||||
|
||||
| 映射位置 | 上游路径或转换表达式 |
|
||||
| --- | --- |
|
||||
| `response.taskId` | `{"$coalesce":[{"$ref":"response.data.id"},{"$ref":"response.id"}]}` |
|
||||
| `response.status` | `{"$coalesce":[{"$ref":"response.data.status"},{"$ref":"response.status"},"pending"]}` |
|
||||
| `response.message` | `{"$coalesce":[{"$ref":"response.data.error"},{"$ref":"response.data.message"},{"$ref":"response.error.message"},{"$ref":"response.message"}]}` |
|
||||
| `response.images` | `{"$ref":"response.data.outputs"}` |
|
||||
| `response.errorPaths[0]` | `"error.code"` |
|
||||
| `response.resultEphemeral` | `true` |
|
||||
|
||||
WaveSpeed 异步任务响应结构:
|
||||
|
||||
- create 成功:`{"code":200,"data":{"id":"<taskId>"}}`
|
||||
- poll 进行中:`{"code":200,"data":{"id":"<taskId>","status":"processing","outputs":null}}`
|
||||
- poll 完成:`{"code":200,"data":{"id":"<taskId>","status":"completed","outputs":["https://cdn.wavespeed.ai/..."]}}`
|
||||
- poll 失败:`{"code":200,"data":{"id":"<taskId>","status":"failed","error":"..."}}`
|
||||
|
||||
`images` 直接透传 `data.outputs` 字符串数组;宿主把每个字符串识别为结果媒体 URL(同时兼容对象数组取 `url` 字段的写法)。`resultEphemeral` 标记临时媒体 URL,由宿主立即下载持久化。
|
||||
|
||||
## 兼容边界
|
||||
|
||||
模型字段由所选端点决定:编辑类端点接受 `prompt + images[]`;图层分解端点(`bytedance/seedream-v5.0-pro/layer-decomposition`)接受 `image + prompt`(用 `providerOptions` 传额外字段);去背景端点(`bria/remove-background`)接受 `image`。宿主通过 `request.images` 统一提供源图,模型字段差异由调用方通过 providerOptions 补充。
|
||||
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_START -->
|
||||
## Manifest 完整接口定义
|
||||
|
||||
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
|
||||
|
||||
```json
|
||||
{
|
||||
"apiVersion": "yingce.plugin/v2",
|
||||
"id": "wavespeed-image-edit",
|
||||
"name": "WaveSpeed Image Edit",
|
||||
"version": "1.0.0",
|
||||
"author": "WaveSpeed / 影策",
|
||||
"description": "WaveSpeed 图片编辑协议插件:GPT Image 2.5 / Seedream 5.0 Pro / Nano Banana 的 Image to Image 编辑与图层分解、去背景。",
|
||||
"permissions": [
|
||||
"generation.run",
|
||||
"media.read"
|
||||
],
|
||||
"configuration": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "apiKey",
|
||||
"type": "secret",
|
||||
"label": "WaveSpeed API Key",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"contributes": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "wavespeed-image-edit",
|
||||
"label": "WaveSpeed Image Edit",
|
||||
"capabilities": [
|
||||
"image"
|
||||
],
|
||||
"scopes": [
|
||||
"admin.system-channel",
|
||||
"user.custom-channel",
|
||||
"canvas",
|
||||
"creation",
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "https://api.wavespeed.ai/api/v3",
|
||||
"requiresPublicMediaUrls": true,
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "model",
|
||||
"description": "WaveSpeed 图片编辑模型端点 ID,如 openai/gpt-image-2.5-sunburst/edit、bytedance/seedream-v5.0-pro/edit、google/nano-banana-2/edit。"
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mapping": "prompt",
|
||||
"description": "编辑提示词,描述对源图的修改。"
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "media[]",
|
||||
"required": false,
|
||||
"mapping": "provider image/reference fields",
|
||||
"description": "编辑源图或参考图,role 由业务层确定;按数组顺序作为 images 入参。"
|
||||
},
|
||||
{
|
||||
"name": "imageCount",
|
||||
"type": "integer",
|
||||
"required": false,
|
||||
"mapping": "n/sample_count",
|
||||
"description": "输出数量。"
|
||||
},
|
||||
{
|
||||
"name": "aspectRatio",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "size/aspect_ratio",
|
||||
"description": "比例或尺寸,如 1:1、16:9、9:16、4:3、3:4。"
|
||||
},
|
||||
{
|
||||
"name": "resolution",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "resolution/imageSize",
|
||||
"description": "分辨率档位。"
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"mapping": "quality",
|
||||
"description": "质量档位:low/medium/high。"
|
||||
},
|
||||
{
|
||||
"name": "providerOptions",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"mapping": "provider-specific fields",
|
||||
"description": "插件命名空间内的厂商扩展字段。"
|
||||
}
|
||||
],
|
||||
"create": {
|
||||
"method": "POST",
|
||||
"path": "/{{model}}",
|
||||
"contentType": "application/json",
|
||||
"body": {
|
||||
"prompt": {
|
||||
"$ref": "request.prompt"
|
||||
},
|
||||
"images": {
|
||||
"$map": {
|
||||
"from": {
|
||||
"$ref": "request.images"
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"$ref": "media.value"
|
||||
}
|
||||
}
|
||||
},
|
||||
"aspect_ratio": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.aspectRatio"
|
||||
}
|
||||
},
|
||||
"quality": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.quality"
|
||||
}
|
||||
},
|
||||
"output_format": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.providerOptions.wavespeed-image-edit.output_format"
|
||||
},
|
||||
"png"
|
||||
]
|
||||
}
|
||||
},
|
||||
"enable_base64_output": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.wavespeed-image-edit.enable_base64_output"
|
||||
}
|
||||
},
|
||||
"enable_sync_mode": {
|
||||
"$omitEmpty": {
|
||||
"$ref": "request.providerOptions.wavespeed-image-edit.enable_sync_mode"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"poll": {
|
||||
"method": "GET",
|
||||
"path": "/predictions/{{taskId}}/result"
|
||||
},
|
||||
"response": {
|
||||
"taskId": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.id"
|
||||
},
|
||||
{
|
||||
"$ref": "response.id"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.status"
|
||||
},
|
||||
{
|
||||
"$ref": "response.status"
|
||||
},
|
||||
"pending"
|
||||
]
|
||||
},
|
||||
"message": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "response.data.error"
|
||||
},
|
||||
{
|
||||
"$ref": "response.data.message"
|
||||
},
|
||||
{
|
||||
"$ref": "response.error.message"
|
||||
},
|
||||
{
|
||||
"$ref": "response.message"
|
||||
}
|
||||
]
|
||||
},
|
||||
"images": {
|
||||
"$ref": "response.data.outputs"
|
||||
},
|
||||
"errorPaths": [
|
||||
"error.code"
|
||||
],
|
||||
"resultEphemeral": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>"
|
||||
}
|
||||
```
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_END -->
|
||||
206
plugin-packages/wavespeed-image-edit/manifest.json
Normal file
206
plugin-packages/wavespeed-image-edit/manifest.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user