in-process

command
v0.46.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Example: fully in-process Assist — text (or speech) in, one useful result out, no SpeechKit server.

It wires a real LLM Generator (Gemini via the genai SDK) into pkg/speechkit/assist.Service, and — when an OpenAI key is present — the public pkg/speechkit/tts router for spoken output. This demonstrates that Assist and TTS are embeddable in-process: the host owns the LLM call and SpeechKit owns the pipeline (codeword/utility/LLM -> one-shot result -> optional TTS).

Audio-in: this demo takes text on stdin to stay portable. To go from speech, transcribe a WAV with a public STT provider first, e.g.

p := openaicompat.NewOpenAISTTProvider(os.Getenv("OPENAI_API_KEY")) // pkg/speechkit/stt
res, _ := p.Transcribe(ctx, wav, stt.TranscribeOpts{})
req := speechkit.AssistRequest{Text: res.Text}

Run:

GOOGLE_AI_API_KEY=... go run ./examples/assist/in-process
# optional spoken output (public TTS router): also set OPENAI_API_KEY

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL