feat(models): 支持按使用场景筛选模型

Gateway 模型接口校验 usage_scene,并与 server-main 严格场景目录取交集;显式场景查询在上游不可用时关闭失败,避免返回不应暴露的模型。\n\n验证:env -u AI_GATEWAY_TEST_DATABASE_URL go test ./... -count=1
This commit is contained in:
chengcheng
2026-07-27 13:15:23 +08:00
parent de10875439
commit 31c32690b2
5 changed files with 443 additions and 0 deletions
+48
View File
@@ -6860,6 +6860,18 @@
"playground"
],
"summary": "列出可调用模型",
"parameters": [
{
"enum": [
"canvas_model_node",
"desktop"
],
"type": "string",
"description": "模型可选场景;不传时保持原有行为",
"name": "usage_scene",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
@@ -6867,6 +6879,12 @@
"$ref": "#/definitions/httpapi.PlatformModelListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"401": {
"description": "Unauthorized",
"schema": {
@@ -6878,6 +6896,12 @@
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"502": {
"description": "Bad Gateway",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
}
}
}
@@ -7220,6 +7244,18 @@
"playground"
],
"summary": "列出可调用模型",
"parameters": [
{
"enum": [
"canvas_model_node",
"desktop"
],
"type": "string",
"description": "模型可选场景;不传时保持原有行为",
"name": "usage_scene",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
@@ -7227,6 +7263,12 @@
"$ref": "#/definitions/httpapi.PlatformModelListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"401": {
"description": "Unauthorized",
"schema": {
@@ -7238,6 +7280,12 @@
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"502": {
"description": "Bad Gateway",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
}
}
}