feat: knowledge base document import base - #197
Merged
Conversation
Add the Hyve Lite pieces the Pro document importer builds on, plus related improvements surfaced while building it: - OpenAI::detect_sensitive_data() to flag personal data before content is stored, and batch the moderation endpoint (one request per group of chunks instead of one request per chunk). - Shared BaseAPI::query_page() so list endpoints detect further pages without a found-rows count; fixes a stale "Load more" when the total exceeds a page. - PostsTable renders a caller-provided status per row while staying generic, used by the Pro import queue. - A Documents source tile in the Knowledge Base (Premium upsell in free).
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
…import # Conflicts: # inc/OpenAI.php Co-authored-by: HardeepAsrani <2649903+HardeepAsrani@users.noreply.github.com>
Merge conflicts resolved. The only conflict was in |
Soare-Robert-Daniel
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
The Hyve Lite base for importing documents into the knowledge base, plus a few improvements surfaced while building it. The actual document parsing and UI live in the Pro companion (Codeinwp/hyve#258); this PR is the shared groundwork.
Part of Codeinwp/hyve#153 (closed by the Pro companion PR).
Changes
OpenAI::detect_sensitive_data()scans a block of text for personal data (names with contact details, emails, phone numbers, addresses, IDs, payment details, credentials, health data) and returns a short, value-free summary. The Pro importer uses it to warn before storing a file.moderate_chunks()now sends chunks to the moderation endpoint in small groups (default 5, filterable viahyve_moderation_batch_size) instead of one request per chunk. Same result, far fewer round-trips on multi-chunk content. Benefits every ingestion source, not just documents.BaseAPI::query_page(). List endpoints (get_data,get_threads, and the Proget_knowledge/get_links/get_documents) now detect a next page by fetching one extra row instead of running a found-rows count. This also fixes a long-standing bug where "Load more" never disappeared once the total exceeded a page.PostsTablestatus rendering. The shared table accepts an optionalrenderStatus( post )render-prop so a caller (the Pro import queue) can render per-row status, while the table itself stays free of feature-specific vocabulary.Manual QA