mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 20:12:39 +08:00
Fix composite route lint issues
This commit is contained in:
@@ -177,16 +177,6 @@ func (s *GatewayService) resolveCompositeRouteDecision(ctx context.Context, grou
|
||||
return decision, decision.Matched, nil
|
||||
}
|
||||
|
||||
func resolveCompositeTargetPlatform(ctx context.Context, group *Group, requestedModel string) (string, bool) {
|
||||
if platform, ok := ResolvedTargetPlatformFromContext(ctx); ok {
|
||||
return platform, true
|
||||
}
|
||||
if group == nil || group.Platform != PlatformComposite {
|
||||
return "", false
|
||||
}
|
||||
return DetectModelPlatform(requestedModel)
|
||||
}
|
||||
|
||||
func isConcreteRequestPlatform(platform string) bool {
|
||||
switch platform {
|
||||
case PlatformAnthropic, PlatformOpenAI, PlatformGemini, PlatformAntigravity, PlatformGrok:
|
||||
|
||||
@@ -42,10 +42,13 @@ func (s *GatewayService) SelectAccountForModelWithExclusions(ctx context.Context
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if group == nil {
|
||||
return nil, ErrGroupNotFound
|
||||
}
|
||||
groupID = resolvedGroupID
|
||||
ctx = s.withGroupContext(ctx, group)
|
||||
platform = group.Platform
|
||||
if group != nil && group.Platform == PlatformComposite {
|
||||
if group.Platform == PlatformComposite {
|
||||
decision, ok, err := s.resolveCompositeRouteDecision(ctx, group, requestedModel, CompositeRouteEndpointAny)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user