chore(plugin): 本地定制插件包更新(a6api/metaso-h3/antigravity-proxy/openai-images 渠道适配)
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -40,6 +40,8 @@
|
||||
| `create.contentType` | `"application/json"` |
|
||||
| `create.body.model` | `{"$ref":"request.model"}` |
|
||||
| `create.body.prompt` | `{"$ref":"request.prompt"}` |
|
||||
| `create.body.images` | `{"$omitEmpty":{"$if":{"condition":{"$gt":[{"$len":{"$ref":"request.images"}},0]},"then":{"$map":{"from":{"$filter":{"from":{"$sortByOrder":{"$ref":"request.images"}},"as":"media","where":{"$ne":[{"$ref":"media.role"},"mask"]}}},"as":"media","in":{"image_url":{"$ref":"media.value"}}}},"else":null}}}` |
|
||||
| `create.body.mask` | `{"$omitEmpty":{"$if":{"condition":{"$gt":[{"$len":{"$filter":{"from":{"$ref":"request.images"},"as":"media","where":{"$eq":[{"$ref":"media.role"},"mask"]}}}},0]},"then":{"image_url":{"$first":{"$map":{"from":{"$filter":{"from":{"$sortByOrder":{"$ref":"request.images"}},"as":"media","where":{"$eq":[{"$ref":"media.role"},"mask"]}}},"as":"media","in":{"$ref":"media.value"}}}}},"else":null}}}` |
|
||||
| `create.body.n` | `{"$omitEmpty":{"$if":{"condition":{"$gt":[{"$ref":"request.imageCount"},0]},"then":{"$ref":"request.imageCount"},"else":1}}}` |
|
||||
| `create.body.size` | `{"$omitEmpty":{"$if":{"condition":{"$in":[{"$lower":{"$trim":{"$ref":"request.aspectRatio"}}},["","auto"]]},"then":null,"else":{"$ref":"request.aspectRatio"}}}}` |
|
||||
| `create.body.quality` | `{"$omitEmpty":{"$switch":{"cases":[{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["1k"]]},"then":"low"},{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["2k"]]},"then":"medium"},{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["4k"]]},"then":"high"},{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["","auto"]]},"then":null}],"default":{"$ref":"request.quality"}}}}` |
|
||||
@@ -47,15 +49,9 @@
|
||||
| `create.body.output_format` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.providerOptions.openai-image.output_format"},"png"]}}` |
|
||||
| `create.body.output_compression` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.output_compression"}}` |
|
||||
| `create.body.moderation` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.moderation"}}` |
|
||||
| `create.body.response_format` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.providerOptions.openai-image.response_format"},"b64_json"]}}` |
|
||||
| `create.body.response_format` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.response_format"}}` |
|
||||
| `create.body.style` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.style"}}` |
|
||||
| `create.body.user` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.user"}}` |
|
||||
| `create.files[0].name` | `"image"` |
|
||||
| `create.files[0].source` | `{"$filter":{"from":{"$ref":"request.images"},"as":"media","where":{"$ne":[{"$ref":"media.role"},"mask"]}}}` |
|
||||
| `create.files[0].filename` | `"source.png"` |
|
||||
| `create.files[1].name` | `"mask"` |
|
||||
| `create.files[1].source` | `{"$filter":{"from":{"$ref":"request.images"},"as":"media","where":{"$eq":[{"$ref":"media.role"},"mask"]}}}` |
|
||||
| `create.files[1].filename` | `"mask.png"` |
|
||||
|
||||
## Provider 扩展键
|
||||
|
||||
@@ -85,7 +81,7 @@
|
||||
|
||||
## 兼容边界
|
||||
|
||||
无参考图走 JSON generations;有参考图或蒙版走 multipart edits。quality 的 1k/2k/4k 映射为 OpenAI low/medium/high。
|
||||
无参考图走 JSON generations;有参考图或蒙版走 JSON edits,并按官方 images 数组传入多张 image_url。quality 的 1k/2k/4k 映射为 OpenAI low/medium/high。
|
||||
|
||||
<!-- YINGCE_MANIFEST_CONTRACT_START -->
|
||||
## Manifest 完整接口定义
|
||||
@@ -131,7 +127,7 @@
|
||||
"agent"
|
||||
],
|
||||
"baseUrl": "https://api.openai.com",
|
||||
"requiresPublicMediaUrls": false,
|
||||
"requiresPublicMediaUrls": true,
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"field": "apiKey"
|
||||
@@ -214,22 +210,6 @@
|
||||
}
|
||||
},
|
||||
"contentType": "application/json",
|
||||
"contentTypeTemplate": {
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$gt": [
|
||||
{
|
||||
"$len": {
|
||||
"$ref": "request.images"
|
||||
}
|
||||
},
|
||||
0
|
||||
]
|
||||
},
|
||||
"then": "multipart/form-data",
|
||||
"else": "application/json"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"model": {
|
||||
"$ref": "request.model"
|
||||
@@ -237,6 +217,111 @@
|
||||
"prompt": {
|
||||
"$ref": "request.prompt"
|
||||
},
|
||||
"images": {
|
||||
"$omitEmpty": {
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$gt": [
|
||||
{
|
||||
"$len": {
|
||||
"$ref": "request.images"
|
||||
}
|
||||
},
|
||||
0
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"$map": {
|
||||
"from": {
|
||||
"$filter": {
|
||||
"from": {
|
||||
"$sortByOrder": {
|
||||
"$ref": "request.images"
|
||||
}
|
||||
},
|
||||
"as": "media",
|
||||
"where": {
|
||||
"$ne": [
|
||||
{
|
||||
"$ref": "media.role"
|
||||
},
|
||||
"mask"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"image_url": {
|
||||
"$ref": "media.value"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"mask": {
|
||||
"$omitEmpty": {
|
||||
"$if": {
|
||||
"condition": {
|
||||
"$gt": [
|
||||
{
|
||||
"$len": {
|
||||
"$filter": {
|
||||
"from": {
|
||||
"$ref": "request.images"
|
||||
},
|
||||
"as": "media",
|
||||
"where": {
|
||||
"$eq": [
|
||||
{
|
||||
"$ref": "media.role"
|
||||
},
|
||||
"mask"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
0
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"image_url": {
|
||||
"$first": {
|
||||
"$map": {
|
||||
"from": {
|
||||
"$filter": {
|
||||
"from": {
|
||||
"$sortByOrder": {
|
||||
"$ref": "request.images"
|
||||
}
|
||||
},
|
||||
"as": "media",
|
||||
"where": {
|
||||
"$eq": [
|
||||
{
|
||||
"$ref": "media.role"
|
||||
},
|
||||
"mask"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"as": "media",
|
||||
"in": {
|
||||
"$ref": "media.value"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"n": {
|
||||
"$omitEmpty": {
|
||||
"$if": {
|
||||
@@ -405,12 +490,7 @@
|
||||
},
|
||||
"response_format": {
|
||||
"$omitEmpty": {
|
||||
"$coalesce": [
|
||||
{
|
||||
"$ref": "request.providerOptions.openai-image.response_format"
|
||||
},
|
||||
"b64_json"
|
||||
]
|
||||
"$ref": "request.providerOptions.openai-image.response_format"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
@@ -423,49 +503,7 @@
|
||||
"$ref": "request.providerOptions.openai-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",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -17,4 +17,4 @@ A6api 模型网关协议插件。统一入口 `https://api.a6api.com`,OpenAI
|
||||
|
||||
- 模型名以 A6api 模型市场当前列表为准。
|
||||
- 图像编辑(带参考图)走 `/images/edits` multipart 请求。
|
||||
- 错误体为 OpenAI 风格,携带 `request_id`。
|
||||
- 错误体为 OpenAI 风格,携带 `request_id`。
|
||||
|
||||
@@ -26,4 +26,497 @@ POST `https://api.a6api.com/images/edits`(multipart,带参考图时使用)
|
||||
|
||||
## 模型列表
|
||||
|
||||
GET `https://api.a6api.com/models`
|
||||
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 -->
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -68,3 +68,236 @@
|
||||
## 兼容边界
|
||||
|
||||
该包只代表 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 -->
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -59,3 +59,379 @@ 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 -->
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user