examples

module
v0.0.0-...-40b058a Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0

README

SpeechKit Examples

These examples show the public framework surface that OSS consumers can import. They are intentionally component-level examples: copy the packages you need, not the entire desktop application.

  • local-dictation/: real local whisper.cpp dictation from an explicit microphone recording or a WAV file, with owned model-process cleanup and no cloud keys.
  • library/: demonstrates dictation wiring with a fake provider and optional synthetic audio; it does not recognize speech.
  • provider-catalog/: reads the current mode contracts and provider catalog used by host applications.
  • embed-companion/: composes wake detections, explicit Hands-Free target routing, Assist requests, optional TTS, and runtime events through the public SDK surface.
  • embed-tts/: demonstrates pkg/speechkit/tts Provider, Router, Service, and provider-kind routing.
  • embed-event-bus/: publishes and consumes the additive wake, skill, companion, Voice-Agent, and TTS events.
  • assist/in-process/: fully in-process Assist — wires any OpenAI-compatible chat endpoint (local llama.cpp via SPEECHKIT_LLM_BASE_URL, or OpenAI) into pkg/speechkit/assist.Service with optional OpenAI TTS output, no SpeechKit server. The base URL must be https (plain http only on loopback), and OPENAI_API_KEY goes only to api.openai.com unless SPEECHKIT_LLM_SEND_OPENAI_KEY_TO names the host; see its README.
  • meeting/synthetic-host/: embeds the public pkg/speechkit/x/meeting runtime with an in-memory synthetic transcript adapter; no mic, STT provider, or cloud call.
  • voice-agent/game-instructor/: end-to-end 15-minute Voice Agent embedded in a Go program (persona/role/sequence TOML + WebSocket client). Reference for the single-prompt "build a voice agent into my app" use case.
  • voice-agent/in-process/: fully in-process Voice Agent — constructs a live.LiveProvider (OpenAI Realtime) and drives a text dialogue with no SpeechKit server in the path.
  • voice-agent/provider-switching/: credential-free provider/profile/model selection using the public pkg/speechkit/voiceagent/live descriptors, ProviderIntent, and config helpers.
  • agentbridge-codex/: External Coding Agent Bridge in exec mode — one prompt in, normalized events out, against the real codex CLI or the fakecodex fixture.

Agent prompts

Assist Voice Companion:

Add a SpeechKit Assist Voice Companion to this Go app. Use examples/embed-companion as the reference, import only pkg/speechkit/{companion,wakeword,assist,tts} plus pkg/speechkit for events, and wire companion.NewHandsFree with TargetMode: companion.TargetAssist. The host owns mic capture and playback. Do not import app/internal/*.

Voice Agent companion:

Build a hands-free SpeechKit Voice Agent companion into this app. Use companion.TargetVoiceAgent for wake activation and examples/voice-agent/game-instructor for the realtime session pattern. Use pkg/speechkit/x/client when talking to speechkit-server, or pkg/speechkit/agentkit when embedding a Go Voice Agent harness. Do not load the Windows client.

Dictation UI-assisted activation:

Add hands-free Dictation activation to this UI app with companion.TargetDictationUIAssisted. Wake can start/stop capture, but committing text must go through a visible target or explicit UI action. Do not synthesize TTS for Dictation.

Run an example from the repository root:

go run ./examples/provider-catalog
go run ./examples/embed-companion
SPEECHKIT_LLM_BASE_URL=http://127.0.0.1:8080/v1 go run ./examples/assist/in-process
go run ./examples/embed-tts
go run ./examples/embed-event-bus
go run ./examples/meeting/synthetic-host
go run ./examples/voice-agent/provider-switching -provider assemblyai
go run ./examples/voice-agent/provider-switching -provider auto -preferred openai,assemblyai -require-native-keyterms

Directories

Path Synopsis
Command agentbridge-codex demonstrates the External Coding Agent Bridge in exec mode: one prompt in, normalized events out.
Command agentbridge-codex demonstrates the External Coding Agent Bridge in exec mode: one prompt in, normalized events out.
assist
in-process command
Example: fully in-process Assist — text in, one answer out, no SpeechKit server.
Example: fully in-process Assist — text in, one answer out, no SpeechKit server.
Example: wiring SpeechKit with a fake provider, not real speech recognition.
Example: wiring SpeechKit with a fake provider, not real speech recognition.
Local dictation through the public SDK, using a WAV file or explicit microphone capture.
Local dictation through the public SDK, using a WAV file or explicit microphone capture.
meeting
synthetic-host command
Example: embed the public Meeting runtime in a Go host with synthetic input.
Example: embed the public Meeting runtime in a Go host with synthetic input.
Example: reading SpeechKit's public mode and provider catalog.
Example: reading SpeechKit's public mode and provider catalog.
voice-agent
game-instructor command
Example: 15-minute Voice-Agent game instructor.
Example: 15-minute Voice-Agent game instructor.
in-process command
Example: fully in-process Voice Agent — no SpeechKit server in the path.
Example: fully in-process Voice Agent — no SpeechKit server in the path.
provider-switching command
Package main demonstrates provider/profile/model selection without live credentials.
Package main demonstrates provider/profile/model selection without live credentials.

Jump to

Keyboard shortcuts

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