From 42f0490414d662c7af5ec9eb56fbe0a3d5c30ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 30 Oct 2025 13:23:36 -0700 Subject: [PATCH] examples(foundational): 14-* show how to tell the LLM we are capturing an image --- examples/foundational/14d-function-calling-anthropic-video.py | 4 ++++ examples/foundational/14d-function-calling-aws-video.py | 4 ++++ .../foundational/14d-function-calling-gemini-flash-video.py | 4 ++++ examples/foundational/14d-function-calling-moondream-video.py | 4 ++++ examples/foundational/14d-function-calling-openai-video.py | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/examples/foundational/14d-function-calling-anthropic-video.py b/examples/foundational/14d-function-calling-anthropic-video.py index db4c75c48..b21b9fdba 100644 --- a/examples/foundational/14d-function-calling-anthropic-video.py +++ b/examples/foundational/14d-function-calling-anthropic-video.py @@ -59,6 +59,10 @@ async def fetch_user_image(params: FunctionCallParams): await params.result_callback(None) + # Instead of None, it's possible to also provide a tool call answer to + # tell the LLM that we are grabbing the image to analyze. + # await params.result_callback({"result": "Image is being captured."}) + # We store functions so objects (e.g. SileroVADAnalyzer) don't get # instantiated. The function will be called when the desired transport gets diff --git a/examples/foundational/14d-function-calling-aws-video.py b/examples/foundational/14d-function-calling-aws-video.py index dcd8cf202..dffee193c 100644 --- a/examples/foundational/14d-function-calling-aws-video.py +++ b/examples/foundational/14d-function-calling-aws-video.py @@ -59,6 +59,10 @@ async def fetch_user_image(params: FunctionCallParams): await params.result_callback(None) + # Instead of None, it's possible to also provide a tool call answer to + # tell the LLM that we are grabbing the image to analyze. + # await params.result_callback({"result": "Image is being captured."}) + # We store functions so objects (e.g. SileroVADAnalyzer) don't get # instantiated. The function will be called when the desired transport gets diff --git a/examples/foundational/14d-function-calling-gemini-flash-video.py b/examples/foundational/14d-function-calling-gemini-flash-video.py index 7a8eecca1..acb977c68 100644 --- a/examples/foundational/14d-function-calling-gemini-flash-video.py +++ b/examples/foundational/14d-function-calling-gemini-flash-video.py @@ -59,6 +59,10 @@ async def fetch_user_image(params: FunctionCallParams): await params.result_callback(None) + # Instead of None, it's possible to also provide a tool call answer to + # tell the LLM that we are grabbing the image to analyze. + # await params.result_callback({"result": "Image is being captured."}) + # We store functions so objects (e.g. SileroVADAnalyzer) don't get # instantiated. The function will be called when the desired transport gets diff --git a/examples/foundational/14d-function-calling-moondream-video.py b/examples/foundational/14d-function-calling-moondream-video.py index a14ba14e5..3a7889c00 100644 --- a/examples/foundational/14d-function-calling-moondream-video.py +++ b/examples/foundational/14d-function-calling-moondream-video.py @@ -61,6 +61,10 @@ async def fetch_user_image(params: FunctionCallParams): await params.result_callback(None) + # Instead of None, it's possible to also provide a tool call answer to + # tell the LLM that we are grabbing the image to analyze. + # await params.result_callback({"result": "Image is being captured."}) + # We store functions so objects (e.g. SileroVADAnalyzer) don't get # instantiated. The function will be called when the desired transport gets diff --git a/examples/foundational/14d-function-calling-openai-video.py b/examples/foundational/14d-function-calling-openai-video.py index 2dbdc7e63..ec6fb008b 100644 --- a/examples/foundational/14d-function-calling-openai-video.py +++ b/examples/foundational/14d-function-calling-openai-video.py @@ -60,6 +60,10 @@ async def fetch_user_image(params: FunctionCallParams): await params.result_callback(None) + # Instead of None, it's possible to also provide a tool call answer to + # tell the LLM that we are grabbing the image to analyze. + # await params.result_callback({"result": "Image is being captured."}) + # We store functions so objects (e.g. SileroVADAnalyzer) don't get # instantiated. The function will be called when the desired transport gets