File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,12 @@ def get_ark_token(region: str = "cn-beijing") -> str:
3535 secret_key = cred .secret_access_key
3636 session_token = cred .session_token
3737
38+ provider = os .getenv ("CLOUD_PROVIDER" )
39+ host = "open.volcengineapi.com"
40+ if provider and provider .lower () == "byteplus" :
41+ region = "ap-southeast-1"
42+ host = "open.byteplusapi.com"
43+
3844 res = ve_request (
3945 request_body = {"ProjectName" : "default" , "Filter" : {"AllowAll" : True }},
4046 header = {"X-Security-Token" : session_token },
@@ -44,8 +50,9 @@ def get_ark_token(region: str = "cn-beijing") -> str:
4450 service = "ark" ,
4551 version = "2024-01-01" ,
4652 region = region ,
47- host = "open.volcengineapi.com" ,
53+ host = host ,
4854 )
55+ logger .info (f"Successfully fetched ARK API Key list: { res } " )
4956 try :
5057 first_api_key_id = res ["Result" ]["Items" ][0 ]["Id" ]
5158 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:
6572 service = "ark" ,
6673 version = "2024-01-01" ,
6774 region = region ,
68- host = "open.volcengineapi.com" ,
75+ host = host ,
6976 )
7077 try :
7178 api_key = res ["Result" ]["ApiKey" ]
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import time
16-
16+ import os
1717from veadk .utils .misc import getenv
1818from veadk .version import VERSION
1919
7676DEFAULT_NACOS_GROUP = "VEADK_GROUP"
7777DEFAULT_NACOS_INSTANCE_NAME = "veadk"
7878
79+ provider = os .getenv ("CLOUD_PROVIDER" )
80+
81+ if provider and provider .lower () == "byteplus" :
82+ DEFAULT_MODEL_AGENT_NAME = "seed-1-6-250915"
83+ DEFAULT_MODEL_AGENT_API_BASE = "https://ark.ap-southeast.bytepluses.com/api/v3"
84+ DEFAULT_IMAGE_EDIT_MODEL_NAME = "seededit-3-0-i2i-250628"
85+ DEFAULT_IMAGE_EDIT_MODEL_API_BASE = "https://ark.ap-southeast.bytepluses.com/api/v3"
86+ DEFAULT_VIDEO_MODEL_NAME = "seedance-1-5-pro-251215"
87+ DEFAULT_VIDEO_MODEL_API_BASE = "https://ark.ap-southeast.bytepluses.com/api/v3"
88+ DEFAULT_IMAGE_GENERATE_MODEL_NAME = "seedream-4-5-251128"
89+ DEFAULT_IMAGE_GENERATE_MODEL_API_BASE = (
90+ "https://ark.ap-southeast.bytepluses.com/api/v3"
91+ )
7992DEFAULT_MODEL_EMBEDDING_NAME = "doubao-embedding-vision-250615"
8093DEFAULT_MODEL_EMBEDDING_API_BASE = "https://ark.cn-beijing.volces.com/api/v3/"
8194DEFAULT_MODEL_EMBEDDING_DIM = 2048
You can’t perform that action at this time.
0 commit comments