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

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
+59
View File
@@ -548,6 +548,13 @@ definitions:
required:
- regionKey
type: object
internal_api.testChannelModelRequest:
properties:
model:
type: string
required:
- model
type: object
internal_api.tokenResponse:
properties:
expiresAt:
@@ -1320,6 +1327,9 @@ definitions:
type: integer
lastProbeAt:
type: string
modelCount:
description: ModelCount 是渠道模型缓存计数,列表查询回填,不落库
type: integer
name:
type: string
ociConfigId:
@@ -1328,6 +1338,9 @@ definitions:
type: integer
probeError:
type: string
probeModel:
description: ProbeModel 是用户测试通过后固定的探测验证模型名;探测时置于候选首位
type: string
probeStatus:
description: ok / no_service / no_quota / error
type: string
@@ -2923,6 +2936,24 @@ paths:
summary: 更新 AI 渠道
tags:
- AI 管理
/api/v1/ai-channels/{id}/models:
get:
parameters:
- description: 渠道 ID
in: path
name: id
required: true
type: integer
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_api.itemsResponse-oci-portal_internal_model_AiModelCache'
security:
- BearerAuth: []
summary: 渠道模型缓存列表
tags:
- AI 管理
/api/v1/ai-channels/{id}/probe:
post:
parameters:
@@ -2959,6 +2990,34 @@ paths:
summary: 同步渠道模型缓存
tags:
- AI 管理
/api/v1/ai-channels/{id}/test-model:
post:
parameters:
- description: 渠道 ID
in: path
name: id
required: true
type: integer
- description: 模型名
in: body
name: 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'
security:
- BearerAuth: []
summary: 测试渠道模型(max_tokens=16 试调;通过即设为探测验证模型并按需置渠道可用)
tags:
- AI 管理
/api/v1/ai-content-logs:
get:
responses: