diff --git a/veadk/auth/veauth/ark_veauth.py b/veadk/auth/veauth/ark_veauth.py index 54f8c5b3..9cd814ec 100644 --- a/veadk/auth/veauth/ark_veauth.py +++ b/veadk/auth/veauth/ark_veauth.py @@ -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}, @@ -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.") @@ -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"] diff --git a/veadk/consts.py b/veadk/consts.py index 5eaade54..6b2a07f1 100644 --- a/veadk/consts.py +++ b/veadk/consts.py @@ -13,7 +13,7 @@ # limitations under the License. import time - +import os from veadk.utils.misc import getenv from veadk.version import VERSION @@ -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" + )