def test_set_invalid_nested_field_path(editor: ArtifactEditorToolSpec):
    """Test setting a nested field that doesn't exist in the Pydantic model schema."""
    address_data = {"street": "123 Main St", "city": "Springfield", "zipcode": "12345"}
    editor.create_artifact(name="John", age=30, address=address_data)

    # Try to add a field that doesn't exist in the Address model
    patch = JsonPatch(
        operations=[
            PatchOperation(op="add", path="/address/invalid_nested_field", value="test")
        ]
    )

    # This should raise an error since invalid_nested_field is not in the Address model
    with pytest.raises(ValueError, match="Invalid field 'invalid_nested_field'"):
        editor.apply_patch(patch)
Test setting a nested field that doesn't exist in the Pydantic model schema.
llama-index-integrations/tools/llama-index-tools-artifact-editor/tests/test_artifact_editor.py