def test_valid_nested_field_addition(editor: ArtifactEditorToolSpec):
    """Test adding a valid nested field that exists in the model schema."""
    address_data = {"street": "123 Main St", "city": "Springfield", "zipcode": "12345"}
    editor.create_artifact(name="John", age=30, address=address_data)

    # Add the country field which exists in the Address model
    patch = JsonPatch(
        operations=[PatchOperation(op="add", path="/address/country", value="USA")]
    )

    result = editor.apply_patch(patch)
    assert result["address"]["country"] == "USA"
Test adding a valid nested field that exists in the model schema.
llama-index-integrations/tools/llama-index-tools-artifact-editor/tests/test_artifact_editor.py