feat: add e2e tests + benchmarks, fix config API

- e2e_test.go: full voice pipeline (STT->Embed->Rerank->LLM->TTS)
- main.go: fix config field->method references
- Benchmarks: full pipeline 481µs/op
This commit is contained in:
2026-02-20 06:45:21 -05:00
parent 2e66cac1e9
commit f41198d8f2
4 changed files with 194 additions and 6 deletions

12
main.go
View File

@@ -26,18 +26,18 @@ func main() {
ragTopK := getEnvInt("RAG_TOP_K", 10)
ragRerankTopK := getEnvInt("RAG_RERANK_TOP_K", 5)
ragCollection := getEnv("RAG_COLLECTION", "documents")
sttLanguage := getEnv("STT_LANGUAGE", "") // empty = auto-detect
sttLanguage := getEnv("STT_LANGUAGE", "") // empty = auto-detect
ttsLanguage := getEnv("TTS_LANGUAGE", "en")
includeTranscription := getEnvBool("INCLUDE_TRANSCRIPTION", true)
includeSources := getEnvBool("INCLUDE_SOURCES", false)
// Service clients
timeout := 60 * time.Second
stt := clients.NewSTTClient(cfg.STTURL, timeout)
embeddings := clients.NewEmbeddingsClient(cfg.EmbeddingsURL, timeout, "")
reranker := clients.NewRerankerClient(cfg.RerankerURL, timeout)
llm := clients.NewLLMClient(cfg.LLMURL, timeout)
tts := clients.NewTTSClient(cfg.TTSURL, timeout, ttsLanguage)
stt := clients.NewSTTClient(cfg.STTURL(), timeout)
embeddings := clients.NewEmbeddingsClient(cfg.EmbeddingsURL(), timeout, "")
reranker := clients.NewRerankerClient(cfg.RerankerURL(), timeout)
llm := clients.NewLLMClient(cfg.LLMURL(), timeout)
tts := clients.NewTTSClient(cfg.TTSURL(), timeout, ttsLanguage)
milvus := clients.NewMilvusClient(cfg.MilvusHost, cfg.MilvusPort, ragCollection)
h := handler.New("voice.request", cfg)