examples(foundational): added 14d docstrings

This commit is contained in:
Aleix Conchillo Flaqué
2025-10-29 15:23:04 -07:00
parent a997655eac
commit 8fa6cbac51
5 changed files with 45 additions and 1 deletions

View File

@@ -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}")

View File

@@ -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}")

View File

@@ -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}")

View File

@@ -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)

View File

@@ -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}")