Skip to content

Commit 0defcc4

Browse files
committed
address mypy typecheck issues
1 parent 9c9fa43 commit 0defcc4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/realtime/app/server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from agents.realtime import RealtimeRunner, RealtimeSession, RealtimeSessionEvent
1515
from agents.realtime.config import RealtimeUserInputMessage
16+
from agents.realtime.items import RealtimeItem
1617
from agents.realtime.model import RealtimeModelConfig
1718
from agents.realtime.model_inputs import RealtimeModelSendRawMessage
1819

@@ -118,9 +119,9 @@ async def _process_events(self, session_id: str):
118119
print(e)
119120
logger.error(f"Error processing events for session {session_id}: {e}")
120121

121-
def _sanitize_history_item(self, item: Any) -> dict[str, Any]:
122+
def _sanitize_history_item(self, item: RealtimeItem) -> dict[str, Any]:
122123
"""Remove large binary payloads from history items while keeping transcripts."""
123-
item_dict = item.model_dump(mode="json")
124+
item_dict = item.model_dump()
124125
content = item_dict.get("content")
125126
if isinstance(content, list):
126127
sanitized_content: list[Any] = []

0 commit comments

Comments
 (0)