Testing
Deterministic speech and workflow components for Voice pipeline tests.
VoiceScriptError
UnexpectedVoiceCall
Bases: VoiceScriptError
Raised when a Voice component is called after its script is exhausted.
Source code in src/agents/voice/testing.py
UnconsumedVoiceSteps
Bases: VoiceScriptError
Raised when a test finishes before consuming every configured Voice step.
Source code in src/agents/voice/testing.py
STTCall
dataclass
A recorded static transcription call.
Source code in src/agents/voice/testing.py
STTSessionCall
dataclass
A recorded streamed transcription-session creation call.
Source code in src/agents/voice/testing.py
TTSCall
dataclass
TTSResult
dataclass
ScriptedTranscriptionSession
Bases: StreamedTranscriptionSession
A closable stream of configured transcription turns.
Source code in src/agents/voice/testing.py
assert_complete
Raise when configured transcript turns remain unconsumed.
Source code in src/agents/voice/testing.py
ScriptedSTTModel
Bases: STTModel
A deterministic speech-to-text model for static and streamed audio tests.
Source code in src/agents/voice/testing.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
calls
property
calls: tuple[STTCall, ...]
Return detached snapshots of recorded static transcription calls.
session_calls
property
session_calls: tuple[STTSessionCall, ...]
Return detached snapshots of recorded streamed-session calls.
created_sessions
property
created_sessions: tuple[ScriptedTranscriptionSession, ...]
Return created sessions while preserving their live object identity.
assert_complete
Raise when static transcriptions or sessions remain unconsumed.
Source code in src/agents/voice/testing.py
ScriptedTTSModel
Bases: TTSModel
A deterministic text-to-speech model that yields configured PCM byte chunks.
Source code in src/agents/voice/testing.py
calls
property
calls: tuple[TTSCall, ...]
Return detached snapshots of recorded text-to-speech calls.
assert_complete
Raise when configured TTS results remain unconsumed.
Source code in src/agents/voice/testing.py
ScriptedVoiceWorkflow
Bases: VoiceWorkflowBase
A deterministic Voice workflow that yields configured text fragments per turn.
Source code in src/agents/voice/testing.py
transcriptions
property
Return the recorded workflow transcriptions.
assert_complete
Raise when the startup step or configured workflow turns remain unconsumed.