feat(kol): AI assist service + worker

This commit is contained in:
2026-04-17 13:52:01 +08:00
parent 9cf9fac109
commit d55f1276f3
8 changed files with 593 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
package main
import (
"context"
"log"
"os"
"os/signal"
"syscall"
"github.com/geo-platform/tenant-api/internal/bootstrap"
assistworker "github.com/geo-platform/tenant-api/internal/worker/assist"
)
func main() {
configPath := "configs/config.yaml"
if p := os.Getenv("CONFIG_PATH"); p != "" {
configPath = p
}
app, err := bootstrap.New(configPath)
if err != nil {
log.Fatalf("bootstrap: %v", err)
}
defer app.Close()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
assistworker.NewKolAssistWorker(
app.RabbitMQ,
app.KolAssists,
app.LLM,
app.Logger,
app.Config.Generation.WorkerConcurrency,
app.Config.Generation.ArticleTimeout,
).Start(ctx)
app.Logger.Info("kol-assist-worker started")
quit := make(chan os.Signal, 1)
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
<-quit
cancel()
app.Logger.Info("kol-assist-worker shutting down...")
}