Added
- Added
Document.get_paragraph_index()andDocument.get_sentence_index()for locating paragraph and sentence objects within a document. Lookups are keyed by unique ID rather than text equality, so paragraphs/sentences with identical text (e.g. duplicate clauses in a contract) resolve to their specific occurrences. This makes the methods suitable for locatingreference_paragraphs/reference_sentencesreturned during extraction, including after serialization round-trips, which preserve unique IDs. Lookups are O(1) on average via lazily built internal caches that are validated against the live document state and do not affect document equality, serialization, or cloning.
Changed
- Upgraded pinned dependency versions:
litellm==1.96.2,openai==2.54.0,genai-prices==0.1.2. Versions remain pinned to maintain stability and avoid occasional breaking changes and API inconsistencies observed in previous unpinned releases.