Billy D. 3585d81ff5
Some checks failed
CI / Lint (push) Failing after 2m44s
CI / Test (push) Successful in 3m7s
CI / Release (push) Has been skipped
CI / Notify Downstream (chat-handler) (push) Has been skipped
CI / Notify Downstream (pipeline-bridge) (push) Has been skipped
CI / Notify Downstream (stt-module) (push) Has been skipped
CI / Notify Downstream (tts-module) (push) Has been skipped
CI / Notify Downstream (voice-assistant) (push) Has been skipped
CI / Notify (push) Successful in 2s
feat: add StreamGenerate for real SSE streaming from LLM
- Add postJSONStream() for incremental response body reading
- Add LLMClient.StreamGenerate() with SSE parsing and onToken callback
- Supports stream:true, parses data: lines, handles [DONE] sentinel
- Graceful partial-text return on stream interruption
- 9 new tests covering happy path, edge cases, cancellation
2026-02-20 17:55:01 -05:00
2026-02-02 01:35:14 +00:00

handler-base

Go module providing shared infrastructure for NATS-based handler services.

Packages

Package Purpose
config Environment-based configuration via struct fields
health HTTP health/readiness server for Kubernetes probes
natsutil NATS/JetStream client with msgpack serialization
telemetry OpenTelemetry tracing and metrics setup
clients HTTP clients for LLM, embeddings, reranker, STT, TTS
handler Base Handler runner wiring NATS + health + telemetry

Usage

package main

import (
    "context"
    "git.daviestechlabs.io/daviestechlabs/handler-base/config"
    "git.daviestechlabs.io/daviestechlabs/handler-base/handler"
    "github.com/nats-io/nats.go"
)

func main() {
    cfg := config.Load()
    cfg.ServiceName = "my-service"

    h := handler.New("my.subject", cfg)
    h.OnMessage(func(ctx context.Context, msg *nats.Msg, data map[string]any) (map[string]any, error) {
        return map[string]any{"ok": true}, nil
    })
    h.Run()
}

Testing

go test ./...
Description
No description provided
Readme MIT 903 KiB
Languages
Go 100%