From c092be4b3dd770f9d180126767decd4e6f8802a1 Mon Sep 17 00:00:00 2001 From: Maciej Majek Date: Mon, 30 Sep 2024 13:47:53 +0200 Subject: [PATCH] fix: handle only images and audios keys in ToolRunner artifact handling feature --- src/rai/rai/agents/tool_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rai/rai/agents/tool_runner.py b/src/rai/rai/agents/tool_runner.py index 4522ef7e..3df45329 100644 --- a/src/rai/rai/agents/tool_runner.py +++ b/src/rai/rai/agents/tool_runner.py @@ -109,7 +109,10 @@ def run_one(call: ToolCall): artifact = cast(MultimodalArtifact, artifact) store_artifacts(output.tool_call_id, [artifact]) - if artifact is not None: # multimodal case + if artifact is not None and ( + len(artifact.get("images", [])) > 0 + or len(artifact.get("audios", [])) > 0 + ): # multimodal case, we currently support images and audios artifacts return ToolMultimodalMessage( content=str_output(output.content), name=call["name"],