Skip to content

Commit

Permalink
fix: handle only images and audios keys in ToolRunner artifact handli…
Browse files Browse the repository at this point in the history
…ng feature
  • Loading branch information
maciejmajek committed Sep 30, 2024
1 parent 364ad48 commit c092be4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rai/rai/agents/tool_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit c092be4

Please sign in to comment.