Add library client and enhance API response handling#98
Merged
Conversation
This update enhances the error handling across multiple API modules by replacing the `ErrorResponse` model with `OperationError` for various HTTP status codes (400, 404, 409). The changes ensure that error responses are consistently parsed and returned, improving the robustness of the API client. Key Changes: - Updated `_parse_response` methods in several modules to utilize `OperationError` for better error management. - Refactored response handling to include additional status codes, providing clearer feedback for API consumers. This enhancement aims to improve the user experience by delivering more informative error messages and maintaining consistency across the API client.
This commit modifies the `pyproject.toml` file to improve project descriptions and add relevant URLs for the repository, homepage, and bug tracker. Additionally, the `__init__.py` file in the client library is updated to include the `LibraryClient` and its associated `LIBRARY_GRAPH_ID`, enhancing the API's usability and discoverability. Key Changes: - Updated project description for clarity. - Added keywords to reflect the knowledge graph functionality. - Included project URLs for better resource access. - Integrated `LibraryClient` and `LIBRARY_GRAPH_ID` into the public API surface. These changes aim to improve the overall developer experience and project visibility.
…d updating related imports
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
Introduces a new
LibraryClientfor GraphQL-based library interactions, adds financial statement analysis capabilities to the robo-ledger extension, refactors API response handling for improved error management, and removes deprecated bulk document upload functionality.Key Accomplishments
New Library Client
LibraryClientwith comprehensive GraphQL query support for library operationsgraphql/queries/library/to support library data retrieval and manipulationFinancial Statement Operations
op_financial_statement_analysisandop_live_financial_statementendpoints to the robo-ledger extensionFinancialStatementAnalysisRequest,LiveFinancialStatementRequest) with full serialization supportImproved API Response Handling
op_create_*,op_update_*,op_delete_*, andop_truncate_*endpointsModel Enhancements
UpdateElementRequestwith optional typed classification fieldCreateElementRequestby removing unused classification fields and updating importsCreateMappingAssociationOperationCreateElementRequestClassificationandUpdateElementRequestClassificationType0modelsCleanup
upload_documents_bulk.py) and associated models (BulkDocumentUploadRequest,BulkDocumentUploadResponse,BulkDocumentUploadResponseErrorsType0Item)DocumentClientbulk upload functionality and testspyproject.tomlBreaking Changes
upload_documents_bulkAPI endpoint — consumers relying on bulk document upload via the REST API must migrate to an alternative approachBulkDocumentUploadRequest,BulkDocumentUploadResponse, and related error models from the public models APIDocumentClientbulk upload methods removed — any code calling bulk upload through the document client will breakCreateElementRequest(removed classifications),UpdateElementRequest(classification field type changed), and several operation models may require updates to calling codeclients/__init__.pyexports — import paths for clients may need updatingTesting Notes
test_document_client.pytests for bulk upload have been removed alongside the deprecated functionalityfinancial_statement_analysis,live_financial_statement) and theLibraryClientshould be validated against a running API instanceInfrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
feature/library-clientmainCo-Authored-By: Claude noreply@anthropic.com