This commit is contained in:
@@ -43,7 +43,7 @@ func main() {
|
||||
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
||||
defer cancel()
|
||||
g := glpi.New(cfg.GLPIURL, cfg.GLPIAPIVersion, cfg.GLPIClientID, cfg.GLPIClientSecret, cfg.GLPIUsername, cfg.GLPIPassword, cfg.GLPITimeout)
|
||||
o := ollama.New(cfg.OllamaURL, cfg.OllamaModel, cfg.OllamaEmbeddingModel, cfg.CommunicationLanguage, cfg.CommunicationStyle, cfg.OllamaTimeout)
|
||||
o := ollama.New(cfg.OllamaURL, cfg.OllamaModel, cfg.OllamaEmbeddingModel, cfg.CommunicationLanguage, cfg.CommunicationStyle, cfg.OllamaTimeout, cfg.OllamaNumPredict, cfg.OllamaKeepAlive, cfg.OllamaThink, cfg.OllamaMaxConcurrent)
|
||||
if err := g.ValidateContract(ctx); err != nil {
|
||||
slog.Error("GLPI API contract validation failed", "error", err)
|
||||
os.Exit(1)
|
||||
@@ -68,10 +68,13 @@ func main() {
|
||||
}
|
||||
k, err := knowledge.Load(ctx, cfg.KnowledgeDir, cfg.DataDir, o, cfg.RAGEnabled, cfg.KnowledgeAllowedSources)
|
||||
if err != nil {
|
||||
slog.Warn("knowledge embedding index unavailable; refusing startup while RAG_ENABLED=true", "error", err)
|
||||
if cfg.RAGEnabled {
|
||||
os.Exit(1)
|
||||
}
|
||||
slog.Error("knowledge store initialization failed",
|
||||
"error", err,
|
||||
"knowledge_dir", cfg.KnowledgeDir,
|
||||
"data_dir", cfg.DataDir,
|
||||
"rag_enabled", cfg.RAGEnabled,
|
||||
)
|
||||
os.Exit(1)
|
||||
}
|
||||
m := metrics.New()
|
||||
m.SetKnowledgeDocs(k.Count())
|
||||
|
||||
Reference in New Issue
Block a user