Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions veadk/auth/veauth/ark_veauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def get_ark_token(region: str = "cn-beijing") -> str:
secret_key = cred.secret_access_key
session_token = cred.session_token

provider = os.getenv("CLOUD_PROVIDER")
host = "open.volcengineapi.com"
if provider and provider.lower() == "byteplus":
region = "ap-southeast-1"
host = "open.byteplusapi.com"

res = ve_request(
request_body={"ProjectName": "default", "Filter": {"AllowAll": True}},
header={"X-Security-Token": session_token},
Expand All @@ -44,8 +50,9 @@ def get_ark_token(region: str = "cn-beijing") -> str:
service="ark",
version="2024-01-01",
region=region,
host="open.volcengineapi.com",
host=host,
)
logger.info(f"Successfully fetched ARK API Key list: {res}")
try:
first_api_key_id = res["Result"]["Items"][0]["Id"]
logger.warning("By default, VeADK fetches the first API Key in the list.")
Expand All @@ -65,7 +72,7 @@ def get_ark_token(region: str = "cn-beijing") -> str:
service="ark",
version="2024-01-01",
region=region,
host="open.volcengineapi.com",
host=host,
)
try:
api_key = res["Result"]["ApiKey"]
Expand Down
16 changes: 15 additions & 1 deletion veadk/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import time

import os
from veadk.utils.misc import getenv
from veadk.version import VERSION

Expand Down Expand Up @@ -75,3 +75,17 @@

DEFAULT_NACOS_GROUP = "VEADK_GROUP"
DEFAULT_NACOS_INSTANCE_NAME = "veadk"

provider = os.getenv("CLOUD_PROVIDER")
print(f"CLOUD_PROVIDER: {provider}")
if provider and provider.lower() == "byteplus":
DEFAULT_MODEL_AGENT_NAME = "seed-1-6-250915"
DEFAULT_MODEL_AGENT_API_BASE = "https://ark.ap-southeast.bytepluses.com/api/v3"
DEFAULT_IMAGE_EDIT_MODEL_NAME = "seededit-3-0-i2i-250628"
DEFAULT_IMAGE_EDIT_MODEL_API_BASE = "https://ark.ap-southeast.bytepluses.com/api/v3"
DEFAULT_VIDEO_MODEL_NAME = "seedance-1-5-pro-251215"
DEFAULT_VIDEO_MODEL_API_BASE = "https://ark.ap-southeast.bytepluses.com/api/v3"
DEFAULT_IMAGE_GENERATE_MODEL_NAME = "seedream-4-5-251128"
DEFAULT_IMAGE_GENERATE_MODEL_API_BASE = (
"https://ark.ap-southeast.bytepluses.com/api/v3"
)