refactor: Moves the LLM factory initialization logic to the dao package. (#13476)

### What problem does this PR solve?

refactor: Moves the LLM factory initialization logic to the `dao`
package.

Removes the `init_data` package and integrates the LLM factory
initialization functionality into the `dao` package.
Adds a `utility` package to provide general utility functions.
Updates `server_main.go` to use the new initialization path.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
chanx
2026-03-10 10:35:55 +08:00
committed by GitHub
parent 88a40b95a2
commit 02108772d8
4 changed files with 204 additions and 163 deletions

View File

@ -6,8 +6,7 @@ import (
"net/http"
"os"
"os/signal"
"ragflow/internal/common"
"ragflow/internal/init_data"
"ragflow/internal/common"
"ragflow/internal/server"
"ragflow/internal/utility"
"strings"
@ -67,7 +66,7 @@ func main() {
}
// Initialize LLM factory data models from configuration file
if err := init_data.InitLLMFactory(); err != nil {
if err := dao.InitLLMFactory(); err != nil {
logger.Error("Failed to initialize LLM factory", err)
} else {
logger.Info("LLM factory initialized successfully")