feat: wire real LLM runner via third-one or OpenAI-compatible API

This commit is contained in:
user
2026-04-28 15:48:37 +09:00
parent 9b0bc172ef
commit dced20a9af
8 changed files with 486 additions and 5 deletions

View File

@@ -11,6 +11,7 @@ import (
"tutor/internal/httpapi"
"tutor/internal/interview"
"tutor/internal/learnermemory"
"tutor/internal/llm"
"tutor/internal/ontology"
"tutor/internal/progression"
"tutor/internal/teachingassets"
@@ -18,7 +19,15 @@ import (
)
func NewServer(cfg config.Config) *http.Server {
runner := workflows.NewStubRunner()
var runner workflows.Runner
if cfg.HasLLM() {
client := llm.NewClient(cfg.LLMEndpoint, cfg.LLMAPIKey, cfg.ModelKey)
runner = workflows.NewLLMRunner(client)
log.Printf("using llm runner: endpoint=%s model=%s", cfg.LLMEndpoint, cfg.ModelKey)
} else {
runner = workflows.NewStubRunner()
log.Println("using stub runner (TUTOR_LLM_ENDPOINT not set)")
}
var interviewStore interview.Store
var memoryStore learnermemory.Store