examples(foundational): associate image requests to function calls

This commit is contained in:
Aleix Conchillo Flaqué
2026-01-13 11:57:12 -08:00
parent e268c73c41
commit 027e54425a
7 changed files with 113 additions and 45 deletions

View File

@@ -55,9 +55,15 @@ async def fetch_user_image(params: FunctionCallParams):
logger.debug(f"Requesting image with user_id={user_id}, question={question}")
# Request a user image frame and indicate that it should be added to the
# context.
# context. Also associate it to the function call.
await params.llm.push_frame(
UserImageRequestFrame(user_id=user_id, text=question, append_to_context=True),
UserImageRequestFrame(
user_id=user_id,
text=question,
append_to_context=True,
function_name=params.function_name,
tool_call_id=params.tool_call_id,
),
FrameDirection.UPSTREAM,
)