File size: 822 Bytes
816198f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import yaml
import os
import sys
from urllib.parse import urljoin
from typing import Callable, Dict, Any
from utils.configs import TOOLS_SERVER_BASE_ENDPOINT_URL, WEB_BASED_TOOLS_USE_CACHE
from tool_kits.base import BaseToolkit


class ExecuteCodeToolkit(BaseToolkit):
    NAME = "execute_code"
    TOOLS_SERVER_BASE_ENDPOINT = TOOLS_SERVER_BASE_ENDPOINT_URL
    ENTRY_POINT = "execute_code"
    DESCRIPTION = f"Execute a given code snippet for data processing, model training, analysis, or workflow automation, including writing or modifying files as needed."
    TIMEOUT = 900
    TOOL_PARAMS = {
        "code": {
            "type": "string",
            "description": "The input code to the Code Interpreter tool call.",
        },
    }
    TOOL_PARAMS_REQUIRED = ["code"]
    USE_CACHE = WEB_BASED_TOOLS_USE_CACHE