Spaces:
Runtime error
Runtime error
Merge pull request #37 from EnvisionMindCa/codex/edit-pdf-files-using-terminal-tool
Browse files- README.md +8 -0
- src/config.py +1 -0
- src/vm.py +7 -3
README.md
CHANGED
@@ -60,3 +60,11 @@ python -m bot.discord_bot
|
|
60 |
|
61 |
Any attachments sent to the bot are uploaded to the VM and the bot replies with
|
62 |
their paths so they can be used in later messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
Any attachments sent to the bot are uploaded to the VM and the bot replies with
|
62 |
their paths so they can be used in later messages.
|
63 |
+
|
64 |
+
## VM Configuration
|
65 |
+
|
66 |
+
The Linux VM used for tool execution runs inside a Docker container. By default
|
67 |
+
it pulls the image defined by the ``VM_IMAGE`` environment variable, falling
|
68 |
+
back to ``python:3.11-slim``. This base image includes Python and ``pip`` so
|
69 |
+
packages can be installed immediately. The container has network access enabled
|
70 |
+
which allows fetching additional dependencies as needed.
|
src/config.py
CHANGED
@@ -9,6 +9,7 @@ OLLAMA_HOST: Final[str] = os.getenv("OLLAMA_HOST", "http://localhost:11434")
|
|
9 |
MAX_TOOL_CALL_DEPTH: Final[int] = 5
|
10 |
NUM_CTX: Final[int] = int(os.getenv("OLLAMA_NUM_CTX", "32000"))
|
11 |
UPLOAD_DIR: Final[str] = os.getenv("UPLOAD_DIR", str(Path.cwd() / "uploads"))
|
|
|
12 |
|
13 |
SYSTEM_PROMPT: Final[str] = (
|
14 |
"You are Starlette, a professional AI assistant with advanced tool orchestration. "
|
|
|
9 |
MAX_TOOL_CALL_DEPTH: Final[int] = 5
|
10 |
NUM_CTX: Final[int] = int(os.getenv("OLLAMA_NUM_CTX", "32000"))
|
11 |
UPLOAD_DIR: Final[str] = os.getenv("UPLOAD_DIR", str(Path.cwd() / "uploads"))
|
12 |
+
VM_IMAGE: Final[str] = os.getenv("VM_IMAGE", "python:3.11-slim")
|
13 |
|
14 |
SYSTEM_PROMPT: Final[str] = (
|
15 |
"You are Starlette, a professional AI assistant with advanced tool orchestration. "
|
src/vm.py
CHANGED
@@ -8,7 +8,7 @@ from pathlib import Path
|
|
8 |
|
9 |
from threading import Lock
|
10 |
|
11 |
-
from .config import UPLOAD_DIR
|
12 |
|
13 |
from .log import get_logger
|
14 |
|
@@ -16,10 +16,14 @@ _LOG = get_logger(__name__)
|
|
16 |
|
17 |
|
18 |
class LinuxVM:
|
19 |
-
"""Manage a lightweight
|
|
|
|
|
|
|
|
|
20 |
|
21 |
def __init__(
|
22 |
-
self, image: str =
|
23 |
) -> None:
|
24 |
self._image = image
|
25 |
self._name = f"chat-vm-{uuid.uuid4().hex[:8]}"
|
|
|
8 |
|
9 |
from threading import Lock
|
10 |
|
11 |
+
from .config import UPLOAD_DIR, VM_IMAGE
|
12 |
|
13 |
from .log import get_logger
|
14 |
|
|
|
16 |
|
17 |
|
18 |
class LinuxVM:
|
19 |
+
"""Manage a lightweight Docker-based VM.
|
20 |
+
|
21 |
+
The default image provides Python and pip so packages can be installed
|
22 |
+
immediately. A custom image can be supplied via ``VM_IMAGE``.
|
23 |
+
"""
|
24 |
|
25 |
def __init__(
|
26 |
+
self, image: str = VM_IMAGE, host_dir: str = UPLOAD_DIR
|
27 |
) -> None:
|
28 |
self._image = image
|
29 |
self._name = f"chat-vm-{uuid.uuid4().hex[:8]}"
|