implements referenced documents on /query and updates /streaming_query to match#403
Open
thoraxe wants to merge 18 commits into
Open
implements referenced documents on /query and updates /streaming_query to match#403thoraxe wants to merge 18 commits into
thoraxe wants to merge 18 commits into
Conversation
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.
Description
This branch implements referenced documents functionality for both query endpoints, with
comprehensive improvements for robustness, maintainability, and error handling.
feat: implement referenced documents with robust metadata parsing and error handling
This branch adds comprehensive referenced documents support to both /query and
/streaming-query endpoints, with advanced metadata parsing capabilities and
production-ready error handling to ensure reliable operation.
🚀 New Features
Referenced Documents Support
/query) - Returnsreferenced_documentsarray in response/streaming-query) - Includes referenced documents in SSEend event
ReferencedDocumentmodel with URL validation and title fieldsAdvanced Metadata Parsing Infrastructure
src/utils/metadata.py)🛡️ Production-Ready Error Handling
Graceful Degradation
docs_urlentries are logged and skippedpydantic.ValidationErrorRobust Parsing
{'a': {'b': {'c': 42}}}'value with {braces}'🧹 Code Quality & Architecture
Eliminated Duplication
Enhanced Type Safety
dict[str, dict[str, Any]]for better static analysisTesting Excellence
🧪 Comprehensive Test Coverage (33 total tests)
Metadata Parsing Tests (
tests/unit/utils/test_metadata.py){'data': 'value with {braces} inside'}Endpoint Integration Tests
Parametrized Test Coverage
📋 Technical Implementation Details
Robust Metadata Extraction
Case-insensitive matching
METADATA: {...} # ✅ Works
metadata: {...} # ✅ Works
MetaData: {...} # ✅ Works
Error Resilience
Stream Protection
Summary
🔧 Files Changed
✅ Quality Assurance
🎯 Impact
🤖 Generated with https://claude.ai/code
Co-Authored-By: Claude noreply@anthropic.com
This comprehensive commit message captures the entire scope of work from the initial
referenced documents implementation through all the robustness improvements, error handling
enhancements, and comprehensive testing that was added.
Type of change
Related Tickets & Documents
Checklist before requesting a review
Testing
Tests were added to match what is done with
/streaming_queryand they all seem to pass.Code by Claude.
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Tests