diff --git a/examples/foundational/14d-function-calling-anthropic-video.py b/examples/foundational/14d-function-calling-anthropic-video.py index a4daed481..bf35b9648 100644 --- a/examples/foundational/14d-function-calling-anthropic-video.py +++ b/examples/foundational/14d-function-calling-anthropic-video.py @@ -38,6 +38,14 @@ load_dotenv(override=True) async def fetch_user_image(params: FunctionCallParams): + """Fetch the user image and push it to the LLM. + + When called, this function pushes a UserImageRequestFrame upstream to the + transport. As a result, the transport will request the user image and push a + UserImageRawFrame downstream associated to this request. When the + UserImageRawFrame reaches the LLM assistant aggregator, the image will be + added to the context. + """ user_id = params.arguments["user_id"] question = params.arguments["question"] logger.debug(f"Requesting image with user_id={user_id}, question={question}") diff --git a/examples/foundational/14d-function-calling-aws-video.py b/examples/foundational/14d-function-calling-aws-video.py index 78bacbedf..20367bad2 100644 --- a/examples/foundational/14d-function-calling-aws-video.py +++ b/examples/foundational/14d-function-calling-aws-video.py @@ -38,6 +38,14 @@ load_dotenv(override=True) async def fetch_user_image(params: FunctionCallParams): + """Fetch the user image and push it to the LLM. + + When called, this function pushes a UserImageRequestFrame upstream to the + transport. As a result, the transport will request the user image and push a + UserImageRawFrame downstream associated to this request. When the + UserImageRawFrame reaches the LLM assistant aggregator, the image will be + added to the context. + """ user_id = params.arguments["user_id"] question = params.arguments["question"] logger.debug(f"Requesting image with user_id={user_id}, question={question}") diff --git a/examples/foundational/14d-function-calling-gemini-flash-video.py b/examples/foundational/14d-function-calling-gemini-flash-video.py index a669e1e46..867fc3180 100644 --- a/examples/foundational/14d-function-calling-gemini-flash-video.py +++ b/examples/foundational/14d-function-calling-gemini-flash-video.py @@ -38,6 +38,14 @@ load_dotenv(override=True) async def fetch_user_image(params: FunctionCallParams): + """Fetch the user image and push it to the LLM. + + When called, this function pushes a UserImageRequestFrame upstream to the + transport. As a result, the transport will request the user image and push a + UserImageRawFrame downstream associated to this request. When the + UserImageRawFrame reaches the LLM assistant aggregator, the image will be + added to the context. + """ user_id = params.arguments["user_id"] question = params.arguments["question"] logger.debug(f"Requesting image with user_id={user_id}, question={question}") diff --git a/examples/foundational/14d-function-calling-moondream-video.py b/examples/foundational/14d-function-calling-moondream-video.py index 0bad950ed..eb06556a9 100644 --- a/examples/foundational/14d-function-calling-moondream-video.py +++ b/examples/foundational/14d-function-calling-moondream-video.py @@ -47,6 +47,12 @@ load_dotenv(override=True) async def fetch_user_image(params: FunctionCallParams): + """Fetch the user image. + + When called, this function pushes a UserImageRequestFrame upstream to the + transport. As a result, the transport will request the user image and push a + UserImageRawFrame downstream. + """ user_id = params.arguments["user_id"] question = params.arguments["question"] logger.debug(f"Requesting image with user_id={user_id}, question={question}") @@ -61,7 +67,13 @@ async def fetch_user_image(params: FunctionCallParams): class UserImageProcessor(FrameProcessor): - """Converts incoming user images into context frames.""" + """Converts incoming user images into vision frames. + + This processor handles the UserImageRawFrame from the transport, converts it + to a VisionImageRawFrame and pushes it downstream so it can be handled by a + vision service. + + """ async def process_frame(self, frame: Frame, direction: FrameDirection): await super().process_frame(frame, direction) diff --git a/examples/foundational/14d-function-calling-openai-video.py b/examples/foundational/14d-function-calling-openai-video.py index c6320b1ec..c09d39231 100644 --- a/examples/foundational/14d-function-calling-openai-video.py +++ b/examples/foundational/14d-function-calling-openai-video.py @@ -39,6 +39,14 @@ load_dotenv(override=True) async def fetch_user_image(params: FunctionCallParams): + """Fetch the user image and push it to the LLM. + + When called, this function pushes a UserImageRequestFrame upstream to the + transport. As a result, the transport will request the user image and push a + UserImageRawFrame downstream associated to this request. When the + UserImageRawFrame reaches the LLM assistant aggregator, the image will be + added to the context. + """ user_id = params.arguments["user_id"] question = params.arguments["question"] logger.debug(f"Requesting image with user_id={user_id}, question={question}")