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 33f85fcf..0467057f 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 @@ -76,6 +76,19 @@ DEFAULT_NACOS_GROUP = "VEADK_GROUP" DEFAULT_NACOS_INSTANCE_NAME = "veadk" +provider = os.getenv("CLOUD_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" + ) DEFAULT_MODEL_EMBEDDING_NAME = "doubao-embedding-vision-250615" DEFAULT_MODEL_EMBEDDING_API_BASE = "https://ark.cn-beijing.volces.com/api/v3/" DEFAULT_MODEL_EMBEDDING_DIM = 2048