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
Click to show internal directories.
Click to hide internal directories.