feat(*): 创作平台 - 升级短剧分镜工作流并完善模型计费与界面状态
This commit is contained in:
1 parent
4b75504f75
commit
0558cf4381
33 files changed
+2849
-239
No files matched your search
@@ -127,9 +127,11 @@ func (s *Service) CreateTask(userID string, req CreateTaskRequest) (*model.Task,
|
||||
}
|
||||
|
||||
// resolveTaskModelSelection 根据请求实际携带的模型选择决定路由方式。
|
||||
// 显式系统渠道请求不能被全局前台模型开关误判,但仍必须通过渠道、模型和价格校验。
|
||||
// 显式系统渠道和用户自定义渠道请求不能被全局前台模型开关误判;
|
||||
// 它们仍分别进入系统目录校验或自定义渠道的功能、能力与安全校验。
|
||||
func (s *Service) resolveTaskModelSelection(input map[string]any, logicalModelID string, taskType string, operation string, frontendEnabled bool) (*RoutedModel, map[string]any, error) {
|
||||
if frontendEnabled && !taskInputUsesSystemChannel(input) {
|
||||
customChannelTask := taskInputUsesCustomChannel(input)
|
||||
if frontendEnabled && !taskInputUsesSystemChannel(input) && !customChannelTask {
|
||||
if logicalModelID == "" {
|
||||
return nil, input, InvalidModelSelection("前台模型模式下必须指定 logicalModelId")
|
||||
}
|
||||
@@ -146,7 +148,7 @@ func (s *Service) resolveTaskModelSelection(input map[string]any, logicalModelID
|
||||
}
|
||||
// 自定义渠道没有系统 channelId;它会在后续由自定义渠道功能开关、
|
||||
// 能力校验和 provider 配置校验共同处理,不能误报为“缺少系统渠道”。
|
||||
if !taskInputUsesCustomChannel(input) {
|
||||
if !customChannelTask {
|
||||
if err := s.validateSystemChannelModelSelection(input); err != nil {
|
||||
return nil, input, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user