Skip to content

PatchEditor

autogen.tools.experimental.apply_patch.apply_patch_tool.PatchEditor #

Bases: Protocol

Protocol for implementing file operations for apply_patch.

create_file #

create_file(operation)

Create a new file sync.

PARAMETER DESCRIPTION
operation

Dict with 'path' and 'diff' keys

TYPE: dict[str, Any]

RETURNS DESCRIPTION
dict[str, Any]

Dict with 'status' ("completed" or "failed") and optional 'output' message

Source code in autogen/tools/experimental/apply_patch/apply_patch_tool.py
def create_file(self, operation: dict[str, Any]) -> dict[str, Any]:
    """Create a new file sync.

    Args:
        operation: Dict with 'path' and 'diff' keys

    Returns:
        Dict with 'status' ("completed" or "failed") and optional 'output' message
    """
    ...

a_create_file async #

a_create_file(operation)

Create a new file async.

PARAMETER DESCRIPTION
operation

Dict with 'path' and 'diff' keys

TYPE: dict[str, Any]

RETURNS DESCRIPTION
dict[str, Any]

Dict with 'status' ("completed" or "failed") and optional 'output' message

Source code in autogen/tools/experimental/apply_patch/apply_patch_tool.py
async def a_create_file(self, operation: dict[str, Any]) -> dict[str, Any]:
    """Create a new file async.

    Args:
        operation: Dict with 'path' and 'diff' keys

    Returns:
        Dict with 'status' ("completed" or "failed") and optional 'output' message
    """
    ...

update_file #

update_file(operation)

Update an existing file sync.

PARAMETER DESCRIPTION
operation

Dict with 'path' and 'diff' keys

TYPE: dict[str, Any]

RETURNS DESCRIPTION
dict[str, Any]

Dict with 'status' ("completed" or "failed") and optional 'output' message

Source code in autogen/tools/experimental/apply_patch/apply_patch_tool.py
def update_file(self, operation: dict[str, Any]) -> dict[str, Any]:
    """Update an existing file sync.

    Args:
        operation: Dict with 'path' and 'diff' keys

    Returns:
        Dict with 'status' ("completed" or "failed") and optional 'output' message
    """
    ...

a_update_file async #

a_update_file(operation)

Update an existing file async.

PARAMETER DESCRIPTION
operation

Dict with 'path' and 'diff' keys

TYPE: dict[str, Any]

RETURNS DESCRIPTION
dict[str, Any]

Dict with 'status' ("completed" or "failed") and optional 'output' message

Source code in autogen/tools/experimental/apply_patch/apply_patch_tool.py
async def a_update_file(self, operation: dict[str, Any]) -> dict[str, Any]:
    """Update an existing file async.

    Args:
        operation: Dict with 'path' and 'diff' keys

    Returns:
        Dict with 'status' ("completed" or "failed") and optional 'output' message
    """
    ...

delete_file #

delete_file(operation)

Delete a file sync.

PARAMETER DESCRIPTION
operation

Dict with 'path' key

TYPE: dict[str, Any]

RETURNS DESCRIPTION
dict[str, Any]

Dict with 'status' ("completed" or "failed") and optional 'output' message

Source code in autogen/tools/experimental/apply_patch/apply_patch_tool.py
def delete_file(self, operation: dict[str, Any]) -> dict[str, Any]:
    """Delete a file sync.

    Args:
        operation: Dict with 'path' key

    Returns:
        Dict with 'status' ("completed" or "failed") and optional 'output' message
    """
    ...

a_delete_file async #

a_delete_file(operation)

Delete a file async.

PARAMETER DESCRIPTION
operation

Dict with 'path' key

TYPE: dict[str, Any]

RETURNS DESCRIPTION
dict[str, Any]

Dict with 'status' ("completed" or "failed") and optional 'output' message

Source code in autogen/tools/experimental/apply_patch/apply_patch_tool.py
async def a_delete_file(self, operation: dict[str, Any]) -> dict[str, Any]:
    """Delete a file async.

    Args:
        operation: Dict with 'path' key

    Returns:
        Dict with 'status' ("completed" or "failed") and optional 'output' message
    """
    ...