Execution environment
freeact
uses ipybox
as its code execution environment, providing a secure Docker-based IPython runtime. You can either create a custom Docker image with your specific requirements or use prebuilt Docker images.
Custom Docker image
To build a custom ipybox
Docker image with freeact-skills
pre-installed, create a dependencies.txt
file:
freeact-skills = {version = "*", extras = ["all"]}
# Add additional dependencies here if needed
Note
dependencies.txt
must follow the Poetry dependency specification format.
Then build the ipybox
Docker image referencing the dependencies file:
To use the image, reference it in CodeExecutionContainer
when creating an ipybox
Docker container. Use the env
argument to set any API keys required by the pre-installed skills.
Prebuilt Docker images
We provide prebuilt Docker images with variants minimal
, basic
, and example
. These variants have the following dependencies installed:
-
ghcr.io/gradion-ai/ipybox:minimal
: -
ghcr.io/gradion-ai/ipybox:basic
: -
ghcr.io/gradion-ai/ipybox:example
, used for the tutorials:
Note
Prebuilt images run with root privileges. For non-root execution, build a custom Docker image (and find further details in the ipybox
installation guide).
Installing dependencies at runtime
In addition to letting an agent install required dependencies at runtime, you can install extra dependencies at runtime before launching an agent, which is useful for testing custom skills across agent sessions without rebuilding Docker images:
from freeact import execution_environment
async with execution_environment(ipybox_tag="ghcr.io/gradion-ai/ipybox:basic") as env:
# Install the serpapi package in the current environment
await env.executor.execute("!pip install serpapi")
# Import skill modules that depend on serpapi
skill_sources = await env.executor.get_module_sources(
module_names=["my_skill_module_1", "my_skill_module_2"],
)
# Initialize agent with the new skills
# ...
For production use, it's recommended to include frequently used dependencies in a custom Docker image instead.