add a warning at least for when bwrap is not available for code execution

This commit is contained in:
Ashwin Bharambe 2024-12-05 20:54:28 -08:00
parent 66440e2c20
commit cdfc98cf08

View file

@ -6,9 +6,12 @@
import json import json
import logging import logging
import shutil
import uuid import uuid
from typing import AsyncGenerator from typing import AsyncGenerator
from termcolor import colored
from llama_stack.apis.inference import Inference from llama_stack.apis.inference import Inference
from llama_stack.apis.memory import Memory from llama_stack.apis.memory import Memory
from llama_stack.apis.memory_banks import MemoryBanks from llama_stack.apis.memory_banks import MemoryBanks
@ -44,6 +47,15 @@ class MetaReferenceAgentsImpl(Agents):
async def initialize(self) -> None: async def initialize(self) -> None:
self.persistence_store = await kvstore_impl(self.config.persistence_store) 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( async def create_agent(
self, self,
agent_config: AgentConfig, agent_config: AgentConfig,