feat: semantic operators src updates - improved type composition and transduction #115
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.
Overview
This PR introduces significant improvements to the Agentics framework's type composition system and transduction capabilities, with a focus on semantic operators and improved data handling.
Changes
Core Dependencies
duckdb>=1.4.3for efficient data queryingpandas>=2.3.3for enhanced data manipulationasync-lru>=2.0.5for async caching capabilitiesType System Enhancements (
src/agentics/core/atype.py)pydantic_model_from_dict()function explaining:left/righttotarget/sourcefor semantic clarity:target: The destination type in a compositionsource: The source type in a compositioncreate_pydantic_model()Default Types (
src/agentics/core/default_types.py)Abooltype: A new semantic type for boolean values with type validationAstrtypeTransduction Improvements (
src/agentics/core/transducible_functions.py)Transduceclass with string representation methods:__str__(): Human-readable string output__repr__(): Developer-friendly representation_one_to_str(): Handles Pydantic models, dicts, lists, and generic typestransducible()decorator:transduce_fields: List of specific fields to transduceprompt_template: Custom prompt template for transductionTransductionResultconsistentlygenerate_prototypical_instances(): Updated field definition to use optional listCore AG Enhancements (
src/agentics/core/agentics.py)amap_batch_sizefor better memory managementleft/right→target/source)compose_states()method:zip()iteration (matching AG lengths)left/right→target/sourcemerge_states()to check length compatibilityTechnical Benefits