Skip to content

Commit

Permalink
Document dependency installation options
Browse files Browse the repository at this point in the history
  • Loading branch information
krasserm committed Jan 20, 2025
1 parent 514a6e2 commit e7bd41a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ pip install freeact

## Execution environment

`freeact` agents execute code actions in [`ipybox`](https://gradion-ai.github.io/ipybox/), a secure code execution environment.
`freeact` uses [`ipybox`](https://gradion-ai.github.io/ipybox/) as its code execution environment, providing a secure Docker-based IPython runtime. You can either use [pre-built Docker images](https://github.com/gradion-ai/ipybox/pkgs/container/ipybox) or create a [custom Docker image](#custom-docker-image) with your specific requirements.

!!! Note

Pre-built images run with root privileges. For non-root execution, build a [custom Docker image](#custom-docker-image) (and find further details in the `ipybox` [installation guide](https://gradion-ai.github.io/ipybox/installation/)).

### Custom Docker image

Expand Down Expand Up @@ -43,3 +47,25 @@ For running the [tutorials](tutorials/index.md), we provide a custom `ghcr.io/gr
!!! Note

The tutorials run containers locally. Make sure you have [Docker](https://docs.docker.com/get-docker/) installed on your system.

### Installing dependencies at runtime

You can install additional dependencies at runtime before launching an agent, which is useful for testing custom skills across agent sessions without rebuilding Docker images:

```python
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.
3 changes: 3 additions & 0 deletions docs/tutorials/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ The example conversation was initiated with the following `freeact.cli` command.
--8<-- "freeact/examples/commands.txt:cli-skills-weather"
```

!!! Note
If you've developed a custom skill that has external dependencies, you either need to build a [custom Docker image](../installation.md#custom-docker-image) with the required dependencies or need to [install them at runtime](../installation.md#installing-dependencies-at-runtime) prior to launching an agent.

### Example conversation

[![output-use](output/skills-use.svg)](output/skills-use.html){target="_blank"}
Expand Down

0 comments on commit e7bd41a

Please sign in to comment.