MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / remove_doc_from_concept_pages

Function remove_doc_from_concept_pages

openkb/agent/compiler.py:1408–1426  ·  view source on GitHub ↗

Update or delete concept pages affected by removing a document. ``keep_empty`` retains concept pages whose only source was the removed doc (leaving ``sources: []``) — useful when the doc is being replaced by a newer version that will repopulate the source on the next ``openkb add``.

(
    wiki_dir: Path,
    doc_name: str,
    *,
    keep_empty: bool = False,
)

Source from the content-addressed store, hash-verified

1406
1407
1408def remove_doc_from_concept_pages(
1409 wiki_dir: Path,
1410 doc_name: str,
1411 *,
1412 keep_empty: bool = False,
1413) -> dict[str, list[str]]:
1414 """Update or delete concept pages affected by removing a document.
1415
1416 ``keep_empty`` retains concept pages whose only source was the removed
1417 doc (leaving ``sources: []``) — useful when the doc is being replaced by
1418 a newer version that will repopulate the source on the next ``openkb
1419 add``. Returns ``{"modified": [slugs...], "deleted": [slugs...]}``.
1420 """
1421 return _remove_doc_from_pages(
1422 wiki_dir,
1423 doc_name,
1424 page_dir="concepts",
1425 keep_empty=keep_empty,
1426 )
1427
1428
1429def remove_doc_from_entity_pages(

Calls 1

_remove_doc_from_pagesFunction · 0.85