From cdfc98cf08ce12cadf101020b3916fde2ffd268f Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 5 Dec 2024 20:54:28 -0800 Subject: [PATCH] add a warning at least for when `bwrap` is not available for code execution --- .../providers/inline/agents/meta_reference/agents.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/llama_stack/providers/inline/agents/meta_reference/agents.py b/llama_stack/providers/inline/agents/meta_reference/agents.py index f33aadde3..0b0bb6e27 100644 --- a/llama_stack/providers/inline/agents/meta_reference/agents.py +++ b/llama_stack/providers/inline/agents/meta_reference/agents.py @@ -6,9 +6,12 @@ import json import logging +import shutil import uuid from typing import AsyncGenerator +from termcolor import colored + from llama_stack.apis.inference import Inference from llama_stack.apis.memory import Memory from llama_stack.apis.memory_banks import MemoryBanks @@ -44,6 +47,15 @@ class MetaReferenceAgentsImpl(Agents): async def initialize(self) -> None: self.persistence_store = await kvstore_impl(self.config.persistence_store) + # check if "bwrap" is available + if not shutil.which("bwrap"): + print( + colored( + "Warning: `bwrap` is not available. Code interpreter tool will not work correctly.", + "yellow", + ) + ) + async def create_agent( self, agent_config: AgentConfig,