voiceagent

package
v0.72.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package voiceagent is the Voice Agent kernel — realtime audio-to-audio session manager backed by a realtime provider, with Persona/Role/Sequence resolution from internal/voicebehavior. The local desktop provider (cmd/speechkit) and the server adapter (internal/server/voiceagent) both depend on this package; the kernel itself stays free of OS or HTTP plumbing.

Audit 2026-05-24 maintainability sweep.

Index

Constants

View Source
const (
	StateInactive     = live.StateInactive
	StateConnecting   = live.StateConnecting
	StateListening    = live.StateListening
	StateProcessing   = live.StateProcessing
	StateSpeaking     = live.StateSpeaking
	StateRecovering   = live.StateRecovering
	StateDeactivating = live.StateDeactivating

	ThinkingLevelOff    = live.ThinkingLevelOff
	ThinkingLevelLow    = live.ThinkingLevelLow
	ThinkingLevelMedium = live.ThinkingLevelMedium
	ThinkingLevelHigh   = live.ThinkingLevelHigh

	StartSensitivityLow    = live.StartSensitivityLow
	StartSensitivityMedium = live.StartSensitivityMedium
	StartSensitivityHigh   = live.StartSensitivityHigh

	EndSensitivityLow    = live.EndSensitivityLow
	EndSensitivityMedium = live.EndSensitivityMedium
	EndSensitivityHigh   = live.EndSensitivityHigh

	ActivityHandlingUnspecified               = live.ActivityHandlingUnspecified
	ActivityHandlingNoInterrupt               = live.ActivityHandlingNoInterrupt
	ActivityHandlingStartOfActivityInterrupts = live.ActivityHandlingStartOfActivityInterrupts

	TurnCoverageUnspecified               = live.TurnCoverageUnspecified
	TurnCoverageTurnIncludesOnlyActivity  = live.TurnCoverageTurnIncludesOnlyActivity
	TurnCoverageTurnIncludesAllInput      = live.TurnCoverageTurnIncludesAllInput
	TurnCoverageTurnIncludesAudioActivity = live.TurnCoverageTurnIncludesAudioActivity

	ToolBehaviorUnspecified = live.ToolBehaviorUnspecified
	ToolBehaviorBlocking    = live.ToolBehaviorBlocking
	ToolBehaviorNonBlocking = live.ToolBehaviorNonBlocking

	ToolResponseSchedulingUnspecified = live.ToolResponseSchedulingUnspecified
	ToolResponseSchedulingSilent      = live.ToolResponseSchedulingSilent
	ToolResponseSchedulingWhenIdle    = live.ToolResponseSchedulingWhenIdle
	ToolResponseSchedulingInterrupt   = live.ToolResponseSchedulingInterrupt
)
View Source
const DefaultFoundryRealtimeModel = livefoundry.DefaultRealtimeModel

DefaultFoundryRealtimeModel is the public runtime default deployment name for Microsoft Foundry-backed Voice Agent sessions.

View Source
const DefaultOpenAIRealtimeModel = liveopenai.DefaultRealtimeModel

DefaultOpenAIRealtimeModel is the public runtime default for OpenAI-backed Voice Agent sessions.

Variables

View Source
var (
	NewOpenAILive     = liveopenai.New
	NewFoundryLive    = livefoundry.New
	NewVoiceLive      = livevoicelive.New
	NewDeepgramLive   = livedeepgram.New
	NewAssemblyAILive = liveassemblyai.New
)

Provider constructors are exposed as function values so this bridge stays signature-agnostic: changing a constructor's parameters in the live package does not require editing this file.

Functions

func RenderHostInstructionUpdate added in v0.28.2

func RenderHostInstructionUpdate(cfg LiveConfig) string

RenderHostInstructionUpdate is a thin wrapper around live.RenderHostInstructionUpdate.

Types

type ActivityDetectionPolicy added in v0.18.0

type ActivityDetectionPolicy = live.ActivityDetectionPolicy

type ActivityHandling added in v0.18.0

type ActivityHandling = live.ActivityHandling

type AssemblyAILive added in v0.47.0

type AssemblyAILive = liveassemblyai.Provider

Concrete realtime providers (formerly internal/voiceagent.{OpenAILive,…}).

type Callbacks

type Callbacks = live.Callbacks

type ContextCompressionPolicy added in v0.18.0

type ContextCompressionPolicy = live.ContextCompressionPolicy

type DeepgramAudioSettings added in v0.54.10

type DeepgramAudioSettings = livedeepgram.AudioSettings

DeepgramAudioSettings configures the Deepgram listen/speak legs.

type DeepgramLive added in v0.43.0

type DeepgramLive = livedeepgram.Provider

Concrete realtime providers (formerly internal/voiceagent.{OpenAILive,…}).

type EndSensitivity added in v0.18.0

type EndSensitivity = live.EndSensitivity

type FoundryLive added in v0.67.5

type FoundryLive = livefoundry.Provider

Concrete realtime providers (formerly internal/voiceagent.{OpenAILive,…}).

type IdleConfig

type IdleConfig = live.IdleConfig

func DefaultIdleConfig

func DefaultIdleConfig() IdleConfig

DefaultIdleConfig is a thin wrapper around live.DefaultIdleConfig.

type IdleTimer

type IdleTimer = live.IdleTimer

func NewIdleTimer

func NewIdleTimer(cfg IdleConfig, session *Session) *IdleTimer

NewIdleTimer is a thin wrapper around live.NewIdleTimer.

type LiveConfig

type LiveConfig = live.LiveConfig

type LiveInstructionUpdater added in v0.28.2

type LiveInstructionUpdater = live.LiveInstructionUpdater

type LiveMessage

type LiveMessage = live.LiveMessage

type LivePolicies added in v0.18.0

