Add bulk document upload and pre-commit hook for knowledge base#72
Merged
Add bulk document upload and pre-commit hook for knowledge base#72
Conversation
## Summary This commit introduces a new method, `upload_bulk`, to the `DocumentClient` class, enabling the upload of multiple markdown documents in a single request. It also updates the `DocumentListItem` model to include a new `document_id` attribute for better document identification. ## Key Accomplishments - **New Method**: Added `upload_bulk` method to handle bulk document uploads, supporting up to 50 documents per request. - **Model Update**: Enhanced `DocumentListItem` to include `document_id`, improving the data structure for document management. ## Changes Breakdown - Implemented the `upload_bulk` method in `document_client.py` to facilitate bulk uploads. - Updated `document_list_item.py` to add the `document_id` attribute and adjusted serialization methods accordingly. ## Testing Notes - Verify that the `upload_bulk` method correctly uploads multiple documents and handles responses as expected. - Ensure that the new `document_id` field is properly serialized and deserialized in document list items. ## Infrastructure Considerations - No breaking changes introduced; existing functionality remains intact.
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.
Summary
This PR introduces bulk document upload functionality to the
DocumentClientand adds a new model for document list items, supporting the knowledge base feature. A Git pre-commit hook is also added to enforce code quality checks before commits.Key Accomplishments
DocumentClientwith a new method to support uploading multiple documents in a single operation, streamlining batch ingestion workflows for the knowledge base.DocumentListItemmodel to represent individual documents within a collection, providing a structured data type for list/bulk operations..githooks/pre-commithook to automate code quality checks as part of the local development workflow, catching issues before they reach the remote repository.Changes Breakdown
robosystems_client/extensions/document_client.pyDocumentClientrobosystems_client/models/document_list_item.pyDocumentListItemmodel with document metadata fields.githooks/pre-commitBreaking Changes
None. This is a purely additive change — existing APIs and models remain unaffected.
Testing Notes
DocumentListItemserializes and deserializes correctly when used in API responses.Infrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
feature/knowledge-basemainCo-Authored-By: Claude noreply@anthropic.com