Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/agents/tracing/spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SpanError(TypedDict):
message: A human-readable error description
data: Optional dictionary containing additional error context
"""

message: str
data: dict[str, Any] | None

Expand Down
13 changes: 9 additions & 4 deletions src/agents/voice/models/openai_stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,16 @@ async def _configure_session(self) -> None:
await self._websocket.send(
json.dumps(
{
"type": "transcription_session.update",
"type": "session.update",
"session": {
"input_audio_format": "pcm16",
"input_audio_transcription": {"model": self._model},
"turn_detection": self._turn_detection,
"type": "transcription",
"audio": {
"input": {
"format": {"type": "audio/pcm", "rate": 24000},
"transcription": {"model": self._model},
"turn_detection": self._turn_detection,
}
},
},
}
)
Expand Down
6 changes: 3 additions & 3 deletions tests/voice/test_openai_stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ async def test_session_connects_and_configures_successfully():
assert headers.get("OpenAI-Beta") is None
assert headers.get("OpenAI-Log-Session") == "1"

# Check that we sent a 'transcription_session.update' message
# Check that we sent a 'session.update' message
sent_messages = [call.args[0] for call in mock_ws.send.call_args_list]
assert any('"type": "transcription_session.update"' in msg for msg in sent_messages), (
f"Expected 'transcription_session.update' in {sent_messages}"
assert any('"type": "session.update"' in msg for msg in sent_messages), (
f"Expected 'session.update' in {sent_messages}"
)

await session.close()
Expand Down