You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: veadk/tools/builtin_tools/execute_skills.py
+5-20Lines changed: 5 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -71,19 +71,18 @@ def execute_skills(
71
71
workflow_prompt: str,
72
72
skills: Optional[List[str]] =None,
73
73
tool_context: ToolContext=None,
74
-
timeout: int=900,
75
74
) ->str:
76
75
"""execute skills in a code sandbox and return the output.
77
76
For C++ code, don't execute it directly, compile and execute via Python; write sources and object files to /tmp.
78
77
79
78
Args:
80
79
workflow_prompt (str): instruction of workflow
81
80
skills (Optional[List[str]]): The skills will be invoked
82
-
timeout (int, optional): The timeout in seconds for the code execution, less than or equal to 900. Defaults to 900.
83
81
84
82
Returns:
85
83
str: The output of the code execution.
86
84
"""
85
+
timeout=900# The timeout in seconds for the code execution, less than or equal to 900. Defaults to 900. Hard-coded to prevent the Agent from adjusting this parameter.
87
86
88
87
tool_id=getenv("AGENTKIT_TOOL_ID")
89
88
@@ -131,26 +130,12 @@ def execute_skills(
131
130
ifskills:
132
131
cmd.extend(["--skills"] +skills)
133
132
134
-
# TODO: remove after agentkit supports custom environment variables setting
135
-
res=ve_request(
136
-
request_body={},
137
-
action="GetCallerIdentity",
138
-
ak=ak,
139
-
sk=sk,
140
-
service="sts",
141
-
version="2018-01-01",
142
-
region=region,
143
-
host="sts.volcengineapi.com",
144
-
header=header,
145
-
)
146
-
try:
147
-
account_id=res["Result"]["AccountId"]
148
-
exceptKeyErrorase:
149
-
logger.error(f"Error occurred while getting account id: {e}, response is {res}")
150
-
returnres
133
+
skill_space_id=os.getenv("SKILL_SPACE_ID", "")
134
+
ifnotskill_space_id:
135
+
logger.warning("SKILL_SPACE_ID environment variable is not set")
0 commit comments