(account *model.AgentAccount, models []dto.AgentAccountModel)
| 1449 | } |
| 1450 | |
| 1451 | func ensureAccountModelsNotBound(account *model.AgentAccount, models []dto.AgentAccountModel) error { |
| 1452 | if account == nil || account.ID == 0 { |
| 1453 | return nil |
| 1454 | } |
| 1455 | agents, err := agentRepo.List(repo.WithByAccountID(account.ID)) |
| 1456 | if err != nil { |
| 1457 | return err |
| 1458 | } |
| 1459 | for _, agent := range agents { |
| 1460 | if _, ok := findAgentAccountModelForProvider(account.Provider, models, agent.Model); !ok { |
| 1461 | return buserr.WithName("ErrAgentModelInUse", agent.Name) |
| 1462 | } |
| 1463 | } |
| 1464 | return nil |
| 1465 | } |
| 1466 | |
| 1467 | func resolveServerTimezone() string { |
| 1468 | timezone := strings.TrimSpace(common.LoadTimeZoneByCmd()) |
no test coverage detected