结构修改
This commit is contained in:
parent
c07b57a705
commit
50a5193922
|
@ -5,6 +5,7 @@ import (
|
|||
"ai_scheduler/internal/data/impl"
|
||||
"ai_scheduler/internal/data/model"
|
||||
"ai_scheduler/internal/entitys"
|
||||
"ai_scheduler/internal/pkg"
|
||||
"ai_scheduler/internal/pkg/utils_ollama"
|
||||
"ai_scheduler/internal/tools"
|
||||
"ai_scheduler/utils"
|
||||
|
@ -53,27 +54,30 @@ func Test_OrderLog(t *testing.T) {
|
|||
}
|
||||
|
||||
func in() *AiRouterBiz {
|
||||
|
||||
modDir, err := getModuleDir()
|
||||
if err != nil {
|
||||
panic("1")
|
||||
}
|
||||
configPath := flag.String("config", fmt.Sprintf("%s/config/config.yaml", modDir), "Path to configuration file")
|
||||
flag.Parse()
|
||||
|
||||
configConfig, err := config.LoadConfig(*configPath)
|
||||
if err != nil {
|
||||
panic("加载配置失败")
|
||||
}
|
||||
client, _, err := utils_ollama.NewClient(configConfig)
|
||||
allLogger := log.DefaultLogger()
|
||||
utilOllama := utils_ollama.NewUtilOllama(configConfig, allLogger)
|
||||
manager := tools.NewManager(configConfig, utilOllama)
|
||||
manager := tools.NewManager(configConfig, client)
|
||||
|
||||
db, _ := utils.NewGormDb(configConfig)
|
||||
sessionImpl := impl.NewSessionImpl(db)
|
||||
sysImpl := impl.NewSysImpl(db)
|
||||
taskImpl := impl.NewTaskImpl(db)
|
||||
chatImpl := impl.NewChatImpl(db)
|
||||
|
||||
routerBiz := NewAiRouterBiz(manager, sessionImpl, sysImpl, taskImpl, chatImpl, configConfig, utilOllama)
|
||||
safeChannelPool, _ := pkg.NewSafeChannelPool(configConfig)
|
||||
routerBiz := NewAiRouterBiz(manager, sessionImpl, sysImpl, taskImpl, chatImpl, configConfig, utilOllama, safeChannelPool)
|
||||
|
||||
return routerBiz
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue