MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / runModelRegistrationTasks

Method runModelRegistrationTasks

sdk/cliproxy/service.go:252–273  ·  view source on GitHub ↗
(ctx context.Context, tasks []modelRegistrationTask)

Source from the content-addressed store, hash-verified

250}
251
252func (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
275func (s *Service) runModelRegistrationTaskPhase(ctx context.Context, tasks []modelRegistrationTask, compatCache *openAICompatibilityRegistrationCache) {
276 if len(tasks) == 0 {

Callers 4

handleAuthUpdatesMethod · 0.95

Tested by

no test coverage detected