type LivePolicies = live.LivePolicies

type LiveProvider

type LiveProvider = live.LiveProvider

type LiveReconnector added in v0.18.0

type LiveReconnector = live.LiveReconnector

type LocalVoiceAgentDeps added in v0.34.9

type LocalVoiceAgentDeps struct {
	STT             cascaded.STT
	Agent           cascaded.Agent
	TTS             cascaded.TTS
	SpeakerStreamer cascaded.SpeakerStreamer
	Config          cascaded.Config
}

LocalVoiceAgentDeps bundles the kernel-level routers and flows the Device-Target wires into the local Voice Agent provider.

Why a separate name from cascaded.Deps: a Device-Target caller cares about "I'm wiring the LOCAL provider", not about the underlying cascaded turn-based architecture. The latter is an implementation detail of the local path.

type LocalVoiceAgentProvider added in v0.34.9

type LocalVoiceAgentProvider struct {
	// contains filtered or unexported fields
}

LocalVoiceAgentProvider is the Device-Target-side local Voice Agent provider. It wraps a cascaded.Provider and adapts its minimal SessionConfig / Message types to the public live.LiveConfig / live.LiveMessage interface so a Wails session can drive it the same way it drives a native realtime adapter.

func NewLocalVoiceAgentProvider added in v0.34.9

func NewLocalVoiceAgentProvider(deps LocalVoiceAgentDeps) *LocalVoiceAgentProvider

NewLocalVoiceAgentProvider constructs the local provider. Panics if STT or Agent is nil — these are hard requirements; nothing in the Device-Target should ever construct this without them.

func (*LocalVoiceAgentProvider) Close added in v0.34.9

func (p *LocalVoiceAgentProvider) Close() error

Close delegates.

func (*LocalVoiceAgentProvider) Connect added in v0.34.9

Connect translates the rich live.LiveConfig into cascaded.SessionConfig.

func (*LocalVoiceAgentProvider) Name added in v0.34.9

func (p *LocalVoiceAgentProvider) Name() string

Name overrides cascaded.Provider.Name() so observability tells the Device-Target-embedded path apart from the Server-Target wiring.

func (*LocalVoiceAgentProvider) Receive added in v0.34.9

Receive blocks for the next cascaded.Message and adapts it into a live.LiveMessage.

func (*LocalVoiceAgentProvider) SendAudio added in v0.34.9

func (p *LocalVoiceAgentProvider) SendAudio(chunk []byte) error

SendAudio delegates.

func (*LocalVoiceAgentProvider) SendAudioStreamEnd added in v0.34.9

func (p *LocalVoiceAgentProvider) SendAudioStreamEnd() error

SendAudioStreamEnd delegates.

func (*LocalVoiceAgentProvider) SendText added in v0.34.9

func (p *LocalVoiceAgentProvider) SendText(text string) error

SendText delegates.

func (*LocalVoiceAgentProvider) SendToolResponse added in v0.34.9

func (p *LocalVoiceAgentProvider) SendToolResponse(_ live.ToolResponse) error

SendToolResponse is a no-op. The local cascaded path is turn-based and does not surface tool calls upstream — clients that ask for tool calls fall back to the cloud Voice Agent.

func (*LocalVoiceAgentProvider) UpdateInstructions added in v0.34.9

func (p *LocalVoiceAgentProvider) UpdateInstructions(ctx context.Context, cfg live.LiveConfig) error

UpdateInstructions translates rich live.LiveConfig to SessionConfig for mid-session prompt updates. Implementing this also satisfies live.LiveInstructionUpdater.

type OpenAILive added in v0.31.0

type OpenAILive = liveopenai.Provider

Concrete realtime providers (formerly internal/voiceagent.{OpenAILive,…}).

type Session

type Session = live.Session

func NewSession

func NewSession(provider LiveProvider, callbacks Callbacks) *Session

NewSession is a thin wrapper around live.NewSession so existing non-OSS call sites can continue to construct sessions through this package.

type StartSensitivity added in v0.18.0

type StartSensitivity = live.StartSensitivity

type State

type State = live.State

type ThinkingLevel added in v0.18.0

type ThinkingLevel = live.ThinkingLevel

type ThinkingPolicy added in v0.18.0

type ThinkingPolicy = live.ThinkingPolicy

type ToolBehavior added in v0.18.0

type ToolBehavior = live.ToolBehavior

type ToolCall added in v0.18.0

type ToolCall = live.ToolCall

type ToolDefinition added in v0.18.0

type ToolDefinition = live.ToolDefinition

type ToolResponse added in v0.18.0

type ToolResponse = live.ToolResponse

type ToolResponseScheduling added in v0.18.0

type ToolResponseScheduling = live.ToolResponseScheduling

type TurnCoverage added in v0.18.0

type TurnCoverage = live.TurnCoverage

type VoiceLive added in v0.68.24

type VoiceLive = livevoicelive.Provider

Concrete realtime providers (formerly internal/voiceagent.{OpenAILive,…}).

type WorkflowConfig added in v0.28.2

type WorkflowConfig = live.WorkflowConfig

type WorkflowStep added in v0.28.2

type WorkflowStep = live.WorkflowStep

Directories

Path Synopsis
Package cascaded re-exports the public pkg/speechkit/voiceagent/cascaded turn-based Voice Agent provider so existing kernel/adapter call sites (internal/server/voiceagent, internal/voiceagent, cmd/sk-localprobe, scripts) compile unchanged.
Package cascaded re-exports the public pkg/speechkit/voiceagent/cascaded turn-based Voice Agent provider so existing kernel/adapter call sites (internal/server/voiceagent, internal/voiceagent, cmd/sk-localprobe, scripts) compile unchanged.

Jump to

Keyboard shortcuts

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