Skip to content

Commit 97c815f

Browse files
committed
Add docstrings
1 parent 0b524d4 commit 97c815f

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

agents-core/vision_agents/core/llm/llm.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,24 @@ class AudioLLM(LLM, metaclass=abc.ABCMeta):
414414
@abc.abstractmethod
415415
async def simple_audio_response(
416416
self, pcm: PcmData, participant: Optional[Participant] = None
417-
): ...
417+
):
418+
"""
419+
Implement this method to forward PCM audio frames to the LLM.
420+
421+
The audio should be raw PCM matching the model's expected
422+
format (typically 48 kHz mono, 16-bit).
423+
424+
Args:
425+
pcm: PCM audio frame to forward upstream.
426+
participant: Optional participant information for the audio source.
427+
"""
418428

419429
@property
420430
@abc.abstractmethod
421-
def output_audio_track(self) -> AudioStreamTrack: ...
431+
def output_audio_track(self) -> AudioStreamTrack:
432+
"""
433+
An output audio track from the LLM.
434+
"""
422435

423436

424437
class VideoLLM(LLM, metaclass=abc.ABCMeta):
@@ -433,7 +446,16 @@ async def watch_video_track(
433446
self,
434447
track: aiortc.mediastreams.MediaStreamTrack,
435448
shared_forwarder: Optional[VideoForwarder] = None,
436-
) -> None: ...
449+
) -> None:
450+
"""
451+
Implement this method to watch and forward video tracks.
452+
453+
Args:
454+
track: Video track to watch and forward.
455+
shared_forwarder: Optional shared VideoForwarder instance to use instead
456+
of creating a new one. Allows multiple consumers to share the same
457+
video stream.
458+
"""
437459

438460

439461
class OmniLLM(AudioLLM, VideoLLM, metaclass=abc.ABCMeta):

plugins/openai/vision_agents/plugins/openai/openai_realtime.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,15 @@ async def watch_video_track(
279279
track: aiortc.mediastreams.MediaStreamTrack,
280280
shared_forwarder: Optional[VideoForwarder] = None,
281281
) -> None:
282+
"""
283+
Watch the video track and forward data to OpenAI Realtime API.
284+
285+
Args:
286+
track: Video track to watch and forward.
287+
shared_forwarder: Optional shared VideoForwarder instance to use instead
288+
of creating a new one. Allows multiple consumers to share the same
289+
video stream.
290+
"""
282291
await self.rtc.start_video_sender(
283292
track, self.fps, shared_forwarder=shared_forwarder
284293
)

0 commit comments

Comments
 (0)