Skip to content

Commit 5af82de

Browse files
YumengBaoagentkit-git
authored andcommitted
fix: image_generate and video_generate support arkclaw new environment
image_generate -> byted_image_generate video_generate -> byted_video_generate load_dotenv("/root/.openclaw/.env") and read for api_key and api_base GitOrigin-RevId: 1b6b8e6f3ef295989161e1fbf3f9d1ba19a9cf17
1 parent cf82d8f commit 5af82de

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed
File renamed without changes.

skills/image-generate/scripts/image_generate.py renamed to skills/byted-image-generate/scripts/image_generate.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@
1616
API_BASE = os.getenv(
1717
"MODEL_IMAGE_API_BASE", "https://ark.cn-beijing.volces.com/api/v3"
1818
).rstrip("/")
19+
20+
if os.path.exists("/root/.openclaw/.env"):
21+
try:
22+
from dotenv import load_dotenv
23+
except ModuleNotFoundError as e:
24+
raise ModuleNotFoundError(
25+
"/root/.openclaw/.env detected, but python-dotenv is not installed; please install the dependency or remove the file."
26+
) from e
27+
28+
load_dotenv("/root/.openclaw/.env")
29+
API_KEY = os.getenv("ARK_MULTIMODAL_API_KEY", API_KEY)
30+
API_BASE = os.getenv("ARK_MULTIMODAL_API_BASE", API_BASE).rstrip("/")
31+
32+
1933
DEFAULT_MODEL = "doubao-seedream-5-0-260128"
2034

2135

File renamed without changes.

skills/video-generate/scripts/video_generate.py renamed to skills/byted-video-generate/scripts/video_generate.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@
1616
API_BASE = os.getenv(
1717
"MODEL_VIDEO_API_BASE", "https://ark.cn-beijing.volces.com/api/v3"
1818
).rstrip("/")
19+
20+
if os.path.exists("/root/.openclaw/.env"):
21+
try:
22+
from dotenv import load_dotenv
23+
except ModuleNotFoundError as e:
24+
raise ModuleNotFoundError(
25+
"/root/.openclaw/.env detected, but python-dotenv is not installed; please install the dependency or remove the file."
26+
) from e
27+
28+
load_dotenv("/root/.openclaw/.env")
29+
API_KEY = os.getenv("ARK_MULTIMODAL_API_KEY", API_KEY)
30+
API_BASE = os.getenv("ARK_MULTIMODAL_API_BASE", API_BASE).rstrip("/")
31+
1932
DEFAULT_MODEL = "doubao-seedance-2-0-260128"
2033

2134

0 commit comments

Comments
 (0)