(ctx context.Context, tasks []modelRegistrationTask)
| 250 | } |
| 251 | |
| 252 | func (s *Service) runModelRegistrationTasks(ctx context.Context, tasks []modelRegistrationTask) { |
| 253 | if len(tasks) == 0 { |
| 254 | return |
| 255 | } |
| 256 | if ctx == nil { |
| 257 | ctx = context.Background() |
| 258 | } |
| 259 | |
| 260 | configAPIKeyTasks := make([]modelRegistrationTask, 0) |
| 261 | otherTasks := make([]modelRegistrationTask, 0) |
| 262 | for _, task := range tasks { |
| 263 | if task.phase == modelRegistrationPhaseConfigAPIKey { |
| 264 | configAPIKeyTasks = append(configAPIKeyTasks, task) |
| 265 | continue |
| 266 | } |
| 267 | otherTasks = append(otherTasks, task) |
| 268 | } |
| 269 | |
| 270 | compatCache := s.newOpenAICompatibilityRegistrationCache() |
| 271 | s.runModelRegistrationTaskPhase(ctx, configAPIKeyTasks, compatCache) |
| 272 | s.runModelRegistrationTaskPhase(ctx, otherTasks, compatCache) |
| 273 | } |
| 274 | |
| 275 | func (s *Service) runModelRegistrationTaskPhase(ctx context.Context, tasks []modelRegistrationTask, compatCache *openAICompatibilityRegistrationCache) { |
| 276 | if len(tasks) == 0 { |
no test coverage detected