CodesnipToolkit
https://github.com/bytedance/SandboxFusion https://bytedance.github.io/SandboxFusion/docs/docs/get-started
CodesnipToolkit
Bases: AsyncBaseToolkit
源代码位于: utu/tools/codesnip_toolkit.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
tools_map
property
Lazy loading of tools map. - collect tools registered by @register_tool
run_code
async
Run code in sandbox and return the result. Supported languages: python, cpp, nodejs, go, go_test, java, php, csharp, bash, typescript, sql, rust, cuda, lua, R, perl, D_ut, ruby, scala, julia, pttest, junit, kotlin_script, jest, verilog, python_gpu, lean, swift, racket
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
code
|
str
|
The code to run. |
必需 |
language
|
str
|
The language of the code. Defaults to "python". |
'python'
|
Returns: str: The result of the code.
源代码位于: utu/tools/codesnip_toolkit.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
get_tools_map_func
Get tools map. It will filter tools by config.activated_tools if it is not None.
源代码位于: utu/tools/base.py
56 57 58 59 60 61 62 63 64 65 | |
get_tools_in_agents
get_tools_in_agents() -> list[FunctionTool]
Get tools in openai-agents format.
源代码位于: utu/tools/base.py
67 68 69 70 71 72 73 74 75 76 77 78 | |
get_tools_in_openai
Get tools in OpenAI format.
源代码位于: utu/tools/base.py
80 81 82 83 | |
get_tools_in_mcp
get_tools_in_mcp() -> list[Tool]
Get tools in MCP format.
源代码位于: utu/tools/base.py
85 86 87 88 | |
call_tool
async
Call a tool by its name.
源代码位于: utu/tools/base.py
90 91 92 93 94 95 96 | |