AgentKit
参数 | 类型 | 是否必选 | 示例值 | 描述 |
Action | String | 是 | InvokeTool | 要执行的操作,取值:InvokeTool。 |
ToolId | String | 是 | t-yebi04gb28o2eybt**** | 工具ID。 |
OperationType | String | 是 | RunCode | 操作类型。
|
OperationPayload | String | 是 | { "code": "print('helloworld')", "timeout": 30, "kernel_name": "python3"} | 请求沙箱实例中接口的具体参数,取值:
|
SessionId | String | 否 | s-yecrzqygw0o2eybt**** | 指定执行请求的会话ID。传入参数但未传入取值时则创建一个新的会话。 说明
|
UserSessionId | String | 否 | session-1 | 指定执行请求的用户会话信息,可以通过该字段指定执行请求的会话实例实现上下文隔离。
说明 如果SessionId和UserSessionId都不传入,则默认创建新的UserSessionId。 |
Ttl | Integer | 否 | 1800 | 会话实例存活时长,即工具在一次 “用户 - 工具交互会话” 中,保持用户状态、操作上下文不丢失的有效时长。会话过期后,只需重新登录或重启操作即可。
|
参数 | 类型 | 示例值 | 描述 |
ToolId | String | tool-3tigy72q3u3vj0x2**** | 工具ID。 |
UserSessionId | String | session-1 | 用户会话信息。 |
SessionId | String | s-yecrzqygw0o2eybt**** | 会话ID。 |
Endpoint | String | https://sd5acdbuo20h0ng5g****.apigateway-****.volceapi.com/?faasInstanceName=vefaas-**** | 工具访问域名。 |
InternalEndpoint | String | https://sd5acdbuo20h0ng5g****.apigateway-****.volceapi-inner.com/?faasInstanceName=vefaas-**** | 工具内网访问域名。 |
Result | String | { "success": true, "message": "Code executed successfully", "data": { "kernel_name": "python3", "session_id": "", "status": "ok", "execution_count": 1, "outputs": [ { "output_type": "stream", "name": "stdout", "text": "helloworld", "data": null, "metadata": {}, "execution_count": null, "ename": null, "evalue": null, "traceback": null } ], "code": "print('helloworld')", "msg_id": "" } } | 工具执行结果。 |