Refactor Worker Initialization to Integrate GLM SDK
- Updated the worker initialization process to include the new GLM SDK, enhancing the worker's capabilities for translation tasks. - Modified the InitWorker function and NewNoticeWorker constructor to accept the GLM service, ensuring a cohesive integration. - Implemented the GLM service initialization and logging for successful setup, improving maintainability and usability. - Updated the NoticeWorker to utilize the GLM SDK for translating notice titles and descriptions, enhancing functionality and user experience.
This commit is contained in:
+3
-10
@@ -37,18 +37,11 @@ func main() {
|
||||
// Initialize notification service
|
||||
notificationService := bootstrap.InitNotificationService(config.Notification, appLogger)
|
||||
|
||||
// Initialize ollama service
|
||||
// ollamaSDK := bootstrap.InitOllamaService(config.Ollama, appLogger)
|
||||
// aiModels, err := ollamaSDK.ListModels(context.Background())
|
||||
// if err != nil {
|
||||
// appLogger.Error("Failed to list ollama models", map[string]interface{}{
|
||||
// "error": err.Error(),
|
||||
// })
|
||||
// }
|
||||
// appLogger.Info("Ollama models", map[string]interface{}{"models": aiModels})
|
||||
// Initialize GLM service
|
||||
glmService := bootstrap.InitGLMService(config.GLM, appLogger)
|
||||
|
||||
// Initialize Worker
|
||||
bootstrap.InitWorker(*config, mongoManager, appLogger, notificationService)
|
||||
bootstrap.InitWorker(*config, mongoManager, appLogger, notificationService, glmService)
|
||||
|
||||
// Set up signal handling for graceful shutdown
|
||||
signalChan := make(chan os.Signal, 1)
|
||||
|
||||
Reference in New Issue
Block a user