ai-courseware/eino-project/cmd/server/wire_gen.go

58 lines
2.2 KiB
Go

// Code generated by Wire. DO NOT EDIT.
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package main
import (
"eino-project/internal/biz"
"eino-project/internal/conf"
"eino-project/internal/data"
"eino-project/internal/data/repoimpl"
"eino-project/internal/domain/context"
"eino-project/internal/domain/llm"
"eino-project/internal/domain/monitor"
"eino-project/internal/domain/session"
"eino-project/internal/domain/vector"
"eino-project/internal/server"
"eino-project/internal/service"
"github.com/go-kratos/kratos/v2"
"github.com/go-kratos/kratos/v2/log"
_ "go.uber.org/automaxprocs"
)
// Injectors from wire.go:
// wireApp init kratos application.
func wireApp(confServer *conf.Server, confData *conf.Data, bootstrap *conf.Bootstrap, logger log.Logger) (*kratos.App, func(), error) {
vectorService, err := vector.NewVectorServiceFromBootstrapConfig(bootstrap, logger)
if err != nil {
return nil, nil, err
}
documentProcessor := vector.NewDocumentProcessor(vectorService)
knowledgeSearcher := vector.NewKnowledgeSearcher(vectorService)
contextManager := context.NewContextManager(logger)
monitorMonitor := monitor.NewMonitorFromBootstrapConfig(bootstrap, logger)
dataData, cleanup, err := data.NewData(confData, logger, vectorService, documentProcessor, knowledgeSearcher, contextManager, monitorMonitor)
if err != nil {
return nil, nil, err
}
customerRepo := repoimpl.NewCustomerRepo(dataData, logger)
customerUseCase := biz.NewCustomerUseCase(customerRepo, logger, knowledgeSearcher, documentProcessor, contextManager, monitorMonitor)
sessionManager := session.NewMemorySessionManager(logger)
llmLLM := llm.NewLLM(bootstrap)
customerService := service.NewCustomerService(customerUseCase, sessionManager, monitorMonitor, logger, llmLLM)
agentService := service.NewAgentService(logger, llmLLM)
workflowService := service.NewWorkflowService(logger, llmLLM)
chatService := service.NewChatService(logger, llmLLM, monitorMonitor)
httpServer := server.NewHTTPServer(confServer, customerService, agentService, workflowService, logger, chatService)
app := newApp(logger, httpServer)
return app, func() {
cleanup()
}, nil
}