Skip to content

Commit e4c47d3

Browse files
committed
chore(templates): align OpenAGI env handling
1 parent 2d5d8d5 commit e4c47d3

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Kernel API key - get yours at https://dashboard.onkernel.com
2-
KERNEL_API_KEY=your_kernel_api_key
1+
## OpenAGI API key (required)
2+
OAGI_API_KEY=
33

4-
# OpenAGI API key - get yours at https://developer.agiopen.org
5-
OAGI_API_KEY=your_openagi_api_key
4+
## Optional override (defaults to https://api.agiopen.org)
5+
OAGI_BASE_URL=https://api.agiopen.org

pkg/templates/python/openagi-computer-use/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Best for structured workflows with predefined steps (todos).
2323
2. Deploy the app:
2424
```bash
2525
kernel login
26-
kernel deploy main.py -e OAGI_API_KEY=your_api_key --force
26+
cp .env.example .env
27+
kernel deploy main.py --env-file .env
2728
```
2829

2930
## Usage

pkg/templates/python/openagi-computer-use/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
sys.modules["mouseinfo"] = mock_mouseinfo
1616
sys.modules["pyautogui"] = mock_pyautogui
1717

18-
# Set OAGI API base URL (no .env file in deployed environment)
18+
# Load local env vars from a .env file when running locally.
19+
# In deployed environments this is typically a no-op.
20+
from dotenv import load_dotenv
21+
22+
load_dotenv()
23+
24+
# Set OAGI API base URL (can be overridden via environment variables).
1925
os.environ.setdefault("OAGI_BASE_URL", "https://api.agiopen.org")
2026

2127
from typing import TypedDict, List, Optional

0 commit comments

Comments
 (0)