feat: init improvements (#174)

This commit is contained in:
N3ko
2025-07-29 19:02:03 +08:00
committed by GitHub
parent b48c4c2792
commit 8137b0aee5
9 changed files with 133 additions and 15 deletions

View File

@@ -24,9 +24,14 @@ import (
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
"github.com/coze-dev/coze-studio/backend/pkg/lang/sets"
"github.com/coze-dev/coze-studio/backend/pkg/logs"
)
func NewModelMgr(staticModels []*modelmgr.Model) (modelmgr.Manager, error) {
if len(staticModels) == 0 {
logs.Warnf("[NewModelMgr] no static models found, please check if the config has been loaded correctly")
}
mapping := make(map[int64]*modelmgr.Model, len(staticModels))
for i := range staticModels {
mapping[staticModels[i].ID] = staticModels[i]