Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 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
12 changes: 9 additions & 3 deletions code/backend/app/realtime/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ async def process_realtime_messages(self):
async for event in self.session:
logger.info(f"Event received: {event.type}")
try:
if event.data:
if settings.DEBUG and event.data:
truncated_data = _truncate_str(str(event.data), 200)
logger.debug(f"Data: '{truncated_data}'")
logger.debug(f"Event Info: '{event.info}'")

except Exception as e:
logger.warning(f"Error processing events data: {e}")

Expand All @@ -195,9 +197,13 @@ async def process_realtime_messages(self):
elif event.type == "handoff":
pass
elif event.type == "tool_start":
logger.info(f"Tool Call: {event.tool.name} - {event.info}")
logger.info(
f"Tool call start detected. Agent: '{event.agent}', Tool Name: '{event.tool.name}', Tool arguments: '{event.arguments}''"
)
elif event.type == "tool_end":
pass
logger.info(
f"Tool call end detected. Agent: '{event.agent}', Tool Name: '{event.tool.name}', Tool arguments: '{event.arguments}', Tool output: '{event.output}'"
)
elif event.type == "audio":
if event.audio and event.audio.data:
await self.return_audio(event.audio.data)
Expand Down
Loading
Loading