Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions veadk/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,19 @@ def load_skills(self):

service = os.getenv("AGENTKIT_TOOL_SERVICE_CODE", "agentkit")
region = os.getenv("AGENTKIT_TOOL_REGION", "cn-beijing")
# volcengine example: agentkit.cn-beijing.volcengineapi.com
host = service + "." + region + ".volcengineapi.com"

provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
if provider == "byteplus":
region = (
os.getenv("REGION")
or os.getenv("AGENTKIT_TOOL_REGION")
or "ap-southeast-1"
)
# byteplus example: agentkit.ap-southeast-1.bytepluses.com
host = service + "." + region + ".bytepluses.com"

res = ve_request(
request_body={"ToolId": tool_id},
action="GetTool",
Expand Down
11 changes: 11 additions & 0 deletions veadk/skills/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,19 @@ def load_skills_from_cloud(skill_space_ids: str) -> list[Skill]:
try:
service = os.getenv("AGENTKIT_TOOL_SERVICE_CODE", "agentkit")
region = os.getenv("AGENTKIT_TOOL_REGION", "cn-beijing")
# volcengine example: agentkit.cn-beijing.open.volcengineapi.com
host = os.getenv("AGENTKIT_SKILL_HOST", "open.volcengineapi.com")

provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
if provider == "byteplus":
region = (
os.getenv("REGION")
or os.getenv("AGENTKIT_TOOL_REGION")
or "ap-southeast-1"
)
# byteplus example: agentkit.ap-southeast-1.byteplusapi.com
host = os.getenv("AGENTKIT_SKILL_HOST", "byteplusapi.com")

access_key = os.getenv("VOLCENGINE_ACCESS_KEY")
secret_key = os.getenv("VOLCENGINE_SECRET_KEY")
session_token = ""
Expand Down
9 changes: 9 additions & 0 deletions veadk/tools/builtin_tools/execute_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,18 @@ def execute_skills(
"AGENTKIT_TOOL_SERVICE_CODE", "agentkit"
) # temporary service for code run tool
region = getenv("AGENTKIT_TOOL_REGION", "cn-beijing")
# volces example: agentkit.cn-beijing.volces.com
host = getenv(
"AGENTKIT_TOOL_HOST", service + "." + region + ".volces.com"
) # temporary host for code run tool

provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
if provider == "byteplus":
region = (
os.getenv("REGION") or os.getenv("AGENTKIT_TOOL_REGION") or "ap-southeast-1"
)
# byteplus example: agentkit.ap-southeast-1.bytepluses.com
host = getenv("AGENTKIT_TOOL_HOST", service + "." + region + ".bytepluses.com")
logger.debug(f"tools endpoint: {host}")

session_id = tool_context._invocation_context.session.id
Expand Down
10 changes: 10 additions & 0 deletions veadk/tools/builtin_tools/run_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,19 @@ def run_code(
"AGENTKIT_TOOL_SERVICE_CODE", "agentkit"
) # temporary service for code run tool
region = getenv("AGENTKIT_TOOL_REGION", "cn-beijing")
# volces example: agentkit.cn-beijing.volces.com
host = getenv(
"AGENTKIT_TOOL_HOST", service + "." + region + ".volces.com"
) # temporary host for code run tool

provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
if provider == "byteplus":
region = (
os.getenv("REGION") or os.getenv("AGENTKIT_TOOL_REGION") or "ap-southeast-1"
)
# byteplus example: agentkit.ap-southeast-1.bytepluses.com
host = getenv("AGENTKIT_TOOL_HOST", service + "." + region + ".bytepluses.com")

scheme = getenv("AGENTKIT_TOOL_SCHEME", "https", allow_false_values=True).lower()
if scheme not in {"http", "https"}:
scheme = "https"
Expand Down
11 changes: 11 additions & 0 deletions veadk/tools/skills_tools/download_skills_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,19 @@ def download_skills_tool(
# Get service configuration
service = os.getenv("AGENTKIT_TOOL_SERVICE_CODE", "agentkit")
region = os.getenv("AGENTKIT_TOOL_REGION", "cn-beijing")
# volcengine example: agentkit.cn-beijing.open.volcengineapi.com
host = os.getenv("AGENTKIT_SKILL_HOST", "open.volcengineapi.com")

provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
if provider == "byteplus":
region = (
os.getenv("REGION")
or os.getenv("AGENTKIT_TOOL_REGION")
or "ap-southeast-1"
)
# byteplus example: agentkit-ppe.ap-southeast-1.byteplusapi.com
host = os.getenv("AGENTKIT_SKILL_HOST", "byteplusapi.com")

# Ensure download path exists
download_dir = Path(download_path)
download_dir.mkdir(parents=True, exist_ok=True)
Expand Down
11 changes: 11 additions & 0 deletions veadk/tools/skills_tools/register_skills_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,19 @@ def register_skills_tool(
from veadk.auth.veauth.utils import get_credential_from_vefaas_iam

agentkit_tool_service = os.getenv("AGENTKIT_TOOL_SERVICE_CODE", "agentkit")
# volcengine example: agentkit.cn-beijing.volcengineapi.com
agentkit_skill_host = os.getenv("AGENTKIT_SKILL_HOST", "open.volcengineapi.com")
region = os.getenv("AGENTKIT_TOOL_REGION", "cn-beijing")
provider = (os.getenv("CLOUD_PROVIDER") or "").lower()

if provider == "byteplus":
region = (
os.getenv("REGION")
or os.getenv("AGENTKIT_TOOL_REGION")
or "ap-southeast-1"
)
# byteplus example: agentkit-ppe.ap-southeast-1.byteplusapi.com
agentkit_skill_host = os.getenv("AGENTKIT_SKILL_HOST", "byteplusapi.com")

access_key = os.getenv("VOLCENGINE_ACCESS_KEY")
secret_key = os.getenv("VOLCENGINE_SECRET_KEY")
Expand Down