Skip to content

Commit

Permalink
v2.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Oct 16, 2024
1 parent 8bd8b11 commit 7d862ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions phi/docker/app/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from typing import Optional, Dict, Any, Union, List, TYPE_CHECKING

from phi.app.base import AppBase
Expand Down Expand Up @@ -36,6 +37,10 @@ class DockerApp(AppBase):
# Path to mount the resources_dir
resources_dir_container_path: str = "/mnt/resources"

# -*- Phi Volume
# Mount ~/.phi directory from host machine to the container
mount_phi_config: bool = True

# -*- Container Configuration
container_name: Optional[str] = None
container_labels: Optional[Dict[str, str]] = None
Expand Down Expand Up @@ -265,6 +270,17 @@ def get_container_volumes(self, container_context: ContainerContext) -> Dict[str
"mode": "ro",
}

# Add ~/.phi as a volume
if self.mount_phi_config:
phi_config_host_path = str(Path.home().joinpath(".phi"))
phi_config_container_path = f"{self.workspace_dir_container_path}/.phi"
logger.debug(f"Mounting: {phi_config_host_path}")
logger.debug(f" to: {phi_config_container_path}")
container_volumes[phi_config_host_path] = {
"bind": phi_config_container_path,
"mode": "ro",
}

return container_volumes

def get_container_ports(self) -> Dict[str, int]:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "phidata"
version = "2.5.1"
version = "2.5.2"
description = "Build AI Agents with memory, knowledge and tools."
requires-python = ">=3.7"
readme = "README.md"
Expand Down

0 comments on commit 7d862ed

Please sign in to comment.