You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement langextract tools for interactive text visualization (#25)
* feat: implement langextract tools for interactive text visualization (fixes#24)
- Add langextract_extract and langextract_render_file tools
- Support for highlighting text extractions in interactive HTML
- Lazy imports with graceful degradation when langextract not installed
- Security warnings for file operations
- Comprehensive test suite with mocking
- Usage example with agent integration patterns
- Optional dependency langextract>=0.1.0 in pyproject.toml
Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
* fix: correct AnnotatedDocument kwarg from id= to document_id= (fixes#25)
- Fix runtime TypeError in langextract tool
- AnnotatedDocument constructor expects document_id= not id=
- Tests now pass: 16 passed, 0 failed
Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
* fix: correct AnnotatedDocument kwarg from intervals= to extractions= (fixes langextract API)
- Changed _create_annotated_document to build Extraction objects instead of CharInterval objects
- Updated AnnotatedDocument constructor to use extractions= kwarg instead of intervals=
- Each Extraction now properly wraps CharInterval as char_interval attribute
- Added extraction metadata (class, text, attributes) as required by langextract API
- All 16 tests now pass (previously 1 failing)
Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
* fix: correct langextract tool visualization and test bugs
- Fix Bug 1: lx.visualize() now receives JSONL path instead of HTML path
- Use temporary JSONL file, capture HTML return value, write to output file
- Follows correct langextract API pattern
- Fix Bug 2: test_agent_usage_pattern now asserts success instead of impossible 'not installed' branch
- Fix test mocks: lx.visualize now returns string instead of Mock object
Fixes#25
Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
0 commit comments