Skip to content

Add library client and enhance API response handling#98

Merged
jfrench9 merged 4 commits intomainfrom
feature/library-client
Apr 21, 2026
Merged

Add library client and enhance API response handling#98
jfrench9 merged 4 commits intomainfrom
feature/library-client

Conversation

@jfrench9
Copy link
Copy Markdown
Member

Summary

Introduces a new LibraryClient for 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

  • Added LibraryClient with comprehensive GraphQL query support for library operations
  • Introduced a full set of GraphQL queries under graphql/queries/library/ to support library data retrieval and manipulation

Financial Statement Operations

  • Added op_financial_statement_analysis and op_live_financial_statement endpoints to the robo-ledger extension
  • Introduced corresponding request models (FinancialStatementAnalysisRequest, LiveFinancialStatementRequest) with full serialization support

Improved API Response Handling

  • Refactored response handling across all robo-investor and robo-ledger operations to improve error management and consistency
  • Standardized error handling patterns across op_create_*, op_update_*, op_delete_*, and op_truncate_* endpoints

Model Enhancements

  • Added classification support to UpdateElementRequest with optional typed classification field
  • Refined CreateElementRequest by removing unused classification fields and updating imports
  • Added new association type to CreateMappingAssociationOperation
  • Updated CreateElementRequestClassification and UpdateElementRequestClassificationType0 models

Cleanup

  • Removed deprecated bulk document upload API (upload_documents_bulk.py) and associated models (BulkDocumentUploadRequest, BulkDocumentUploadResponse, BulkDocumentUploadResponseErrorsType0Item)
  • Removed related DocumentClient bulk upload functionality and tests
  • Updated project metadata and package configuration in pyproject.toml

Breaking Changes

  • Removed upload_documents_bulk API endpoint — consumers relying on bulk document upload via the REST API must migrate to an alternative approach
  • Removed BulkDocumentUploadRequest, BulkDocumentUploadResponse, and related error models from the public models API
  • DocumentClient bulk upload methods removed — any code calling bulk upload through the document client will break
  • Model field changes on CreateElementRequest (removed classifications), UpdateElementRequest (classification field type changed), and several operation models may require updates to calling code
  • Modified clients/__init__.py exports — import paths for clients may need updating

Testing Notes

  • The test_document_client.py tests for bulk upload have been removed alongside the deprecated functionality
  • All existing robo-investor and robo-ledger operation modules were updated; verify integration tests cover the new error handling paths
  • New endpoints (financial_statement_analysis, live_financial_statement) and the LibraryClient should be validated against a running API instance
  • GraphQL query coverage for the library client should be confirmed end-to-end

Infrastructure Considerations

  • SDK generation tooling has been updated to reflect the new API surface; ensure regeneration pipelines are aligned with the updated configuration
  • Package metadata changes may affect dependency resolution or publishing workflows

🤖 Generated with Claude Code

Branch Info:

  • Source: feature/library-client
  • Target: main
  • Type: feature

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

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.
@jfrench9 jfrench9 merged commit 1d38f30 into main Apr 21, 2026
1 check passed
@jfrench9 jfrench9 deleted the feature/library-client branch April 21, 2026 04:40
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