def test_apply_patch_nested_paths(editor: ArtifactEditorToolSpec):
    """Test operations on nested object paths."""
    address_data = {"street": "123 Main St", "city": "Springfield", "zipcode": "12345"}
    editor.create_artifact(name="John", age=30, address=address_data)

    patch = JsonPatch(
        operations=[
            PatchOperation(op="replace", path="/address/city", value="New York"),
            PatchOperation(op="add", path="/address/country", value="USA"),
        ]
    )

    result = editor.apply_patch(patch)

    assert result["address"]["city"] == "New York"
    assert result["address"]["country"] == "USA"
Test operations on nested object paths.
llama-index-integrations/tools/llama-index-tools-artifact-editor/tests/test_artifact_editor.py