1313# limitations under the License.
1414
1515from __future__ import annotations
16-
16+ import os
1717from pathlib import Path
1818from typing import Any , Dict
1919
@@ -101,6 +101,7 @@ def _invoke_skill(self, skill_name: str, tool_context: ToolContext) -> str:
101101
102102 working_dir = get_session_path (session_id = tool_context .session .id )
103103 skill_dir = working_dir / "skills"
104+ region = os .getenv ("AGENTKIT_TOOL_REGION" , "cn-beijing" )
104105
105106 if skill_name not in self .skills :
106107 # 1. Download skill from TOS if not found locally
@@ -114,7 +115,6 @@ def _invoke_skill(self, skill_name: str, tool_context: ToolContext) -> str:
114115 try :
115116 from veadk .auth .veauth .utils import get_credential_from_vefaas_iam
116117 from veadk .integrations .ve_tos .ve_tos import VeTOS
117- import os
118118
119119 access_key = os .getenv ("VOLCENGINE_ACCESS_KEY" )
120120 secret_key = os .getenv ("VOLCENGINE_SECRET_KEY" )
@@ -183,6 +183,7 @@ def _invoke_skill(self, skill_name: str, tool_context: ToolContext) -> str:
183183 sk = secret_key ,
184184 session_token = session_token ,
185185 bucket_name = tos_bucket ,
186+ region = region ,
186187 )
187188
188189 # Download the skill directory from TOS
@@ -216,8 +217,6 @@ def _invoke_skill(self, skill_name: str, tool_context: ToolContext) -> str:
216217 from veadk .auth .veauth .utils import get_credential_from_vefaas_iam
217218 from veadk .integrations .ve_tos .ve_tos import VeTOS
218219
219- region = os .getenv ("AGENTKIT_TOOL_REGION" , "cn-beijing" )
220-
221220 access_key = os .getenv ("VOLCENGINE_ACCESS_KEY" )
222221 secret_key = os .getenv ("VOLCENGINE_SECRET_KEY" )
223222 session_token = ""
0 commit comments