delete_document_by_filename
Delete a document by its filename
Usage
Parameters
filename
(str): Filename of the document to delete
Returns
A dictionary containing information about the deletion operation:
message
(str): A success message indicating the document was deleteddocument_id
(str): The ID of the deleted document- Additional fields may be present with more details about the operation
Description
This method is a convenience wrapper that:
- Retrieves the document ID by filename using get_document_by_filename
- Deletes the document using delete_document
This operation is permanent and cannot be undone.
Multiple Documents with Same Filename
If multiple documents have the same filename, this method will delete the most recently updated one. To delete a specific document when duplicates exist, use delete_document with the exact document ID instead.
Notes
- This operation requires appropriate permissions for the document.
- If no document exists with the specified filename, a
ValueError
will be raised. - Deleting a document that is part of an existing knowledge graph will not automatically update the graph. You may need to recreate or update the graph separately.
Was this page helpful?