Skip to content

CodeExecutionTool

autogen.beta.tools.builtin.code_execution.CodeExecutionTool #

Bases: Tool

Provider-neutral code execution capability.

Each LLM client's mapper is responsible for converting this schema into the correct provider-specific API format.

schemas async #

schemas(context)
Source code in autogen/beta/tools/builtin/code_execution.py
async def schemas(self, context: "Context") -> list[ToolSchema]:
    return [CodeExecutionToolSchema()]

register #

register(stack, context, *, middleware=())
Source code in autogen/beta/tools/builtin/code_execution.py
def register(
    self,
    stack: "ExitStack",
    context: "Context",
    *,
    middleware: Iterable["BaseMiddleware"] = (),
) -> None:
    pass