files.delete
Remove a file’s index entries. The file on disk is kept. Provide exactly one offile_id or path.
POST /namespaces/{namespace_name}/files/delete — see Delete file
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Remove a file index using the Python client
file_id or path.
client.files.delete(
namespace_name: str,
*,
file_id: str | None = None,
path: str | None = None,
) -> dict[str, Any]
POST /namespaces/{namespace_name}/files/delete — see Delete file
from pathlib import Path
from moorcheh import MoorchehClient
from moorcheh.docker_runtime import default_upload_dir, host_path_to_container_upload_path
with MoorchehClient("http://localhost:8080") as client:
# By file_id
resp = client.files.delete("my-documents", file_id="a1b2c3d4e5f67890")
# By path (container path)
upload_root = default_upload_dir()
host_file = (upload_root / "document.pdf").resolve()
resp = client.files.delete(
"my-documents",
path=host_path_to_container_upload_path(host_file, upload_root),
)
job = client.files.job_status("my-documents", resp["job_id"])
Was this page helpful?