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