@@ -87,9 +87,18 @@ def execute_skills(
8787 service = getenv (
8888 "AGENTKIT_TOOL_SERVICE_CODE" , "agentkit"
8989 ) # temporary service for code run tool
90- region = getenv ("AGENTKIT_TOOL_REGION" , "cn-beijing" )
90+
91+ cloud_provider = (os .getenv ("CLOUD_PROVIDER" ) or "" ).lower ()
92+ if cloud_provider == "byteplus" :
93+ sld = "bytepluses"
94+ default_region = "ap-southeast-1"
95+ else :
96+ sld = "volces"
97+ default_region = "cn-beijing"
98+
99+ region = getenv ("AGENTKIT_TOOL_REGION" , default_region )
91100 host = getenv (
92- "AGENTKIT_TOOL_HOST" , service + "." + region + ".volces .com"
101+ "AGENTKIT_TOOL_HOST" , service + "." + region + f". { sld } .com"
93102 ) # temporary host for code run tool
94103 logger .debug (f"tools endpoint: { host } " )
95104
@@ -99,7 +108,6 @@ def execute_skills(
99108 tool_user_session_id = agent_name + "_" + user_id + "_" + session_id
100109 logger .debug (f"tool_user_session_id: { tool_user_session_id } " )
101110
102- cloud_provider = getenv ("CLOUD_PROVIDER" , "" , allow_false_values = True )
103111 scheme = getenv ("AGENTKIT_TOOL_SCHEME" , "https" , allow_false_values = True ).lower ()
104112 if scheme not in {"http" , "https" }:
105113 scheme = "https"
@@ -141,7 +149,9 @@ def execute_skills(
141149 service = "sts" ,
142150 version = "2018-01-01" ,
143151 region = region ,
144- host = "sts.volcengineapi.com" ,
152+ host = "sts.volcengineapi.com"
153+ if cloud_provider != "byteplus"
154+ else "open.byteplusapi.com" ,
145155 header = header ,
146156 )
147157 try :
0 commit comments