chore(plugin): 本地定制插件包更新(a6api/metaso-h3/antigravity-proxy/openai-images 渠道适配)

This commit is contained in:
Codex committed 2026-09-18 20:44:27 +08:00
1 parent 6abaa7b45a
commit 4066be734c
13 files changed
+2235 -289

No files matched your search

+407 -66
View File
@@ -5,10 +5,18 @@
"version": "1.0.0",
"author": "A6api",
"description": "A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。",
"permissions": ["generation.run", "media.read"],
"permissions": [
"generation.run",
"media.read"
],
"configuration": {
"fields": [
{ "name": "apiKey", "type": "secret", "label": "API Key", "required": true }
{
"name": "apiKey",
"type": "secret",
"label": "API Key",
"required": true
}
]
},
"contributes": {
@@ -16,76 +24,291 @@
{
"id": "a6api-chat",
"label": "A6api Chat",
"capabilities": ["text"],
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
"capabilities": [
"text"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://api.a6api.com",
"auth": { "type": "bearer", "field": "apiKey" },
"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": "插件命名空间内的厂商扩展字段。" }
{
"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" } }
"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"]
"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"],
"capabilities": [
"image"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://api.a6api.com",
"auth": { "type": "bearer", "field": "apiKey" },
"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": "插件命名空间内的厂商扩展字段。" }
{
"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 ] },
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": "/images/edits",
"else": "/images/generations"
}
@@ -93,30 +316,120 @@
"contentType": "application/json",
"contentTypeTemplate": {
"$if": {
"condition": { "$gt": [ { "$len": { "$ref": "request.images" } }, 0 ] },
"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" } }
"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" ] } } },
"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" ] } } },
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "mask.png"
}
]
@@ -125,19 +438,47 @@
"status": "succeeded",
"images": {
"$map": {
"from": { "$ref": "response.data" },
"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 } }
"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"]
"usage": {
"$ref": "response.usage"
},
"errorPaths": [
"error.code"
],
"messagePaths": [
"error.message"
]
}
}
]
}
}
},
"documentation": "# A6api\n\nA6api 模型网关协议插件。统一入口 `https://api.a6api.com`,OpenAI 兼容(`Authorization: Bearer <api_key>`)。\n\n## Providers\n\n| Provider | 能力 | 端点 |\n|---|---|---|\n| a6api-chat | text | POST /chat/completions |\n| a6api-image | image | POST /images/generations、POST /images/edits |\n\n## 配置\n\n在渠道中填写 API Key(A6api 控制台创建,形如 `sk-xxxxxxxx`),baseUrl 使用 `https://api.a6api.com`。\n\n## 说明\n\n- 模型名以 A6api 模型市场当前列表为准。\n- 图像编辑(带参考图)走 `/images/edits` multipart 请求。\n- 错误体为 OpenAI 风格,携带 `request_id`。\n\n---\n\n# A6api 接口说明\n\n## 鉴权\n\n`Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx`\n\n## 文本对话\n\nPOST `https://api.a6api.com/chat/completions`\n\n请求体 OpenAI Chat Completions 格式:`model`、`messages`、`temperature`、`max_tokens`、`tools`、`tool_choice`、`response_format`、`stream` 等。\n\n响应 `choices[0].message.content` 为正文,`choices[0].message.reasoning_content` 为推理内容,`usage` 为用量。\n\n## 图像生成\n\nPOST `https://api.a6api.com/images/generations`\n\n请求体:`model`、`prompt`、`n`、`size`、`quality`、`response_format`。\n\n响应 `data[].url` 或 `data[].b64_json`。\n\n## 图像编辑\n\nPOST `https://api.a6api.com/images/edits`(multipart,带参考图时使用)\n\n## 模型列表\n\nGET `https://api.a6api.com/models`\n\n<!-- YINGCE_MANIFEST_CONTRACT_START -->\n## Manifest 完整接口定义\n\n以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。\n\n```json\n{\n \"apiVersion\": \"yingce.plugin/v2\",\n \"id\": \"a6api\",\n \"name\": \"A6api\",\n \"version\": \"1.0.0\",\n \"author\": \"A6api\",\n \"description\": \"A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。\",\n \"permissions\": [\n \"generation.run\",\n \"media.read\"\n ],\n \"configuration\": {\n \"fields\": [\n {\n \"name\": \"apiKey\",\n \"type\": \"secret\",\n \"label\": \"API Key\",\n \"required\": true\n }\n ]\n },\n \"contributes\": {\n \"providers\": [\n {\n \"id\": \"a6api-chat\",\n \"label\": \"A6api Chat\",\n \"capabilities\": [\n \"text\"\n ],\n \"scopes\": [\n \"admin.system-channel\",\n \"user.custom-channel\",\n \"canvas\",\n \"creation\",\n \"agent\"\n ],\n \"baseUrl\": \"https://api.a6api.com\",\n \"auth\": {\n \"type\": \"bearer\",\n \"field\": \"apiKey\"\n },\n \"parameters\": [\n {\n \"name\": \"model\",\n \"type\": \"string\",\n \"required\": true,\n \"mapping\": \"model\",\n \"description\": \"A6api 模型市场中的模型 ID。\"\n },\n {\n \"name\": \"messages\",\n \"type\": \"message[]\",\n \"required\": true,\n \"mapping\": \"provider message container\",\n \"description\": \"包含历史消息和当前用户输入。\"\n },\n {\n \"name\": \"instructions\",\n \"type\": \"string\",\n \"required\": false,\n \"mapping\": \"system/instructions\",\n \"description\": \"系统指令。\"\n },\n {\n \"name\": \"temperature\",\n \"type\": \"number\",\n \"required\": false,\n \"mapping\": \"temperature\",\n \"description\": \"采样温度。\"\n },\n {\n \"name\": \"top_p\",\n \"type\": \"number\",\n \"required\": false,\n \"mapping\": \"top_p\",\n \"description\": \"核采样参数。\"\n },\n {\n \"name\": \"max_tokens\",\n \"type\": \"integer\",\n \"required\": false,\n \"mapping\": \"max_tokens/max_output_tokens\",\n \"description\": \"最大输出 token。\"\n },\n {\n \"name\": \"tools\",\n \"type\": \"array\",\n \"required\": false,\n \"mapping\": \"tools/toolConfig\",\n \"description\": \"工具定义。\"\n },\n {\n \"name\": \"tool_choice\",\n \"type\": \"object|string\",\n \"required\": false,\n \"mapping\": \"tool_choice\",\n \"description\": \"工具选择策略。\"\n },\n {\n \"name\": \"response_format\",\n \"type\": \"objecLine truncated
}