Skip to content

Add bulk document upload and pre-commit hook for knowledge base#72

Merged
jfrench9 merged 1 commit intomainfrom
feature/knowledge-base
Mar 28, 2026
Merged

Add bulk document upload and pre-commit hook for knowledge base#72
jfrench9 merged 1 commit intomainfrom
feature/knowledge-base

Conversation

@jfrench9
Copy link
Copy Markdown
Member

Summary

This PR introduces bulk document upload functionality to the DocumentClient and 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

  • Bulk Document Upload: Extended DocumentClient with a new method to support uploading multiple documents in a single operation, streamlining batch ingestion workflows for the knowledge base.
  • New Document List Item Model: Added the DocumentListItem model to represent individual documents within a collection, providing a structured data type for list/bulk operations.
  • Pre-commit Hook: Introduced a .githooks/pre-commit hook to automate code quality checks as part of the local development workflow, catching issues before they reach the remote repository.

Changes Breakdown

File Change Type Description
robosystems_client/extensions/document_client.py Modified Added bulk upload method to DocumentClient
robosystems_client/models/document_list_item.py Modified Added DocumentListItem model with document metadata fields
.githooks/pre-commit Added New pre-commit hook for automated code quality enforcement

Breaking Changes

None. This is a purely additive change — existing APIs and models remain unaffected.

Testing Notes

  • Verify that the new bulk upload method correctly handles multiple document payloads and returns expected responses.
  • Test edge cases for bulk uploads: empty lists, large batches, and mixed valid/invalid documents.
  • Confirm that DocumentListItem serializes and deserializes correctly when used in API responses.
  • Ensure the pre-commit hook executes successfully in a local development environment and does not block valid commits.

Infrastructure Considerations

  • Developers should configure their local Git installation to use the project's hooks directory to benefit from the newly added pre-commit hook. This may require a one-time local setup step.
  • The bulk upload endpoint should be evaluated for payload size limits and timeout configurations on the server side to ensure it handles large batch requests gracefully.

🤖 Generated with Claude Code

Branch Info:

  • Source: feature/knowledge-base
  • Target: main
  • Type: feature

Co-Authored-By: Claude noreply@anthropic.com

## 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.
@jfrench9 jfrench9 merged commit 1cd8462 into main Mar 28, 2026
1 check passed
@jfrench9 jfrench9 deleted the feature/knowledge-base branch March 28, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant