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
10 changes: 7 additions & 3 deletions agents-core/vision_agents/core/agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,9 @@ async def _on_track_added(
):
return

if not self._needs_video():
return

self.logger.info(
f"📺 Track added: {track_type.name} from {participant.user_id}"
)
Expand Down Expand Up @@ -1373,13 +1376,14 @@ def _needs_audio_or_video_input(self) -> bool:
# - Audio processors (for audio analysis)
# Note: VAD and turn detection are helpers for STT/TTS, not standalone consumers
needs_audio = self.stt is not None or len(self.audio_processors) > 0

# Video input needed for:
# - Video processors (for frame analysis)
# - Realtime mode with video (multimodal LLMs)
needs_video = len(self.video_processors) > 0 or _is_video_llm(self.llm)

return needs_audio or needs_video
return needs_audio or self._needs_video()

def _needs_video(self) -> bool:
return len(self.video_processors) > 0 or _is_video_llm(self.llm)

@property
def audio_processors(self) -> list[AudioProcessor]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,9 @@ async def join(

# Open RTC connection and keep it alive for the duration of the returned context manager
connection = await rtc.join(
call, agent.agent_user.id, subscription_config=subscription_config
call,
agent.agent_user.id,
subscription_config=subscription_config,
)
# Store immediately so close() can clean up if join is interrupted
self._real_connection = connection
Expand Down
Loading