-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dump and dumps methods to Graph (#3202)
* feat(utils.py): add escape_json_dump function to escape JSON strings for Edge dictionaries * refactor(Output): streamline add_types method to prevent duplicate entries in types list for improved type management * feat(data.py): add classmethod decorator to validate_data for enhanced validation logic when checking data types * feat(setup.py): implement retry logic for loading starter projects to enhance robustness against JSON decode errors * fix(input_mixin.py): improve model_config formatting and update field_type alias for clarity and consistency in field definitions * feat(types.py): refactor vertex constructors to use NodeData and add input/output methods for better component interaction * feat(schema.py): add NodeData and Position TypedDicts for improved type safety and structure in vertex data handling * feat(base.py): update Vertex to use NodeData type and add to_data method for better data management and access * refactor(schema.py): update TargetHandle and SourceHandle models to include model_config attribute * Add TypedDict classes for graph schema serialization in `schema.py` * Refactor `Edge` class to improve handle validation and data handling - Consolidated imports and removed redundant `BaseModel` definitions for `SourceHandle` and `TargetHandle`. - Added `valid_handles`, `target_param`, and `_target_handle` attributes to `Edge` class. - Enhanced handle validation logic to distinguish between dictionary and string types. - Introduced `to_data` method to return edge data. - Updated attribute names to follow consistent naming conventions (`base_classes`, `input_types`, `field_name`). * Refactor `Edge` class to improve handle validation and data handling * Refactor: Standardize attribute naming and add `to_data` method in Edge class - Renamed attributes to use snake_case consistently (`baseClasses` to `base_classes`, `inputTypes` to `input_types`, `fieldName` to `field_name`). - Added `to_data` method to return `_data` attribute. - Updated validation methods to use new attribute names. * Refactor: Update Edge class to consistently use snake_case for attributes and improve validation logic for handles * Refactor: Change node argument type in add_node and _create_vertex methods to NodeData for better type safety and clarity * Refactor: Implement JSON serialization for graph data with `dumps` and `dump` methods, enhancing data export capabilities * Refactor: Add pytest fixtures for ingestion and RAG graphs, enhance test structure for better clarity and organization * Refactor: Add pytest fixtures for memory_chatbot_graph tests and improve test structure * Refactor: Remove unused methods in ComponentVertex class to streamline code and improve readability * Refactor: Remove unnecessary line in ComponentVertex class to enhance code clarity and maintainability * Refactor: Update import path for DefaultPromptField to improve code organization and maintainability in api_utils.py * Refactor: Update import path for DefaultPromptField to enhance code organization and maintainability in prompt.py * fix: Remove fixture in test_memory_chatbot.py that blocked db setup * Refactor: Add durations path for unit tests to improve test reporting * Refactor: Add splitting algorithm option for unit tests * Add async option to Makefile for unit tests and update GitHub Actions workflow - Introduced `async` variable in Makefile to conditionally run unit tests with or without parallel execution. - Updated `unit_tests` target in Makefile to handle `async` flag. - Modified GitHub Actions workflow to set `async=false` for unit tests.
- Loading branch information
1 parent
8ece1ca
commit bb1bc5c
Showing
19 changed files
with
798 additions
and
108 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.