渠道模型列表与测试端点,修复探测无配额误判

This commit is contained in:
2026-07-14 19:33:33 +08:00
parent 79c9e4d9b9
commit 1da2197a6c
11 changed files with 688 additions and 22 deletions
+94
View File
@@ -458,6 +458,36 @@ const docTemplate = `{
}
}
},
"/api/v1/ai-channels/{id}/models": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"AI 管理"
],
"summary": "渠道模型缓存列表",
"parameters": [
{
"type": "integer",
"description": "渠道 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal_api.itemsResponse-oci-portal_internal_model_AiModelCache"
}
}
}
}
},
"/api/v1/ai-channels/{id}/probe": {
"post": {
"security": [
@@ -518,6 +548,51 @@ const docTemplate = `{
}
}
},
"/api/v1/ai-channels/{id}/test-model": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"AI 管理"
],
"summary": "测试渠道模型(max_tokens=16 试调;通过即设为探测验证模型并按需置渠道可用)",
"parameters": [
{
"type": "integer",
"description": "渠道 ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "模型名",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.testChannelModelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/oci-portal_internal_model.AiChannel"
}
},
"502": {
"description": "试调未通过",
"schema": {
"$ref": "#/definitions/internal_api.errorResponse"
}
}
}
}
},
"/api/v1/ai-content-logs": {
"get": {
"security": [
@@ -6732,6 +6807,17 @@ const docTemplate = `{
}
}
},
"internal_api.testChannelModelRequest": {
"type": "object",
"required": [
"model"
],
"properties": {
"model": {
"type": "string"
}
}
},
"internal_api.tokenResponse": {
"type": "object",
"properties": {
@@ -7921,6 +8007,10 @@ const docTemplate = `{
"lastProbeAt": {
"type": "string"
},
"modelCount": {
"description": "ModelCount 是渠道模型缓存计数,列表查询回填,不落库",
"type": "integer"
},
"name": {
"type": "string"
},
@@ -7933,6 +8023,10 @@ const docTemplate = `{
"probeError": {
"type": "string"
},
"probeModel": {
"description": "ProbeModel 是用户测试通过后固定的探测验证模型名;探测时置于候选首位",
"type": "string"
},
"probeStatus": {
"description": "ok / no_service / no_quota / error",
"type": "string"