From 55b68ce2bc294f094ccaf3750ea1b932ed4f95f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 08:41:14 +0000 Subject: [PATCH 1/6] fix(api): merge duplicate components, reorder required fields --- .stats.yml | 4 +- src/isaacus/types/enrichment_response.py | 192 +++++++++++++++++++++-- 2 files changed, 178 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index c881b9a..743fe5a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-d499915d5c9d28ffae10a108d7655c026676b21d3b34f07ead24c7d50c546633.yml -openapi_spec_hash: d91d2843e3799463b60832553d4faf70 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-fa910a5a3d1321234423bd8c042d202a64d4d956ef45847b4de358cb18e447eb.yml +openapi_spec_hash: 926b9b619c15e8570e496e11d4fb753e config_hash: 1d77b499f5b4f2dc6986fdd5936d18ef diff --git a/src/isaacus/types/enrichment_response.py b/src/isaacus/types/enrichment_response.py index 95d00e6..2dab255 100644 --- a/src/isaacus/types/enrichment_response.py +++ b/src/isaacus/types/enrichment_response.py @@ -51,7 +51,14 @@ class ResultDocumentCrossreferenceSpan(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -78,7 +85,20 @@ class ResultDocumentCrossreference(BaseModel): """ span: ResultDocumentCrossreferenceSpan - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ start: str """ @@ -239,7 +259,14 @@ class ResultDocumentExternalDocumentMention(BaseModel): class ResultDocumentExternalDocumentName(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -308,7 +335,20 @@ class ResultDocumentExternalDocument(BaseModel): """ name: ResultDocumentExternalDocumentName - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ pinpoints: List[ResultDocumentExternalDocumentPinpoint] """ @@ -468,7 +508,14 @@ class ResultDocumentLocationMention(BaseModel): class ResultDocumentLocationName(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -499,7 +546,20 @@ class ResultDocumentLocation(BaseModel): """ name: ResultDocumentLocationName - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ parent: Optional[str] = None """ @@ -538,7 +598,14 @@ class ResultDocumentPersonMention(BaseModel): class ResultDocumentPersonName(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -569,7 +636,20 @@ class ResultDocumentPerson(BaseModel): """ name: ResultDocumentPersonName - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ parent: Optional[str] = None """ @@ -772,7 +852,14 @@ class ResultDocumentPhoneNumber(BaseModel): class ResultDocumentQuoteSpan(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -815,7 +902,20 @@ class ResultDocumentQuote(BaseModel): """ span: ResultDocumentQuoteSpan - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ class ResultDocumentSegmentCode(BaseModel): @@ -842,7 +942,14 @@ class ResultDocumentSegmentCode(BaseModel): class ResultDocumentSegmentSpan(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -981,7 +1088,20 @@ class ResultDocumentSegment(BaseModel): """ span: ResultDocumentSegmentSpan - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ title: Optional[ResultDocumentSegmentTitle] = None """A zero-based, half-open span into the Unicode code point space of input text. @@ -1110,7 +1230,14 @@ class ResultDocumentSubtitle(BaseModel): class ResultDocumentTermMeaning(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -1149,7 +1276,14 @@ class ResultDocumentTermMention(BaseModel): class ResultDocumentTermName(BaseModel): - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ end: int """ @@ -1174,7 +1308,20 @@ class ResultDocumentTerm(BaseModel): """ meaning: ResultDocumentTermMeaning - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ mentions: List[ResultDocumentTermMention] """ @@ -1186,7 +1333,20 @@ class ResultDocumentTerm(BaseModel): """ name: ResultDocumentTermName - """The span of the segment within the document's text.""" + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ class ResultDocumentTitle(BaseModel): From 62bc9ffc03feb68e3638cfee3d9df9a8547bb9e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 08:41:50 +0000 Subject: [PATCH 2/6] feat(sdk): force ilgs v1 prefix on models --- .stats.yml | 2 +- api.md | 18 +- src/isaacus/types/__init__.py | 14 + src/isaacus/types/enrichment_response.py | 1566 +---------------- src/isaacus/types/ilgs_v1_crossreference.py | 42 + src/isaacus/types/ilgs_v1_date.py | 70 + src/isaacus/types/ilgs_v1_document.py | 172 ++ src/isaacus/types/ilgs_v1_email.py | 27 + .../types/ilgs_v1_external_document.py | 101 ++ src/isaacus/types/ilgs_v1_id_number.py | 27 + src/isaacus/types/ilgs_v1_location.py | 53 + src/isaacus/types/ilgs_v1_person.py | 195 ++ src/isaacus/types/ilgs_v1_phone_number.py | 30 + src/isaacus/types/ilgs_v1_quote.py | 52 + src/isaacus/types/ilgs_v1_segment.py | 205 +++ src/isaacus/types/ilgs_v1_span.py | 28 + src/isaacus/types/ilgs_v1_term.py | 59 + src/isaacus/types/ilgs_v1_website.py | 28 + 18 files changed, 1125 insertions(+), 1564 deletions(-) create mode 100644 src/isaacus/types/ilgs_v1_crossreference.py create mode 100644 src/isaacus/types/ilgs_v1_date.py create mode 100644 src/isaacus/types/ilgs_v1_document.py create mode 100644 src/isaacus/types/ilgs_v1_email.py create mode 100644 src/isaacus/types/ilgs_v1_external_document.py create mode 100644 src/isaacus/types/ilgs_v1_id_number.py create mode 100644 src/isaacus/types/ilgs_v1_location.py create mode 100644 src/isaacus/types/ilgs_v1_person.py create mode 100644 src/isaacus/types/ilgs_v1_phone_number.py create mode 100644 src/isaacus/types/ilgs_v1_quote.py create mode 100644 src/isaacus/types/ilgs_v1_segment.py create mode 100644 src/isaacus/types/ilgs_v1_span.py create mode 100644 src/isaacus/types/ilgs_v1_term.py create mode 100644 src/isaacus/types/ilgs_v1_website.py diff --git a/.stats.yml b/.stats.yml index 743fe5a..a7008df 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-fa910a5a3d1321234423bd8c042d202a64d4d956ef45847b4de358cb18e447eb.yml openapi_spec_hash: 926b9b619c15e8570e496e11d4fb753e -config_hash: 1d77b499f5b4f2dc6986fdd5936d18ef +config_hash: 821656ed414ab3ec256ecfb11585a614 diff --git a/api.md b/api.md index 438bdae..0d71432 100644 --- a/api.md +++ b/api.md @@ -55,7 +55,23 @@ Methods: Types: ```python -from isaacus.types import EnrichmentResponse +from isaacus.types import ( + EnrichmentResponse, + IlgsV1Crossreference, + IlgsV1Date, + IlgsV1Document, + IlgsV1Email, + IlgsV1ExternalDocument, + IlgsV1IDNumber, + IlgsV1Location, + IlgsV1Person, + IlgsV1PhoneNumber, + IlgsV1Quote, + IlgsV1Segment, + IlgsV1Span, + IlgsV1Term, + IlgsV1Website, +) ``` Methods: diff --git a/src/isaacus/types/__init__.py b/src/isaacus/types/__init__.py index f1751e9..e86bcd2 100644 --- a/src/isaacus/types/__init__.py +++ b/src/isaacus/types/__init__.py @@ -2,9 +2,23 @@ from __future__ import annotations +from .ilgs_v1_date import IlgsV1Date as IlgsV1Date +from .ilgs_v1_span import IlgsV1Span as IlgsV1Span +from .ilgs_v1_term import IlgsV1Term as IlgsV1Term +from .ilgs_v1_email import IlgsV1Email as IlgsV1Email +from .ilgs_v1_quote import IlgsV1Quote as IlgsV1Quote +from .ilgs_v1_person import IlgsV1Person as IlgsV1Person +from .ilgs_v1_segment import IlgsV1Segment as IlgsV1Segment +from .ilgs_v1_website import IlgsV1Website as IlgsV1Website +from .ilgs_v1_document import IlgsV1Document as IlgsV1Document +from .ilgs_v1_location import IlgsV1Location as IlgsV1Location +from .ilgs_v1_id_number import IlgsV1IDNumber as IlgsV1IDNumber from .embedding_response import EmbeddingResponse as EmbeddingResponse from .reranking_response import RerankingResponse as RerankingResponse from .enrichment_response import EnrichmentResponse as EnrichmentResponse +from .ilgs_v1_phone_number import IlgsV1PhoneNumber as IlgsV1PhoneNumber +from .ilgs_v1_crossreference import IlgsV1Crossreference as IlgsV1Crossreference from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams from .reranking_create_params import RerankingCreateParams as RerankingCreateParams from .enrichment_create_params import EnrichmentCreateParams as EnrichmentCreateParams +from .ilgs_v1_external_document import IlgsV1ExternalDocument as IlgsV1ExternalDocument diff --git a/src/isaacus/types/enrichment_response.py b/src/isaacus/types/enrichment_response.py index 2dab255..0bc0758 100644 --- a/src/isaacus/types/enrichment_response.py +++ b/src/isaacus/types/enrichment_response.py @@ -1,1575 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal +from typing import List from .._models import BaseModel +from .ilgs_v1_document import IlgsV1Document -__all__ = [ - "EnrichmentResponse", - "Result", - "ResultDocument", - "ResultDocumentCrossreference", - "ResultDocumentCrossreferenceSpan", - "ResultDocumentDate", - "ResultDocumentDateMention", - "ResultDocumentEmail", - "ResultDocumentEmailMention", - "ResultDocumentExternalDocument", - "ResultDocumentExternalDocumentMention", - "ResultDocumentExternalDocumentName", - "ResultDocumentExternalDocumentPinpoint", - "ResultDocumentHeading", - "ResultDocumentIDNumber", - "ResultDocumentIDNumberMention", - "ResultDocumentJunk", - "ResultDocumentLocation", - "ResultDocumentLocationMention", - "ResultDocumentLocationName", - "ResultDocumentPerson", - "ResultDocumentPersonMention", - "ResultDocumentPersonName", - "ResultDocumentPhoneNumber", - "ResultDocumentPhoneNumberMention", - "ResultDocumentQuote", - "ResultDocumentQuoteSpan", - "ResultDocumentSegment", - "ResultDocumentSegmentCode", - "ResultDocumentSegmentSpan", - "ResultDocumentSegmentTitle", - "ResultDocumentSegmentTypeName", - "ResultDocumentSubtitle", - "ResultDocumentTerm", - "ResultDocumentTermMeaning", - "ResultDocumentTermMention", - "ResultDocumentTermName", - "ResultDocumentTitle", - "ResultDocumentWebsite", - "ResultDocumentWebsiteMention", - "Usage", -] - - -class ResultDocumentCrossreferenceSpan(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentCrossreference(BaseModel): - """A cross-reference within the document pointing to one or more segments.""" - - end: str - """ - The unique identifier of the latest segment in the span of segments being - cross-referenced with ties broken in favor of the least-nested (i.e., largest) - segment. If the cross-reference points to a single segment, `start` and `end` - will be identical. - """ - - span: ResultDocumentCrossreferenceSpan - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - start: str - """ - The unique identifier of the earliest segment in the span of segments being - cross-referenced with ties broken in favor of the least-nested (i.e., largest) - segment. If the cross-reference points to a single segment, `start` and `end` - will be identical. - """ - - -class ResultDocumentDateMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentDate(BaseModel): - """ - A date identified in a document belonging to one of the following types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, `payment`, `birth`, or `death`. - - Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into one of the supported date types are extractable. - """ - - mentions: List[ResultDocumentDateMention] - """ - An array of one or more spans within the document's text where the date is - mentioned. - """ - - person: Optional[str] = None - """ - A unique identifier for a legal person in the format `per:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. - """ - - type: Literal["creation", "signature", "effective", "expiry", "delivery", "renewal", "payment", "birth", "death"] - """ - The type of the date, being one of `creation`, `signature`, `effective`, - `expiry`, `delivery`, `renewal`, `payment`, `birth`, or `death`. If a date is - mentioned in a document that does not fit into a supported type, it will not be - extracted. - - `creation` denotes the date the document was created. There may only be one - `creation` date per document. - - `signature` denotes the date the document was signed. - - `effective` denotes the date when the document or a part thereof comes into - effect (e.g., commencement or enactment dates). - - `expiry` denotes the date when the document or a part thereof is no longer in - effect. - - `delivery` denotes the date when goods or services are to be delivered under the - document. - - `renewal` denotes the date when one or more of the document's terms are to be - renewed. - - `payment` denotes the date when payment is to be made under the document. - - `birth` denotes the birth date of a natural person or establishment (e.g., - incorporation) date of a non-natural legal person identified in the document. - There can only be one `birth` date linked to a single person and all `birth` - dates must be linked to a person. A person's `birth` date will never be after - their `death` date. - - `death` denotes the death date of a natural person or dissolution date of a - non-natural legal person identified in the document. There can only be one - `death` date linked to a single person and all `death` dates must be linked to a - person. A person's `death` date will never be before their `birth` date. - """ - - value: str - """The date in ISO 8601 format (YYYY-MM-DD).""" - - -class ResultDocumentEmailMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentEmail(BaseModel): - """An email address identified in a document belonging to a legal person. - - If an email address was mentioned in the document but is not attributable to a legal person, it will not be extracted. - """ - - address: str - """The normalized email address.""" - - mentions: List[ResultDocumentEmailMention] - """ - An array of one or more spans within the document's text where the email address - is mentioned. - """ - - person: str - """The unique identifier of the person that this email address belongs to.""" - - -class ResultDocumentExternalDocumentMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentExternalDocumentName(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentExternalDocumentPinpoint(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentExternalDocument(BaseModel): - """A document identified within another document.""" - - id: str - """ - The unique identifier of the external document in the format `exd:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. - """ - - jurisdiction: Optional[str] = None - """ - A jurisdiction code representing a country (via an initial country code) and, - optionally, a subdivision within that country (via a subsequent subdivision code - prefixed by a hyphen). - - All 249 ISO 3166-1 alpha-2 country codes are representable in addition to - special `INT` and `EU` codes for international and European Union law, - respectively. - - All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED` - code for federal law. - """ - - mentions: List[ResultDocumentExternalDocumentMention] - """ - An array of one or more spans within the document's text where the external - document is mentioned by name, for example, 'the US Constitution' in 'the Second - Amendment to the US Constitution protects freedom of speech'. - """ - - name: ResultDocumentExternalDocumentName - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - pinpoints: List[ResultDocumentExternalDocumentPinpoint] - """ - An array of spans within the document's text where specific parts of the - external document are referenced, for example, 'Section 2' in 'as defined in - Section 2 of the US Constitution'. - """ - - reception: Literal["positive", "mixed", "negative", "neutral"] - """ - The sentiment of the document towards the external document, being one of - `positive`, `mixed`, `negative`, or `neutral`. - - `positive` indicates that the document expresses a favorable view of the - external document whether by endorsing or approving it. - - `mixed` indicates that the document expresses both favorable and unfavorable - views of the external document, for example, by affirming parts of it and - disapproving others. - - `negative` indicates that the document expresses an unfavorable view of the - external document whether by criticizing, repealing, overruling, or explicitly - contradicting it. - - `neutral` indicates that the document references the external document without - expressing any particular sentiment towards it. - """ - - type: Literal["statute", "regulation", "decision", "contract", "other"] - """ - The type of the external document, being one of `statute`, `regulation`, - `decision`, `contract`, or `other`. - - `statute` denotes primary legislation such as acts, bills, codes, and - constitutions. - - `regulation` denotes secondary legislation such as rules, statutory instruments, - and ordinances. - - `decision` denotes judicial or quasi-judicial decisions such as court judgments, - judicial opinions, and tribunal rulings. - - `other` is used for all other types of legal documents that do not fit into any - of the predefined types. - """ - - -class ResultDocumentHeading(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentIDNumberMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentIDNumber(BaseModel): - """An identification number mentioned in a document belonging to a legal person. - - If an identification number was mentioned in the document but is not attributable to a legal person, it will not be extracted. - """ - - mentions: List[ResultDocumentIDNumberMention] - """ - An array of one or more spans within the document's text where the - identification number is mentioned. - """ - - number: str - """The identification number.""" - - person: str - """The unique identifier of the person that this identification number belongs to.""" - - -class ResultDocumentJunk(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentLocationMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentLocationName(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentLocation(BaseModel): - """A location identified within a document.""" - - id: str - """ - The unique identifier of the location in the format `loc:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. - """ - - mentions: List[ResultDocumentLocationMention] - """ - An array of one or more spans within the document's text where the location is - mentioned. - """ - - name: ResultDocumentLocationName - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - parent: Optional[str] = None - """ - A unique identifier for a location in the format `loc:{index}` where `{index}` - is a non-negative incrementing integer starting from zero. - """ - - type: Literal["country", "state", "city", "address", "other"] - """ - The type of the location, being one of `country`, `state`, `city`, `address`, or - `other`. - """ - - -class ResultDocumentPersonMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentPersonName(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentPerson(BaseModel): - """A legal person identified in a document.""" - - id: str - """ - The unique identifier of the person in the format `per:{index}` where `{index}` - is a non-negative incrementing integer starting from zero. - """ - - mentions: List[ResultDocumentPersonMention] - """ - An array of one or more spans within the document's text where the person is - mentioned. - """ - - name: ResultDocumentPersonName - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - parent: Optional[str] = None - """ - A unique identifier for a legal person in the format `per:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. - """ - - residence: Optional[str] = None - """ - A unique identifier for a location in the format `loc:{index}` where `{index}` - is a non-negative incrementing integer starting from zero. - """ - - role: Literal[ - "plaintiff", - "petitioner", - "applicant", - "appellant", - "appellee", - "claimant", - "complainant", - "defendant", - "respondent", - "prior_authority", - "prosecutor", - "defense_counsel", - "amicus", - "intervener", - "borrower", - "lender", - "guarantor", - "lessee", - "lessor", - "employer", - "employee", - "licensor", - "licensee", - "franchisor", - "franchisee", - "buyer", - "seller", - "contractor", - "shareholder", - "joint_venturer", - "investor", - "insurer", - "insured", - "enacting_authority", - "empowered_authority", - "settlor", - "trustee", - "beneficiary", - "debater", - "director", - "governing_jurisdiction", - "clerk", - "witness", - "other", - "non_party", - ] - """The role of the person in relation to the subject of the document. - - The following roles are currently supported: | | | | ------------------------ | - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - | | `plaintiff` | A party initiating the case that is the subject of the - document. | | `petitioner` | A party initiating the petition that is the subject - of the document. | | `applicant` | A party initiating the application that is - the subject of the document. | | `appellant` | A party appealing the decision - that is the subject of the document. | | `appellee` | A party responding to the - appeal that is the subject of the document if they are explicitly referred to as - an 'appellee'. | | `claimant` | A party making a claim in the case that is the - subject of the document. | | `complainant` | A party making a complaint in the - case that is the subject of the document. | | `defendant` | A party defending - against the case that is the subject of the document. | | `respondent` | A party - responding to the petition, appeal, or application that is the subject of the - document. | | `prior_authority` | An authority (e.g., judge, tribunal, court) - that made a prior decision in the case that is the subject of the document. Both - individual judges and courts should be annotated with this role where - applicable. This is not to be used for authorities cited as precedent, only for - those that made prior decisions in the same case. | | `prosecutor` | A lawyer - prosecuting the case that is the subject of the document. | | `defense_counsel` - | A lawyer defending the case that is the subject of the document. | | `amicus` - | A party filing an amicus curiae brief in the case that is the subject of the - document. | | `intervener` | A party attempting to or that has intervened in the - case that is the subject of the document. | | `borrower` | A party borrowing - money or other assets under the agreement that is the subject of the document, - including 'mortgagors' and 'debtors'. | | `lender` | A party lending money or - other assets under the agreement that is the subject of the document, including - 'mortgagees' and 'creditors'. | | `guarantor` | A party guaranteeing obligations - under the agreement that is the subject of the document, including 'sureties'. | - | `lessee` | A party leasing goods or services under the agreement that is the - subject of the document, including 'tenants'. | | `lessor` | A party leasing - goods or services under the agreement that is the subject of the document, - including 'landlords'. | | `employer` | A party employing personnel under the - agreement that is the subject of the document. | | `employee` | A party employed - under the agreement that is the subject of the document. | | `licensor` | A - party licensing intellectual property or other rights under the agreement that - are the subject of the document. | | `licensee` | A party licensed to use - intellectual property or other rights under the agreement that are the subject - of the document. | | `franchisor` | A party granting a franchise under the - agreement that is the subject of the document. | | `franchisee` | A party - granted a franchise under the agreement that is the subject of the document. | | - `buyer` | A party purchasing goods or services under the agreement that is the - subject of the document, including 'purchasers', 'customers', and 'clients'. | | - `seller` | A party selling or providing goods or services under the agreement - that is the subject of the document, including 'Vendors', 'Suppliers', and - 'Service Providers' (where such parties are actually providing goods or services - under the agreement). | | `contractor` | A party contracted to perform work or - services under the agreement that is the subject of the document, including - 'consultants'. | | `shareholder` | A party holding shares or equity under the - agreement that is the subject of the document. | | `joint_venturer` | A party - participating in a joint venture under the agreement that is the subject of the - document. | | `investor` | A party investing money or assets under the agreement - that is the subject of the document. | | `insurer` | A party providing insurance - under the agreement that is the subject of the document. | | `insured` | A party - insured under the agreement that is the subject of the document. | | `settlor` | - A party establishing the trust that is the subject of the document. | | - `trustee` | A party managing the trust that is the subject of the document. | | - `beneficiary` | A party benefiting from the trust that is the subject of the - document. | | `enacting_authority` | An authority (e.g., legislature, regulator, - Minister/Secretary, President/Prime Minister, tribunal, court, judge) giving - legal effect to or authorizing the document. All relevant individuals and bodies - should be annotated with this role where applicable. | | `empowered_authority` | - An authority (e.g., government agency, regulator, Minister/Secretary, - President/Prime Minister, tribunal, court) empowered by the document to carry - out functions or duties. | | `debater` | A person participating in the debate - that is the subject of the document. | | `governing_jurisdiction` | The - jurisdiction whose laws govern the document. | | `director` | A director or - other officer of a corporate legal person mentioned in the document. | | `clerk` - | A clerk, notary, or other official certifying, witnessing, filing, recording, - registering, or otherwise administering the document. | | `witness` | A witness - witnessing the signing of the document, or whose testimony is part of the case - that is the subject of the document. | | `other` | A party to the case, - agreement, legislation, or regulation that is the subject of the document that - does not fit into any of the other roles. | | `non_party` | A legal person - mentioned in the document that is not a party to the case, agreement, - legislation, or regulation that is the subject of the document. | - """ - - type: Literal["natural", "corporate", "politic"] - """ - The legal entity type of the person, being one of `natural`, `corporate`, or - `politic`. - - `natural` denotes a human being in their capacity as a natural legal person, - including when representing unincorporated entities such as partnerships and - trusts. - - `corporate` denotes a body corporate such as a company, incorporated - partnership, or statutory corporation. - - `politic` denotes a body politic such as a court, state, government, or - intergovernmental organization. - """ - - -class ResultDocumentPhoneNumberMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentPhoneNumber(BaseModel): - """A valid phone number identified in a document belonging to a legal person. - - If a phone number was mentioned in the document but is not valid, possible, or attributable to a legal person, it will not be extracted. - """ - - mentions: List[ResultDocumentPhoneNumberMention] - """ - An array of one or more spans within the document's text where the phone number - is mentioned. - """ - - number: str - """ - The normalized phone number in E.123 international notation conforming with - local conventions on the use of spaces and hyphens as separators. - """ - - person: str - """The unique identifier of the person that this phone number belongs to.""" - - -class ResultDocumentQuoteSpan(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentQuote(BaseModel): - """A quotation within a document.""" - - amending: bool - """ - Whether the quote is being used to amend or modify content, typically in other - documents. - """ - - source_document: Optional[str] = None - """ - A unique identifier for an external document in the format `exd:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. - """ - - source_person: Optional[str] = None - """ - A unique identifier for a legal person in the format `per:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. - """ - - source_segment: Optional[str] = None - """ - A unique identifier for a segment in the format `seg:{index}` where `{index}` is - a non-negative incrementing integer starting from zero. - """ - - span: ResultDocumentQuoteSpan - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - -class ResultDocumentSegmentCode(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentSegmentSpan(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentSegmentTitle(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentSegmentTypeName(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentSegment(BaseModel): - """ - A segment within the document representing a structurally distinct portion of the document's content. - """ - - id: str - """ - The unique identifier of the segment in the format `seg:{index}` where `{index}` - is a non-negative incrementing integer starting from zero. - """ - - category: Literal["front_matter", "scope", "main", "annotation", "back_matter", "other"] - """ - The functional 'category' of the segment within the document, being one of - `front_matter`, `scope`, `main`, `annotation`, `back_matter`, or `other`. - - `front_matter` denotes non-operative contextualizing content occurring at the - start of a document such as a preamble or recitals. - - `scope` denotes operative content defining the application or interpretation of - a document such as definition sections and governing law clauses. - - `main` denotes operative, non-scopal content. - - `annotation` denotes non-operative annotative content providing explanatory or - referential information such as commentary, footnotes, and endnotes. - - `back_matter` denotes non-operative contextualizing content occurring at the end - of a document such as authority statements. - - `other` denotes content that does not fit into any of the other categories. - """ - - code: Optional[ResultDocumentSegmentCode] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - kind: Literal["container", "unit", "item", "figure"] - """ - The structural 'kind' of the segment, being one of `container`, `unit`, `item`, - or `figure`. - - A `container` is a structural or semantic grouping of content such as a chapter. - It can contain segments of any kind or none at all. - - A `unit` is a single syntactically independent unit of text such as a paragraph. - It can only contain `item`s and `figure`s. - - An `item` is a syntactically subordinate unit of text such as an item in a - run-in list. It can only contain other `item`s. Note that an `item` is - conceptually distinct from a list item—it is perfectly possible to encounter - list items that are syntactically independent of their surrounding items just as - it is possible to encounter dependent clauses that do not appear as part of a - list. - - A `figure` is a visually structured or tabular unit of content such as a - diagram, equation, or table. It cannot contain segments. - """ - - parent: Optional[str] = None - """ - A unique identifier for a segment in the format `seg:{index}` where `{index}` is - a non-negative incrementing integer starting from zero. - """ - - span: ResultDocumentSegmentSpan - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - title: Optional[ResultDocumentSegmentTitle] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - type: Optional[ - Literal[ - "title", - "book", - "part", - "chapter", - "subchapter", - "division", - "subdivision", - "subpart", - "subtitle", - "table_of_contents", - "article", - "section", - "regulation", - "rule", - "clause", - "paragraph", - "subarticle", - "subsection", - "subregulation", - "subrule", - "subclause", - "subparagraph", - "item", - "subitem", - "point", - "indent", - "schedule", - "annex", - "appendix", - "exhibit", - "recital", - "signature", - "note", - "figure", - "table", - "formula", - ] - ] = None - """ - The addressable 'type' of the segment within the document's referential scheme - and hierarchy, whether defined explicitly (e.g., by headings, such as - 'Section 2. Definitions'), implicitly (e.g., by way of reference, such as 'as - defined in Section 2'), or by convention (e.g., [42] in a judgment often denotes - a `paragraph`, independent provisions in statute are often `section`s, etc.). If - the type is not known or not applicable, it will be set to `null`. - - Note that, although many segment types may coincide with syntactic constructs, - they should be thought of purely as distinct formal citable units. Most - paragraphs (in the syntactic sense) will not have the `paragraph` type, for - example. That type is reserved for segments that would formally be cited as a - 'Paragraph' within the document's referential scheme. - - The following types are currently supported: `title`, `book`, `part`, `chapter`, - `subchapter`, `division`, `subdivision`, `subpart`, `subtitle`, - `table_of_contents`, `article`, `section`, `regulation`, `rule`, `clause`, - `paragraph`, `subarticle`, `subsection`, `subregulation`, `subrule`, - `subclause`, `subparagraph`, `item`, `subitem`, `point`, `indent`, `schedule`, - `annex`, `appendix`, `exhibit`, `recital`, `signature`, `note`, `figure`, - `table`, and `formula`. - - The `title`, `book`, `part`, `chapter`, `subchapter`, `division`, `subdivision`, - `subpart`, `subtitle`, and `table_of_contents` types are exclusive to the - `container` kind. - - The `figure` kind only supports the `figure`, `table`, and `formula` types, all - of which are exclusive to it. - """ - - type_name: Optional[ResultDocumentSegmentTypeName] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - -class ResultDocumentSubtitle(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentTermMeaning(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentTermMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentTermName(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentTerm(BaseModel): - """A term assigned a definite meaning within a document.""" - - id: str - """ - The unique identifier of the term in the format `term:{index}` where `{index}` - is a non-negative incrementing integer starting from zero. - """ - - meaning: ResultDocumentTermMeaning - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - mentions: List[ResultDocumentTermMention] - """ - An array of spans within the document's text where the term is mentioned outside - of its definition. - - It is possible for the term to have no mentions if, outside of its definition, - it is never referred to in the document. - """ - - name: ResultDocumentTermName - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - -class ResultDocumentTitle(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentWebsiteMention(BaseModel): - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). - """ - - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - - start: int - """ - The zero-based start index of the half-open span of Unicode code points in the - input text. - """ - - -class ResultDocumentWebsite(BaseModel): - """A website identified in a document belonging to a legal person. - - If a website was mentioned in the document but is not attributable to a legal person, it will not be extracted. - """ - - mentions: List[ResultDocumentWebsiteMention] - """ - An array of one or more spans within the document's text where the website is - mentioned (including paths and slugs which are not part of the website's - normalized URL). - """ - - person: str - """The unique identifier of the person that this website belongs to.""" - - url: str - """The normalized URL of the website in the form `https://{host}/`.""" - - -class ResultDocument(BaseModel): - """The enriched document.""" - - crossreferences: List[ResultDocumentCrossreference] - """ - An array of cross-references within the document pointing to a single segment or - a span of segments. - """ - - dates: List[ResultDocumentDate] - """ - An array of dates identified in the document belonging to one of the following - types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, - `payment`, `birth`, or `death`. - - Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into - one of the supported date types are extractable. - """ - - emails: List[ResultDocumentEmail] - """ - An array of email addresses identified in the document belonging to legal - persons. - - Email addresses mentioned in the document that are not attributable to legal - persons will not be extracted. - """ - - external_documents: List[ResultDocumentExternalDocument] - """An array of documents identified within the document.""" - - headings: List[ResultDocumentHeading] - """An array of spans within the document's text constituting headings.""" - - id_numbers: List[ResultDocumentIDNumber] - """ - An array of identification numbers identified in the document belonging to legal - persons. - - Identification numbers mentioned in the document that are not attributable to - legal persons will not be extracted. - """ - - junk: List[ResultDocumentJunk] - """ - An array of spans within the document's text constituting non-operative, - non-substantive 'junk' content such as headers, footers, page numbers, and OCR - artifacts. - """ - - jurisdiction: Optional[str] = None - """ - A jurisdiction code representing a country (via an initial country code) and, - optionally, a subdivision within that country (via a subsequent subdivision code - prefixed by a hyphen). - - All 249 ISO 3166-1 alpha-2 country codes are representable in addition to - special `INT` and `EU` codes for international and European Union law, - respectively. - - All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED` - code for federal law. - """ - - locations: List[ResultDocumentLocation] - """An array of locations identified in the document.""" - - persons: List[ResultDocumentPerson] - """An array of legal persons identified in the document.""" - - phone_numbers: List[ResultDocumentPhoneNumber] - """ - An array of valid phone numbers identified in the document belonging to legal - persons. - - Phone numbers mentioned in the document that are not valid, possible, or - attributable to legal persons will not be extracted. - """ - - quotes: List[ResultDocumentQuote] - """An array of quotations within the document.""" - - segments: List[ResultDocumentSegment] - """ - An array of segments within the document representing structurally distinct - portions of its content. - """ - - subtitle: Optional[ResultDocumentSubtitle] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - terms: List[ResultDocumentTerm] - """An array of terms assigned definite meanings within the document.""" - - title: Optional[ResultDocumentTitle] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - type: Literal["statute", "regulation", "decision", "contract", "other"] - """ - The type of the document, being one of `statute`, `regulation`, `decision`, - `contract`, or `other`. - - `statute` denotes primary legislation such as acts, bills, codes, and - constitutions. - - `regulation` denotes secondary legislation such as rules, statutory instruments, - and ordinances. - - `decision` denotes judicial or quasi-judicial decisions such as court judgments, - judicial opinions, and tribunal rulings. - - `other` is used for all other types of legal documents that do not fit into any - of the predefined types. - """ - - version: Literal["ilgs@1"] - - websites: List[ResultDocumentWebsite] - """An array of websites identified in the document belonging to legal persons. - - Websites mentioned in the document that are not attributable to legal persons - will not be extracted. - """ +__all__ = ["EnrichmentResponse", "Result", "Usage"] class Result(BaseModel): """An enriched document alongside its index in the input array of texts.""" - document: ResultDocument + document: IlgsV1Document """The enriched document.""" index: int diff --git a/src/isaacus/types/ilgs_v1_crossreference.py b/src/isaacus/types/ilgs_v1_crossreference.py new file mode 100644 index 0000000..ac54cac --- /dev/null +++ b/src/isaacus/types/ilgs_v1_crossreference.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Crossreference"] + + +class IlgsV1Crossreference(BaseModel): + """A cross-reference within the document pointing to one or more segments.""" + + end: str + """ + The unique identifier of the latest segment in the span of segments being + cross-referenced with ties broken in favor of the least-nested (i.e., largest) + segment. If the cross-reference points to a single segment, `start` and `end` + will be identical. + """ + + span: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + start: str + """ + The unique identifier of the earliest segment in the span of segments being + cross-referenced with ties broken in favor of the least-nested (i.e., largest) + segment. If the cross-reference points to a single segment, `start` and `end` + will be identical. + """ diff --git a/src/isaacus/types/ilgs_v1_date.py b/src/isaacus/types/ilgs_v1_date.py new file mode 100644 index 0000000..5e78143 --- /dev/null +++ b/src/isaacus/types/ilgs_v1_date.py @@ -0,0 +1,70 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Date"] + + +class IlgsV1Date(BaseModel): + """ + A date identified in a document belonging to one of the following types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, `payment`, `birth`, or `death`. + + Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into one of the supported date types are extractable. + """ + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the date is + mentioned. + """ + + person: Optional[str] = None + """ + A unique identifier for a legal person in the format `per:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. + """ + + type: Literal["creation", "signature", "effective", "expiry", "delivery", "renewal", "payment", "birth", "death"] + """ + The type of the date, being one of `creation`, `signature`, `effective`, + `expiry`, `delivery`, `renewal`, `payment`, `birth`, or `death`. If a date is + mentioned in a document that does not fit into a supported type, it will not be + extracted. + + `creation` denotes the date the document was created. There may only be one + `creation` date per document. + + `signature` denotes the date the document was signed. + + `effective` denotes the date when the document or a part thereof comes into + effect (e.g., commencement or enactment dates). + + `expiry` denotes the date when the document or a part thereof is no longer in + effect. + + `delivery` denotes the date when goods or services are to be delivered under the + document. + + `renewal` denotes the date when one or more of the document's terms are to be + renewed. + + `payment` denotes the date when payment is to be made under the document. + + `birth` denotes the birth date of a natural person or establishment (e.g., + incorporation) date of a non-natural legal person identified in the document. + There can only be one `birth` date linked to a single person and all `birth` + dates must be linked to a person. A person's `birth` date will never be after + their `death` date. + + `death` denotes the death date of a natural person or dissolution date of a + non-natural legal person identified in the document. There can only be one + `death` date linked to a single person and all `death` dates must be linked to a + person. A person's `death` date will never be before their `birth` date. + """ + + value: str + """The date in ISO 8601 format (YYYY-MM-DD).""" diff --git a/src/isaacus/types/ilgs_v1_document.py b/src/isaacus/types/ilgs_v1_document.py new file mode 100644 index 0000000..1ada3ce --- /dev/null +++ b/src/isaacus/types/ilgs_v1_document.py @@ -0,0 +1,172 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .ilgs_v1_date import IlgsV1Date +from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_term import IlgsV1Term +from .ilgs_v1_email import IlgsV1Email +from .ilgs_v1_quote import IlgsV1Quote +from .ilgs_v1_person import IlgsV1Person +from .ilgs_v1_segment import IlgsV1Segment +from .ilgs_v1_website import IlgsV1Website +from .ilgs_v1_location import IlgsV1Location +from .ilgs_v1_id_number import IlgsV1IDNumber +from .ilgs_v1_phone_number import IlgsV1PhoneNumber +from .ilgs_v1_crossreference import IlgsV1Crossreference +from .ilgs_v1_external_document import IlgsV1ExternalDocument + +__all__ = ["IlgsV1Document"] + + +class IlgsV1Document(BaseModel): + """The enriched document.""" + + crossreferences: List[IlgsV1Crossreference] + """ + An array of cross-references within the document pointing to a single segment or + a span of segments. + """ + + dates: List[IlgsV1Date] + """ + An array of dates identified in the document belonging to one of the following + types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, + `payment`, `birth`, or `death`. + + Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into + one of the supported date types are extractable. + """ + + emails: List[IlgsV1Email] + """ + An array of email addresses identified in the document belonging to legal + persons. + + Email addresses mentioned in the document that are not attributable to legal + persons will not be extracted. + """ + + external_documents: List[IlgsV1ExternalDocument] + """An array of documents identified within the document.""" + + headings: List[IlgsV1Span] + """An array of spans within the document's text constituting headings.""" + + id_numbers: List[IlgsV1IDNumber] + """ + An array of identification numbers identified in the document belonging to legal + persons. + + Identification numbers mentioned in the document that are not attributable to + legal persons will not be extracted. + """ + + junk: List[IlgsV1Span] + """ + An array of spans within the document's text constituting non-operative, + non-substantive 'junk' content such as headers, footers, page numbers, and OCR + artifacts. + """ + + jurisdiction: Optional[str] = None + """ + A jurisdiction code representing a country (via an initial country code) and, + optionally, a subdivision within that country (via a subsequent subdivision code + prefixed by a hyphen). + + All 249 ISO 3166-1 alpha-2 country codes are representable in addition to + special `INT` and `EU` codes for international and European Union law, + respectively. + + All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED` + code for federal law. + """ + + locations: List[IlgsV1Location] + """An array of locations identified in the document.""" + + persons: List[IlgsV1Person] + """An array of legal persons identified in the document.""" + + phone_numbers: List[IlgsV1PhoneNumber] + """ + An array of valid phone numbers identified in the document belonging to legal + persons. + + Phone numbers mentioned in the document that are not valid, possible, or + attributable to legal persons will not be extracted. + """ + + quotes: List[IlgsV1Quote] + """An array of quotations within the document.""" + + segments: List[IlgsV1Segment] + """ + An array of segments within the document representing structurally distinct + portions of its content. + """ + + subtitle: Optional[IlgsV1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + terms: List[IlgsV1Term] + """An array of terms assigned definite meanings within the document.""" + + title: Optional[IlgsV1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + type: Literal["statute", "regulation", "decision", "contract", "other"] + """ + The type of the document, being one of `statute`, `regulation`, `decision`, + `contract`, or `other`. + + `statute` denotes primary legislation such as acts, bills, codes, and + constitutions. + + `regulation` denotes secondary legislation such as rules, statutory instruments, + and ordinances. + + `decision` denotes judicial or quasi-judicial decisions such as court judgments, + judicial opinions, and tribunal rulings. + + `other` is used for all other types of legal documents that do not fit into any + of the predefined types. + """ + + version: Literal["ilgs@1"] + + websites: List[IlgsV1Website] + """An array of websites identified in the document belonging to legal persons. + + Websites mentioned in the document that are not attributable to legal persons + will not be extracted. + """ diff --git a/src/isaacus/types/ilgs_v1_email.py b/src/isaacus/types/ilgs_v1_email.py new file mode 100644 index 0000000..720589c --- /dev/null +++ b/src/isaacus/types/ilgs_v1_email.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Email"] + + +class IlgsV1Email(BaseModel): + """An email address identified in a document belonging to a legal person. + + If an email address was mentioned in the document but is not attributable to a legal person, it will not be extracted. + """ + + address: str + """The normalized email address.""" + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the email address + is mentioned. + """ + + person: str + """The unique identifier of the person that this email address belongs to.""" diff --git a/src/isaacus/types/ilgs_v1_external_document.py b/src/isaacus/types/ilgs_v1_external_document.py new file mode 100644 index 0000000..fac95a5 --- /dev/null +++ b/src/isaacus/types/ilgs_v1_external_document.py @@ -0,0 +1,101 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1ExternalDocument"] + + +class IlgsV1ExternalDocument(BaseModel): + """A document identified within another document.""" + + id: str + """ + The unique identifier of the external document in the format `exd:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. + """ + + jurisdiction: Optional[str] = None + """ + A jurisdiction code representing a country (via an initial country code) and, + optionally, a subdivision within that country (via a subsequent subdivision code + prefixed by a hyphen). + + All 249 ISO 3166-1 alpha-2 country codes are representable in addition to + special `INT` and `EU` codes for international and European Union law, + respectively. + + All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED` + code for federal law. + """ + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the external + document is mentioned by name, for example, 'the US Constitution' in 'the Second + Amendment to the US Constitution protects freedom of speech'. + """ + + name: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + pinpoints: List[IlgsV1Span] + """ + An array of spans within the document's text where specific parts of the + external document are referenced, for example, 'Section 2' in 'as defined in + Section 2 of the US Constitution'. + """ + + reception: Literal["positive", "mixed", "negative", "neutral"] + """ + The sentiment of the document towards the external document, being one of + `positive`, `mixed`, `negative`, or `neutral`. + + `positive` indicates that the document expresses a favorable view of the + external document whether by endorsing or approving it. + + `mixed` indicates that the document expresses both favorable and unfavorable + views of the external document, for example, by affirming parts of it and + disapproving others. + + `negative` indicates that the document expresses an unfavorable view of the + external document whether by criticizing, repealing, overruling, or explicitly + contradicting it. + + `neutral` indicates that the document references the external document without + expressing any particular sentiment towards it. + """ + + type: Literal["statute", "regulation", "decision", "contract", "other"] + """ + The type of the external document, being one of `statute`, `regulation`, + `decision`, `contract`, or `other`. + + `statute` denotes primary legislation such as acts, bills, codes, and + constitutions. + + `regulation` denotes secondary legislation such as rules, statutory instruments, + and ordinances. + + `decision` denotes judicial or quasi-judicial decisions such as court judgments, + judicial opinions, and tribunal rulings. + + `other` is used for all other types of legal documents that do not fit into any + of the predefined types. + """ diff --git a/src/isaacus/types/ilgs_v1_id_number.py b/src/isaacus/types/ilgs_v1_id_number.py new file mode 100644 index 0000000..e6b2c3a --- /dev/null +++ b/src/isaacus/types/ilgs_v1_id_number.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1IDNumber"] + + +class IlgsV1IDNumber(BaseModel): + """An identification number mentioned in a document belonging to a legal person. + + If an identification number was mentioned in the document but is not attributable to a legal person, it will not be extracted. + """ + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the + identification number is mentioned. + """ + + number: str + """The identification number.""" + + person: str + """The unique identifier of the person that this identification number belongs to.""" diff --git a/src/isaacus/types/ilgs_v1_location.py b/src/isaacus/types/ilgs_v1_location.py new file mode 100644 index 0000000..85e2c38 --- /dev/null +++ b/src/isaacus/types/ilgs_v1_location.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Location"] + + +class IlgsV1Location(BaseModel): + """A location identified within a document.""" + + id: str + """ + The unique identifier of the location in the format `loc:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. + """ + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the location is + mentioned. + """ + + name: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + parent: Optional[str] = None + """ + A unique identifier for a location in the format `loc:{index}` where `{index}` + is a non-negative incrementing integer starting from zero. + """ + + type: Literal["country", "state", "city", "address", "other"] + """ + The type of the location, being one of `country`, `state`, `city`, `address`, or + `other`. + """ diff --git a/src/isaacus/types/ilgs_v1_person.py b/src/isaacus/types/ilgs_v1_person.py new file mode 100644 index 0000000..243fe4a --- /dev/null +++ b/src/isaacus/types/ilgs_v1_person.py @@ -0,0 +1,195 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Person"] + + +class IlgsV1Person(BaseModel): + """A legal person identified in a document.""" + + id: str + """ + The unique identifier of the person in the format `per:{index}` where `{index}` + is a non-negative incrementing integer starting from zero. + """ + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the person is + mentioned. + """ + + name: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + parent: Optional[str] = None + """ + A unique identifier for a legal person in the format `per:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. + """ + + residence: Optional[str] = None + """ + A unique identifier for a location in the format `loc:{index}` where `{index}` + is a non-negative incrementing integer starting from zero. + """ + + role: Literal[ + "plaintiff", + "petitioner", + "applicant", + "appellant", + "appellee", + "claimant", + "complainant", + "defendant", + "respondent", + "prior_authority", + "prosecutor", + "defense_counsel", + "amicus", + "intervener", + "borrower", + "lender", + "guarantor", + "lessee", + "lessor", + "employer", + "employee", + "licensor", + "licensee", + "franchisor", + "franchisee", + "buyer", + "seller", + "contractor", + "shareholder", + "joint_venturer", + "investor", + "insurer", + "insured", + "enacting_authority", + "empowered_authority", + "settlor", + "trustee", + "beneficiary", + "debater", + "director", + "governing_jurisdiction", + "clerk", + "witness", + "other", + "non_party", + ] + """The role of the person in relation to the subject of the document. + + The following roles are currently supported: | | | | ------------------------ | + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + | | `plaintiff` | A party initiating the case that is the subject of the + document. | | `petitioner` | A party initiating the petition that is the subject + of the document. | | `applicant` | A party initiating the application that is + the subject of the document. | | `appellant` | A party appealing the decision + that is the subject of the document. | | `appellee` | A party responding to the + appeal that is the subject of the document if they are explicitly referred to as + an 'appellee'. | | `claimant` | A party making a claim in the case that is the + subject of the document. | | `complainant` | A party making a complaint in the + case that is the subject of the document. | | `defendant` | A party defending + against the case that is the subject of the document. | | `respondent` | A party + responding to the petition, appeal, or application that is the subject of the + document. | | `prior_authority` | An authority (e.g., judge, tribunal, court) + that made a prior decision in the case that is the subject of the document. Both + individual judges and courts should be annotated with this role where + applicable. This is not to be used for authorities cited as precedent, only for + those that made prior decisions in the same case. | | `prosecutor` | A lawyer + prosecuting the case that is the subject of the document. | | `defense_counsel` + | A lawyer defending the case that is the subject of the document. | | `amicus` + | A party filing an amicus curiae brief in the case that is the subject of the + document. | | `intervener` | A party attempting to or that has intervened in the + case that is the subject of the document. | | `borrower` | A party borrowing + money or other assets under the agreement that is the subject of the document, + including 'mortgagors' and 'debtors'. | | `lender` | A party lending money or + other assets under the agreement that is the subject of the document, including + 'mortgagees' and 'creditors'. | | `guarantor` | A party guaranteeing obligations + under the agreement that is the subject of the document, including 'sureties'. | + | `lessee` | A party leasing goods or services under the agreement that is the + subject of the document, including 'tenants'. | | `lessor` | A party leasing + goods or services under the agreement that is the subject of the document, + including 'landlords'. | | `employer` | A party employing personnel under the + agreement that is the subject of the document. | | `employee` | A party employed + under the agreement that is the subject of the document. | | `licensor` | A + party licensing intellectual property or other rights under the agreement that + are the subject of the document. | | `licensee` | A party licensed to use + intellectual property or other rights under the agreement that are the subject + of the document. | | `franchisor` | A party granting a franchise under the + agreement that is the subject of the document. | | `franchisee` | A party + granted a franchise under the agreement that is the subject of the document. | | + `buyer` | A party purchasing goods or services under the agreement that is the + subject of the document, including 'purchasers', 'customers', and 'clients'. | | + `seller` | A party selling or providing goods or services under the agreement + that is the subject of the document, including 'Vendors', 'Suppliers', and + 'Service Providers' (where such parties are actually providing goods or services + under the agreement). | | `contractor` | A party contracted to perform work or + services under the agreement that is the subject of the document, including + 'consultants'. | | `shareholder` | A party holding shares or equity under the + agreement that is the subject of the document. | | `joint_venturer` | A party + participating in a joint venture under the agreement that is the subject of the + document. | | `investor` | A party investing money or assets under the agreement + that is the subject of the document. | | `insurer` | A party providing insurance + under the agreement that is the subject of the document. | | `insured` | A party + insured under the agreement that is the subject of the document. | | `settlor` | + A party establishing the trust that is the subject of the document. | | + `trustee` | A party managing the trust that is the subject of the document. | | + `beneficiary` | A party benefiting from the trust that is the subject of the + document. | | `enacting_authority` | An authority (e.g., legislature, regulator, + Minister/Secretary, President/Prime Minister, tribunal, court, judge) giving + legal effect to or authorizing the document. All relevant individuals and bodies + should be annotated with this role where applicable. | | `empowered_authority` | + An authority (e.g., government agency, regulator, Minister/Secretary, + President/Prime Minister, tribunal, court) empowered by the document to carry + out functions or duties. | | `debater` | A person participating in the debate + that is the subject of the document. | | `governing_jurisdiction` | The + jurisdiction whose laws govern the document. | | `director` | A director or + other officer of a corporate legal person mentioned in the document. | | `clerk` + | A clerk, notary, or other official certifying, witnessing, filing, recording, + registering, or otherwise administering the document. | | `witness` | A witness + witnessing the signing of the document, or whose testimony is part of the case + that is the subject of the document. | | `other` | A party to the case, + agreement, legislation, or regulation that is the subject of the document that + does not fit into any of the other roles. | | `non_party` | A legal person + mentioned in the document that is not a party to the case, agreement, + legislation, or regulation that is the subject of the document. | + """ + + type: Literal["natural", "corporate", "politic"] + """ + The legal entity type of the person, being one of `natural`, `corporate`, or + `politic`. + + `natural` denotes a human being in their capacity as a natural legal person, + including when representing unincorporated entities such as partnerships and + trusts. + + `corporate` denotes a body corporate such as a company, incorporated + partnership, or statutory corporation. + + `politic` denotes a body politic such as a court, state, government, or + intergovernmental organization. + """ diff --git a/src/isaacus/types/ilgs_v1_phone_number.py b/src/isaacus/types/ilgs_v1_phone_number.py new file mode 100644 index 0000000..d8217ec --- /dev/null +++ b/src/isaacus/types/ilgs_v1_phone_number.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1PhoneNumber"] + + +class IlgsV1PhoneNumber(BaseModel): + """A valid phone number identified in a document belonging to a legal person. + + If a phone number was mentioned in the document but is not valid, possible, or attributable to a legal person, it will not be extracted. + """ + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the phone number + is mentioned. + """ + + number: str + """ + The normalized phone number in E.123 international notation conforming with + local conventions on the use of spaces and hyphens as separators. + """ + + person: str + """The unique identifier of the person that this phone number belongs to.""" diff --git a/src/isaacus/types/ilgs_v1_quote.py b/src/isaacus/types/ilgs_v1_quote.py new file mode 100644 index 0000000..69240e9 --- /dev/null +++ b/src/isaacus/types/ilgs_v1_quote.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Quote"] + + +class IlgsV1Quote(BaseModel): + """A quotation within a document.""" + + amending: bool + """ + Whether the quote is being used to amend or modify content, typically in other + documents. + """ + + source_document: Optional[str] = None + """ + A unique identifier for an external document in the format `exd:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. + """ + + source_person: Optional[str] = None + """ + A unique identifier for a legal person in the format `per:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. + """ + + source_segment: Optional[str] = None + """ + A unique identifier for a segment in the format `seg:{index}` where `{index}` is + a non-negative incrementing integer starting from zero. + """ + + span: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ diff --git a/src/isaacus/types/ilgs_v1_segment.py b/src/isaacus/types/ilgs_v1_segment.py new file mode 100644 index 0000000..9033c1a --- /dev/null +++ b/src/isaacus/types/ilgs_v1_segment.py @@ -0,0 +1,205 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Segment"] + + +class IlgsV1Segment(BaseModel): + """ + A segment within the document representing a structurally distinct portion of the document's content. + """ + + id: str + """ + The unique identifier of the segment in the format `seg:{index}` where `{index}` + is a non-negative incrementing integer starting from zero. + """ + + category: Literal["front_matter", "scope", "main", "annotation", "back_matter", "other"] + """ + The functional 'category' of the segment within the document, being one of + `front_matter`, `scope`, `main`, `annotation`, `back_matter`, or `other`. + + `front_matter` denotes non-operative contextualizing content occurring at the + start of a document such as a preamble or recitals. + + `scope` denotes operative content defining the application or interpretation of + a document such as definition sections and governing law clauses. + + `main` denotes operative, non-scopal content. + + `annotation` denotes non-operative annotative content providing explanatory or + referential information such as commentary, footnotes, and endnotes. + + `back_matter` denotes non-operative contextualizing content occurring at the end + of a document such as authority statements. + + `other` denotes content that does not fit into any of the other categories. + """ + + code: Optional[IlgsV1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + kind: Literal["container", "unit", "item", "figure"] + """ + The structural 'kind' of the segment, being one of `container`, `unit`, `item`, + or `figure`. + + A `container` is a structural or semantic grouping of content such as a chapter. + It can contain segments of any kind or none at all. + + A `unit` is a single syntactically independent unit of text such as a paragraph. + It can only contain `item`s and `figure`s. + + An `item` is a syntactically subordinate unit of text such as an item in a + run-in list. It can only contain other `item`s. Note that an `item` is + conceptually distinct from a list item—it is perfectly possible to encounter + list items that are syntactically independent of their surrounding items just as + it is possible to encounter dependent clauses that do not appear as part of a + list. + + A `figure` is a visually structured or tabular unit of content such as a + diagram, equation, or table. It cannot contain segments. + """ + + parent: Optional[str] = None + """ + A unique identifier for a segment in the format `seg:{index}` where `{index}` is + a non-negative incrementing integer starting from zero. + """ + + span: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + title: Optional[IlgsV1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + type: Optional[ + Literal[ + "title", + "book", + "part", + "chapter", + "subchapter", + "division", + "subdivision", + "subpart", + "subtitle", + "table_of_contents", + "article", + "section", + "regulation", + "rule", + "clause", + "paragraph", + "subarticle", + "subsection", + "subregulation", + "subrule", + "subclause", + "subparagraph", + "item", + "subitem", + "point", + "indent", + "schedule", + "annex", + "appendix", + "exhibit", + "recital", + "signature", + "note", + "figure", + "table", + "formula", + ] + ] = None + """ + The addressable 'type' of the segment within the document's referential scheme + and hierarchy, whether defined explicitly (e.g., by headings, such as + 'Section 2. Definitions'), implicitly (e.g., by way of reference, such as 'as + defined in Section 2'), or by convention (e.g., [42] in a judgment often denotes + a `paragraph`, independent provisions in statute are often `section`s, etc.). If + the type is not known or not applicable, it will be set to `null`. + + Note that, although many segment types may coincide with syntactic constructs, + they should be thought of purely as distinct formal citable units. Most + paragraphs (in the syntactic sense) will not have the `paragraph` type, for + example. That type is reserved for segments that would formally be cited as a + 'Paragraph' within the document's referential scheme. + + The following types are currently supported: `title`, `book`, `part`, `chapter`, + `subchapter`, `division`, `subdivision`, `subpart`, `subtitle`, + `table_of_contents`, `article`, `section`, `regulation`, `rule`, `clause`, + `paragraph`, `subarticle`, `subsection`, `subregulation`, `subrule`, + `subclause`, `subparagraph`, `item`, `subitem`, `point`, `indent`, `schedule`, + `annex`, `appendix`, `exhibit`, `recital`, `signature`, `note`, `figure`, + `table`, and `formula`. + + The `title`, `book`, `part`, `chapter`, `subchapter`, `division`, `subdivision`, + `subpart`, `subtitle`, and `table_of_contents` types are exclusive to the + `container` kind. + + The `figure` kind only supports the `figure`, `table`, and `formula` types, all + of which are exclusive to it. + """ + + type_name: Optional[IlgsV1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ diff --git a/src/isaacus/types/ilgs_v1_span.py b/src/isaacus/types/ilgs_v1_span.py new file mode 100644 index 0000000..99fc807 --- /dev/null +++ b/src/isaacus/types/ilgs_v1_span.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["IlgsV1Span"] + + +class IlgsV1Span(BaseModel): + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). + """ + + end: int + """ + The zero-based end index of the half-open span (i.e., the end is exclusive) of + Unicode code points in the input text. + """ + + start: int + """ + The zero-based start index of the half-open span of Unicode code points in the + input text. + """ diff --git a/src/isaacus/types/ilgs_v1_term.py b/src/isaacus/types/ilgs_v1_term.py new file mode 100644 index 0000000..671d584 --- /dev/null +++ b/src/isaacus/types/ilgs_v1_term.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Term"] + + +class IlgsV1Term(BaseModel): + """A term assigned a definite meaning within a document.""" + + id: str + """ + The unique identifier of the term in the format `term:{index}` where `{index}` + is a non-negative incrementing integer starting from zero. + """ + + meaning: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + mentions: List[IlgsV1Span] + """ + An array of spans within the document's text where the term is mentioned outside + of its definition. + + It is possible for the term to have no mentions if, outside of its definition, + it is never referred to in the document. + """ + + name: IlgsV1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ diff --git a/src/isaacus/types/ilgs_v1_website.py b/src/isaacus/types/ilgs_v1_website.py new file mode 100644 index 0000000..9630970 --- /dev/null +++ b/src/isaacus/types/ilgs_v1_website.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .ilgs_v1_span import IlgsV1Span + +__all__ = ["IlgsV1Website"] + + +class IlgsV1Website(BaseModel): + """A website identified in a document belonging to a legal person. + + If a website was mentioned in the document but is not attributable to a legal person, it will not be extracted. + """ + + mentions: List[IlgsV1Span] + """ + An array of one or more spans within the document's text where the website is + mentioned (including paths and slugs which are not part of the website's + normalized URL). + """ + + person: str + """The unique identifier of the person that this website belongs to.""" + + url: str + """The normalized URL of the website in the form `https://{host}/`.""" From f2952227e58618b33c4d0da9515a1c73942a771a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 08:47:54 +0000 Subject: [PATCH 3/6] feat(sdk): modify how ILGSv1 models are cased --- .stats.yml | 2 +- api.md | 28 ++++---- src/isaacus/types/__init__.py | 28 ++++---- src/isaacus/types/enrichment_response.py | 4 +- src/isaacus/types/ilgs_v1_crossreference.py | 8 +-- src/isaacus/types/ilgs_v1_date.py | 8 +-- src/isaacus/types/ilgs_v1_document.py | 68 +++++++++---------- src/isaacus/types/ilgs_v1_email.py | 8 +-- .../types/ilgs_v1_external_document.py | 12 ++-- src/isaacus/types/ilgs_v1_id_number.py | 8 +-- src/isaacus/types/ilgs_v1_location.py | 10 +-- src/isaacus/types/ilgs_v1_person.py | 10 +-- src/isaacus/types/ilgs_v1_phone_number.py | 8 +-- src/isaacus/types/ilgs_v1_quote.py | 8 +-- src/isaacus/types/ilgs_v1_segment.py | 14 ++-- src/isaacus/types/ilgs_v1_span.py | 4 +- src/isaacus/types/ilgs_v1_term.py | 12 ++-- src/isaacus/types/ilgs_v1_website.py | 8 +-- 18 files changed, 124 insertions(+), 124 deletions(-) diff --git a/.stats.yml b/.stats.yml index a7008df..2d6deff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-fa910a5a3d1321234423bd8c042d202a64d4d956ef45847b4de358cb18e447eb.yml openapi_spec_hash: 926b9b619c15e8570e496e11d4fb753e -config_hash: 821656ed414ab3ec256ecfb11585a614 +config_hash: 236fba4cf422cf3eff02516e1dd6e5a2 diff --git a/api.md b/api.md index 0d71432..6ac59d5 100644 --- a/api.md +++ b/api.md @@ -57,20 +57,20 @@ Types: ```python from isaacus.types import ( EnrichmentResponse, - IlgsV1Crossreference, - IlgsV1Date, - IlgsV1Document, - IlgsV1Email, - IlgsV1ExternalDocument, - IlgsV1IDNumber, - IlgsV1Location, - IlgsV1Person, - IlgsV1PhoneNumber, - IlgsV1Quote, - IlgsV1Segment, - IlgsV1Span, - IlgsV1Term, - IlgsV1Website, + ILGSv1Crossreference, + ILGSv1Date, + ILGSv1Document, + ILGSv1Email, + ILGSv1ExternalDocument, + ILGSv1IDNumber, + ILGSv1Location, + ILGSv1Person, + ILGSv1PhoneNumber, + ILGSv1Quote, + ILGSv1Segment, + ILGSv1Span, + ILGSv1Term, + ILGSv1Website, ) ``` diff --git a/src/isaacus/types/__init__.py b/src/isaacus/types/__init__.py index e86bcd2..98a4f77 100644 --- a/src/isaacus/types/__init__.py +++ b/src/isaacus/types/__init__.py @@ -2,23 +2,23 @@ from __future__ import annotations -from .ilgs_v1_date import IlgsV1Date as IlgsV1Date -from .ilgs_v1_span import IlgsV1Span as IlgsV1Span -from .ilgs_v1_term import IlgsV1Term as IlgsV1Term -from .ilgs_v1_email import IlgsV1Email as IlgsV1Email -from .ilgs_v1_quote import IlgsV1Quote as IlgsV1Quote -from .ilgs_v1_person import IlgsV1Person as IlgsV1Person -from .ilgs_v1_segment import IlgsV1Segment as IlgsV1Segment -from .ilgs_v1_website import IlgsV1Website as IlgsV1Website -from .ilgs_v1_document import IlgsV1Document as IlgsV1Document -from .ilgs_v1_location import IlgsV1Location as IlgsV1Location -from .ilgs_v1_id_number import IlgsV1IDNumber as IlgsV1IDNumber +from .ilgs_v1_date import ILGSv1Date as ILGSv1Date +from .ilgs_v1_span import ILGSv1Span as ILGSv1Span +from .ilgs_v1_term import ILGSv1Term as ILGSv1Term +from .ilgs_v1_email import ILGSv1Email as ILGSv1Email +from .ilgs_v1_quote import ILGSv1Quote as ILGSv1Quote +from .ilgs_v1_person import ILGSv1Person as ILGSv1Person +from .ilgs_v1_segment import ILGSv1Segment as ILGSv1Segment +from .ilgs_v1_website import ILGSv1Website as ILGSv1Website +from .ilgs_v1_document import ILGSv1Document as ILGSv1Document +from .ilgs_v1_location import ILGSv1Location as ILGSv1Location +from .ilgs_v1_id_number import ILGSv1IDNumber as ILGSv1IDNumber from .embedding_response import EmbeddingResponse as EmbeddingResponse from .reranking_response import RerankingResponse as RerankingResponse from .enrichment_response import EnrichmentResponse as EnrichmentResponse -from .ilgs_v1_phone_number import IlgsV1PhoneNumber as IlgsV1PhoneNumber -from .ilgs_v1_crossreference import IlgsV1Crossreference as IlgsV1Crossreference +from .ilgs_v1_phone_number import ILGSv1PhoneNumber as ILGSv1PhoneNumber +from .ilgs_v1_crossreference import ILGSv1Crossreference as ILGSv1Crossreference from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams from .reranking_create_params import RerankingCreateParams as RerankingCreateParams from .enrichment_create_params import EnrichmentCreateParams as EnrichmentCreateParams -from .ilgs_v1_external_document import IlgsV1ExternalDocument as IlgsV1ExternalDocument +from .ilgs_v1_external_document import ILGSv1ExternalDocument as ILGSv1ExternalDocument diff --git a/src/isaacus/types/enrichment_response.py b/src/isaacus/types/enrichment_response.py index 0bc0758..1570445 100644 --- a/src/isaacus/types/enrichment_response.py +++ b/src/isaacus/types/enrichment_response.py @@ -3,7 +3,7 @@ from typing import List from .._models import BaseModel -from .ilgs_v1_document import IlgsV1Document +from .ilgs_v1_document import ILGSv1Document __all__ = ["EnrichmentResponse", "Result", "Usage"] @@ -11,7 +11,7 @@ class Result(BaseModel): """An enriched document alongside its index in the input array of texts.""" - document: IlgsV1Document + document: ILGSv1Document """The enriched document.""" index: int diff --git a/src/isaacus/types/ilgs_v1_crossreference.py b/src/isaacus/types/ilgs_v1_crossreference.py index ac54cac..7f469d7 100644 --- a/src/isaacus/types/ilgs_v1_crossreference.py +++ b/src/isaacus/types/ilgs_v1_crossreference.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Crossreference"] +__all__ = ["ILGSv1Crossreference"] -class IlgsV1Crossreference(BaseModel): +class ILGSv1Crossreference(BaseModel): """A cross-reference within the document pointing to one or more segments.""" end: str @@ -17,7 +17,7 @@ class IlgsV1Crossreference(BaseModel): will be identical. """ - span: IlgsV1Span + span: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible diff --git a/src/isaacus/types/ilgs_v1_date.py b/src/isaacus/types/ilgs_v1_date.py index 5e78143..d9b1c8a 100644 --- a/src/isaacus/types/ilgs_v1_date.py +++ b/src/isaacus/types/ilgs_v1_date.py @@ -4,19 +4,19 @@ from typing_extensions import Literal from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Date"] +__all__ = ["ILGSv1Date"] -class IlgsV1Date(BaseModel): +class ILGSv1Date(BaseModel): """ A date identified in a document belonging to one of the following types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, `payment`, `birth`, or `death`. Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into one of the supported date types are extractable. """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the date is mentioned. diff --git a/src/isaacus/types/ilgs_v1_document.py b/src/isaacus/types/ilgs_v1_document.py index 1ada3ce..bbccd86 100644 --- a/src/isaacus/types/ilgs_v1_document.py +++ b/src/isaacus/types/ilgs_v1_document.py @@ -4,33 +4,33 @@ from typing_extensions import Literal from .._models import BaseModel -from .ilgs_v1_date import IlgsV1Date -from .ilgs_v1_span import IlgsV1Span -from .ilgs_v1_term import IlgsV1Term -from .ilgs_v1_email import IlgsV1Email -from .ilgs_v1_quote import IlgsV1Quote -from .ilgs_v1_person import IlgsV1Person -from .ilgs_v1_segment import IlgsV1Segment -from .ilgs_v1_website import IlgsV1Website -from .ilgs_v1_location import IlgsV1Location -from .ilgs_v1_id_number import IlgsV1IDNumber -from .ilgs_v1_phone_number import IlgsV1PhoneNumber -from .ilgs_v1_crossreference import IlgsV1Crossreference -from .ilgs_v1_external_document import IlgsV1ExternalDocument - -__all__ = ["IlgsV1Document"] - - -class IlgsV1Document(BaseModel): +from .ilgs_v1_date import ILGSv1Date +from .ilgs_v1_span import ILGSv1Span +from .ilgs_v1_term import ILGSv1Term +from .ilgs_v1_email import ILGSv1Email +from .ilgs_v1_quote import ILGSv1Quote +from .ilgs_v1_person import ILGSv1Person +from .ilgs_v1_segment import ILGSv1Segment +from .ilgs_v1_website import ILGSv1Website +from .ilgs_v1_location import ILGSv1Location +from .ilgs_v1_id_number import ILGSv1IDNumber +from .ilgs_v1_phone_number import ILGSv1PhoneNumber +from .ilgs_v1_crossreference import ILGSv1Crossreference +from .ilgs_v1_external_document import ILGSv1ExternalDocument + +__all__ = ["ILGSv1Document"] + + +class ILGSv1Document(BaseModel): """The enriched document.""" - crossreferences: List[IlgsV1Crossreference] + crossreferences: List[ILGSv1Crossreference] """ An array of cross-references within the document pointing to a single segment or a span of segments. """ - dates: List[IlgsV1Date] + dates: List[ILGSv1Date] """ An array of dates identified in the document belonging to one of the following types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, @@ -40,7 +40,7 @@ class IlgsV1Document(BaseModel): one of the supported date types are extractable. """ - emails: List[IlgsV1Email] + emails: List[ILGSv1Email] """ An array of email addresses identified in the document belonging to legal persons. @@ -49,13 +49,13 @@ class IlgsV1Document(BaseModel): persons will not be extracted. """ - external_documents: List[IlgsV1ExternalDocument] + external_documents: List[ILGSv1ExternalDocument] """An array of documents identified within the document.""" - headings: List[IlgsV1Span] + headings: List[ILGSv1Span] """An array of spans within the document's text constituting headings.""" - id_numbers: List[IlgsV1IDNumber] + id_numbers: List[ILGSv1IDNumber] """ An array of identification numbers identified in the document belonging to legal persons. @@ -64,7 +64,7 @@ class IlgsV1Document(BaseModel): legal persons will not be extracted. """ - junk: List[IlgsV1Span] + junk: List[ILGSv1Span] """ An array of spans within the document's text constituting non-operative, non-substantive 'junk' content such as headers, footers, page numbers, and OCR @@ -85,13 +85,13 @@ class IlgsV1Document(BaseModel): code for federal law. """ - locations: List[IlgsV1Location] + locations: List[ILGSv1Location] """An array of locations identified in the document.""" - persons: List[IlgsV1Person] + persons: List[ILGSv1Person] """An array of legal persons identified in the document.""" - phone_numbers: List[IlgsV1PhoneNumber] + phone_numbers: List[ILGSv1PhoneNumber] """ An array of valid phone numbers identified in the document belonging to legal persons. @@ -100,16 +100,16 @@ class IlgsV1Document(BaseModel): attributable to legal persons will not be extracted. """ - quotes: List[IlgsV1Quote] + quotes: List[ILGSv1Quote] """An array of quotations within the document.""" - segments: List[IlgsV1Segment] + segments: List[ILGSv1Segment] """ An array of segments within the document representing structurally distinct portions of its content. """ - subtitle: Optional[IlgsV1Span] = None + subtitle: Optional[ILGSv1Span] = None """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -125,10 +125,10 @@ class IlgsV1Document(BaseModel): code units instead of Unicode code points). """ - terms: List[IlgsV1Term] + terms: List[ILGSv1Term] """An array of terms assigned definite meanings within the document.""" - title: Optional[IlgsV1Span] = None + title: Optional[ILGSv1Span] = None """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -164,7 +164,7 @@ class IlgsV1Document(BaseModel): version: Literal["ilgs@1"] - websites: List[IlgsV1Website] + websites: List[ILGSv1Website] """An array of websites identified in the document belonging to legal persons. Websites mentioned in the document that are not attributable to legal persons diff --git a/src/isaacus/types/ilgs_v1_email.py b/src/isaacus/types/ilgs_v1_email.py index 720589c..6d040b5 100644 --- a/src/isaacus/types/ilgs_v1_email.py +++ b/src/isaacus/types/ilgs_v1_email.py @@ -3,12 +3,12 @@ from typing import List from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Email"] +__all__ = ["ILGSv1Email"] -class IlgsV1Email(BaseModel): +class ILGSv1Email(BaseModel): """An email address identified in a document belonging to a legal person. If an email address was mentioned in the document but is not attributable to a legal person, it will not be extracted. @@ -17,7 +17,7 @@ class IlgsV1Email(BaseModel): address: str """The normalized email address.""" - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the email address is mentioned. diff --git a/src/isaacus/types/ilgs_v1_external_document.py b/src/isaacus/types/ilgs_v1_external_document.py index fac95a5..ad970c0 100644 --- a/src/isaacus/types/ilgs_v1_external_document.py +++ b/src/isaacus/types/ilgs_v1_external_document.py @@ -4,12 +4,12 @@ from typing_extensions import Literal from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1ExternalDocument"] +__all__ = ["ILGSv1ExternalDocument"] -class IlgsV1ExternalDocument(BaseModel): +class ILGSv1ExternalDocument(BaseModel): """A document identified within another document.""" id: str @@ -32,14 +32,14 @@ class IlgsV1ExternalDocument(BaseModel): code for federal law. """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the external document is mentioned by name, for example, 'the US Constitution' in 'the Second Amendment to the US Constitution protects freedom of speech'. """ - name: IlgsV1Span + name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -55,7 +55,7 @@ class IlgsV1ExternalDocument(BaseModel): code units instead of Unicode code points). """ - pinpoints: List[IlgsV1Span] + pinpoints: List[ILGSv1Span] """ An array of spans within the document's text where specific parts of the external document are referenced, for example, 'Section 2' in 'as defined in diff --git a/src/isaacus/types/ilgs_v1_id_number.py b/src/isaacus/types/ilgs_v1_id_number.py index e6b2c3a..80b8bb0 100644 --- a/src/isaacus/types/ilgs_v1_id_number.py +++ b/src/isaacus/types/ilgs_v1_id_number.py @@ -3,18 +3,18 @@ from typing import List from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1IDNumber"] +__all__ = ["ILGSv1IDNumber"] -class IlgsV1IDNumber(BaseModel): +class ILGSv1IDNumber(BaseModel): """An identification number mentioned in a document belonging to a legal person. If an identification number was mentioned in the document but is not attributable to a legal person, it will not be extracted. """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the identification number is mentioned. diff --git a/src/isaacus/types/ilgs_v1_location.py b/src/isaacus/types/ilgs_v1_location.py index 85e2c38..9e8b3ef 100644 --- a/src/isaacus/types/ilgs_v1_location.py +++ b/src/isaacus/types/ilgs_v1_location.py @@ -4,12 +4,12 @@ from typing_extensions import Literal from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Location"] +__all__ = ["ILGSv1Location"] -class IlgsV1Location(BaseModel): +class ILGSv1Location(BaseModel): """A location identified within a document.""" id: str @@ -18,13 +18,13 @@ class IlgsV1Location(BaseModel): `{index}` is a non-negative incrementing integer starting from zero. """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the location is mentioned. """ - name: IlgsV1Span + name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible diff --git a/src/isaacus/types/ilgs_v1_person.py b/src/isaacus/types/ilgs_v1_person.py index 243fe4a..5b5b888 100644 --- a/src/isaacus/types/ilgs_v1_person.py +++ b/src/isaacus/types/ilgs_v1_person.py @@ -4,12 +4,12 @@ from typing_extensions import Literal from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Person"] +__all__ = ["ILGSv1Person"] -class IlgsV1Person(BaseModel): +class ILGSv1Person(BaseModel): """A legal person identified in a document.""" id: str @@ -18,13 +18,13 @@ class IlgsV1Person(BaseModel): is a non-negative incrementing integer starting from zero. """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the person is mentioned. """ - name: IlgsV1Span + name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible diff --git a/src/isaacus/types/ilgs_v1_phone_number.py b/src/isaacus/types/ilgs_v1_phone_number.py index d8217ec..58cebfe 100644 --- a/src/isaacus/types/ilgs_v1_phone_number.py +++ b/src/isaacus/types/ilgs_v1_phone_number.py @@ -3,18 +3,18 @@ from typing import List from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1PhoneNumber"] +__all__ = ["ILGSv1PhoneNumber"] -class IlgsV1PhoneNumber(BaseModel): +class ILGSv1PhoneNumber(BaseModel): """A valid phone number identified in a document belonging to a legal person. If a phone number was mentioned in the document but is not valid, possible, or attributable to a legal person, it will not be extracted. """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the phone number is mentioned. diff --git a/src/isaacus/types/ilgs_v1_quote.py b/src/isaacus/types/ilgs_v1_quote.py index 69240e9..a12da90 100644 --- a/src/isaacus/types/ilgs_v1_quote.py +++ b/src/isaacus/types/ilgs_v1_quote.py @@ -3,12 +3,12 @@ from typing import Optional from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Quote"] +__all__ = ["ILGSv1Quote"] -class IlgsV1Quote(BaseModel): +class ILGSv1Quote(BaseModel): """A quotation within a document.""" amending: bool @@ -35,7 +35,7 @@ class IlgsV1Quote(BaseModel): a non-negative incrementing integer starting from zero. """ - span: IlgsV1Span + span: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible diff --git a/src/isaacus/types/ilgs_v1_segment.py b/src/isaacus/types/ilgs_v1_segment.py index 9033c1a..8d903cc 100644 --- a/src/isaacus/types/ilgs_v1_segment.py +++ b/src/isaacus/types/ilgs_v1_segment.py @@ -4,12 +4,12 @@ from typing_extensions import Literal from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Segment"] +__all__ = ["ILGSv1Segment"] -class IlgsV1Segment(BaseModel): +class ILGSv1Segment(BaseModel): """ A segment within the document representing a structurally distinct portion of the document's content. """ @@ -42,7 +42,7 @@ class IlgsV1Segment(BaseModel): `other` denotes content that does not fit into any of the other categories. """ - code: Optional[IlgsV1Span] = None + code: Optional[ILGSv1Span] = None """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -86,7 +86,7 @@ class IlgsV1Segment(BaseModel): a non-negative incrementing integer starting from zero. """ - span: IlgsV1Span + span: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -102,7 +102,7 @@ class IlgsV1Segment(BaseModel): code units instead of Unicode code points). """ - title: Optional[IlgsV1Span] = None + title: Optional[ILGSv1Span] = None """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -188,7 +188,7 @@ class IlgsV1Segment(BaseModel): of which are exclusive to it. """ - type_name: Optional[IlgsV1Span] = None + type_name: Optional[ILGSv1Span] = None """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible diff --git a/src/isaacus/types/ilgs_v1_span.py b/src/isaacus/types/ilgs_v1_span.py index 99fc807..e7b5ff1 100644 --- a/src/isaacus/types/ilgs_v1_span.py +++ b/src/isaacus/types/ilgs_v1_span.py @@ -2,10 +2,10 @@ from .._models import BaseModel -__all__ = ["IlgsV1Span"] +__all__ = ["ILGSv1Span"] -class IlgsV1Span(BaseModel): +class ILGSv1Span(BaseModel): """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible for any two spans to partially overlap; they can only be disjoint, adjacent, or wholly nested. Spans of the exact same type (e.g., segments) will never be duplicated. diff --git a/src/isaacus/types/ilgs_v1_term.py b/src/isaacus/types/ilgs_v1_term.py index 671d584..963f312 100644 --- a/src/isaacus/types/ilgs_v1_term.py +++ b/src/isaacus/types/ilgs_v1_term.py @@ -3,12 +3,12 @@ from typing import List from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Term"] +__all__ = ["ILGSv1Term"] -class IlgsV1Term(BaseModel): +class ILGSv1Term(BaseModel): """A term assigned a definite meaning within a document.""" id: str @@ -17,7 +17,7 @@ class IlgsV1Term(BaseModel): is a non-negative incrementing integer starting from zero. """ - meaning: IlgsV1Span + meaning: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -33,7 +33,7 @@ class IlgsV1Term(BaseModel): code units instead of Unicode code points). """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of spans within the document's text where the term is mentioned outside of its definition. @@ -42,7 +42,7 @@ class IlgsV1Term(BaseModel): it is never referred to in the document. """ - name: IlgsV1Span + name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible diff --git a/src/isaacus/types/ilgs_v1_website.py b/src/isaacus/types/ilgs_v1_website.py index 9630970..6415320 100644 --- a/src/isaacus/types/ilgs_v1_website.py +++ b/src/isaacus/types/ilgs_v1_website.py @@ -3,18 +3,18 @@ from typing import List from .._models import BaseModel -from .ilgs_v1_span import IlgsV1Span +from .ilgs_v1_span import ILGSv1Span -__all__ = ["IlgsV1Website"] +__all__ = ["ILGSv1Website"] -class IlgsV1Website(BaseModel): +class ILGSv1Website(BaseModel): """A website identified in a document belonging to a legal person. If a website was mentioned in the document but is not attributable to a legal person, it will not be extracted. """ - mentions: List[IlgsV1Span] + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the website is mentioned (including paths and slugs which are not part of the website's From 27162f3e98efa095e41f67801c6a3497709be9d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 09:08:49 +0000 Subject: [PATCH 4/6] feat(sdk): add `qa` as an initialism --- .stats.yml | 2 +- api.md | 2 +- src/isaacus/resources/extractions/__init__.py | 24 +++++------ .../resources/extractions/extractions.py | 36 ++++++++-------- src/isaacus/resources/extractions/qa.py | 42 +++++++++---------- src/isaacus/types/extractions/__init__.py | 2 +- .../types/extractions/qa_create_params.py | 4 +- tests/api_resources/extractions/test_qa.py | 4 +- 8 files changed, 58 insertions(+), 58 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2d6deff..7a1bd39 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-fa910a5a3d1321234423bd8c042d202a64d4d956ef45847b4de358cb18e447eb.yml openapi_spec_hash: 926b9b619c15e8570e496e11d4fb753e -config_hash: 236fba4cf422cf3eff02516e1dd6e5a2 +config_hash: 14b7f54005fa53738489a6f68b06a35c diff --git a/api.md b/api.md index 6ac59d5..4245c80 100644 --- a/api.md +++ b/api.md @@ -38,7 +38,7 @@ Methods: # Extractions -## Qa +## QA Types: diff --git a/src/isaacus/resources/extractions/__init__.py b/src/isaacus/resources/extractions/__init__.py index 820c06a..f36d186 100644 --- a/src/isaacus/resources/extractions/__init__.py +++ b/src/isaacus/resources/extractions/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .qa import ( - QaResource, - AsyncQaResource, - QaResourceWithRawResponse, - AsyncQaResourceWithRawResponse, - QaResourceWithStreamingResponse, - AsyncQaResourceWithStreamingResponse, + QAResource, + AsyncQAResource, + QAResourceWithRawResponse, + AsyncQAResourceWithRawResponse, + QAResourceWithStreamingResponse, + AsyncQAResourceWithStreamingResponse, ) from .extractions import ( ExtractionsResource, @@ -18,12 +18,12 @@ ) __all__ = [ - "QaResource", - "AsyncQaResource", - "QaResourceWithRawResponse", - "AsyncQaResourceWithRawResponse", - "QaResourceWithStreamingResponse", - "AsyncQaResourceWithStreamingResponse", + "QAResource", + "AsyncQAResource", + "QAResourceWithRawResponse", + "AsyncQAResourceWithRawResponse", + "QAResourceWithStreamingResponse", + "AsyncQAResourceWithStreamingResponse", "ExtractionsResource", "AsyncExtractionsResource", "ExtractionsResourceWithRawResponse", diff --git a/src/isaacus/resources/extractions/extractions.py b/src/isaacus/resources/extractions/extractions.py index a967336..ee0b810 100644 --- a/src/isaacus/resources/extractions/extractions.py +++ b/src/isaacus/resources/extractions/extractions.py @@ -3,12 +3,12 @@ from __future__ import annotations from .qa import ( - QaResource, - AsyncQaResource, - QaResourceWithRawResponse, - AsyncQaResourceWithRawResponse, - QaResourceWithStreamingResponse, - AsyncQaResourceWithStreamingResponse, + QAResource, + AsyncQAResource, + QAResourceWithRawResponse, + AsyncQAResourceWithRawResponse, + QAResourceWithStreamingResponse, + AsyncQAResourceWithStreamingResponse, ) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -18,8 +18,8 @@ class ExtractionsResource(SyncAPIResource): @cached_property - def qa(self) -> QaResource: - return QaResource(self._client) + def qa(self) -> QAResource: + return QAResource(self._client) @cached_property def with_raw_response(self) -> ExtractionsResourceWithRawResponse: @@ -43,8 +43,8 @@ def with_streaming_response(self) -> ExtractionsResourceWithStreamingResponse: class AsyncExtractionsResource(AsyncAPIResource): @cached_property - def qa(self) -> AsyncQaResource: - return AsyncQaResource(self._client) + def qa(self) -> AsyncQAResource: + return AsyncQAResource(self._client) @cached_property def with_raw_response(self) -> AsyncExtractionsResourceWithRawResponse: @@ -71,8 +71,8 @@ def __init__(self, extractions: ExtractionsResource) -> None: self._extractions = extractions @cached_property - def qa(self) -> QaResourceWithRawResponse: - return QaResourceWithRawResponse(self._extractions.qa) + def qa(self) -> QAResourceWithRawResponse: + return QAResourceWithRawResponse(self._extractions.qa) class AsyncExtractionsResourceWithRawResponse: @@ -80,8 +80,8 @@ def __init__(self, extractions: AsyncExtractionsResource) -> None: self._extractions = extractions @cached_property - def qa(self) -> AsyncQaResourceWithRawResponse: - return AsyncQaResourceWithRawResponse(self._extractions.qa) + def qa(self) -> AsyncQAResourceWithRawResponse: + return AsyncQAResourceWithRawResponse(self._extractions.qa) class ExtractionsResourceWithStreamingResponse: @@ -89,8 +89,8 @@ def __init__(self, extractions: ExtractionsResource) -> None: self._extractions = extractions @cached_property - def qa(self) -> QaResourceWithStreamingResponse: - return QaResourceWithStreamingResponse(self._extractions.qa) + def qa(self) -> QAResourceWithStreamingResponse: + return QAResourceWithStreamingResponse(self._extractions.qa) class AsyncExtractionsResourceWithStreamingResponse: @@ -98,5 +98,5 @@ def __init__(self, extractions: AsyncExtractionsResource) -> None: self._extractions = extractions @cached_property - def qa(self) -> AsyncQaResourceWithStreamingResponse: - return AsyncQaResourceWithStreamingResponse(self._extractions.qa) + def qa(self) -> AsyncQAResourceWithStreamingResponse: + return AsyncQAResourceWithStreamingResponse(self._extractions.qa) diff --git a/src/isaacus/resources/extractions/qa.py b/src/isaacus/resources/extractions/qa.py index 22168f3..462761c 100644 --- a/src/isaacus/resources/extractions/qa.py +++ b/src/isaacus/resources/extractions/qa.py @@ -21,28 +21,28 @@ from ...types.extractions import qa_create_params from ...types.extractions.answer_extraction_response import AnswerExtractionResponse -__all__ = ["QaResource", "AsyncQaResource"] +__all__ = ["QAResource", "AsyncQAResource"] -class QaResource(SyncAPIResource): +class QAResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> QaResourceWithRawResponse: + def with_raw_response(self) -> QAResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/isaacus-dev/isaacus-python#accessing-raw-response-data-eg-headers """ - return QaResourceWithRawResponse(self) + return QAResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> QaResourceWithStreamingResponse: + def with_streaming_response(self) -> QAResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/isaacus-dev/isaacus-python#with_streaming_response """ - return QaResourceWithStreamingResponse(self) + return QAResourceWithStreamingResponse(self) def create( self, @@ -115,7 +115,7 @@ def create( "ignore_inextractability": ignore_inextractability, "top_k": top_k, }, - qa_create_params.QaCreateParams, + qa_create_params.QACreateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -124,25 +124,25 @@ def create( ) -class AsyncQaResource(AsyncAPIResource): +class AsyncQAResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncQaResourceWithRawResponse: + def with_raw_response(self) -> AsyncQAResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/isaacus-dev/isaacus-python#accessing-raw-response-data-eg-headers """ - return AsyncQaResourceWithRawResponse(self) + return AsyncQAResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncQaResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncQAResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/isaacus-dev/isaacus-python#with_streaming_response """ - return AsyncQaResourceWithStreamingResponse(self) + return AsyncQAResourceWithStreamingResponse(self) async def create( self, @@ -215,7 +215,7 @@ async def create( "ignore_inextractability": ignore_inextractability, "top_k": top_k, }, - qa_create_params.QaCreateParams, + qa_create_params.QACreateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -224,8 +224,8 @@ async def create( ) -class QaResourceWithRawResponse: - def __init__(self, qa: QaResource) -> None: +class QAResourceWithRawResponse: + def __init__(self, qa: QAResource) -> None: self._qa = qa self.create = to_raw_response_wrapper( @@ -233,8 +233,8 @@ def __init__(self, qa: QaResource) -> None: ) -class AsyncQaResourceWithRawResponse: - def __init__(self, qa: AsyncQaResource) -> None: +class AsyncQAResourceWithRawResponse: + def __init__(self, qa: AsyncQAResource) -> None: self._qa = qa self.create = async_to_raw_response_wrapper( @@ -242,8 +242,8 @@ def __init__(self, qa: AsyncQaResource) -> None: ) -class QaResourceWithStreamingResponse: - def __init__(self, qa: QaResource) -> None: +class QAResourceWithStreamingResponse: + def __init__(self, qa: QAResource) -> None: self._qa = qa self.create = to_streamed_response_wrapper( @@ -251,8 +251,8 @@ def __init__(self, qa: QaResource) -> None: ) -class AsyncQaResourceWithStreamingResponse: - def __init__(self, qa: AsyncQaResource) -> None: +class AsyncQAResourceWithStreamingResponse: + def __init__(self, qa: AsyncQAResource) -> None: self._qa = qa self.create = async_to_streamed_response_wrapper( diff --git a/src/isaacus/types/extractions/__init__.py b/src/isaacus/types/extractions/__init__.py index 39de7b6..a23d9ed 100644 --- a/src/isaacus/types/extractions/__init__.py +++ b/src/isaacus/types/extractions/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .qa_create_params import QaCreateParams as QaCreateParams +from .qa_create_params import QACreateParams as QACreateParams from .answer_extraction_response import AnswerExtractionResponse as AnswerExtractionResponse diff --git a/src/isaacus/types/extractions/qa_create_params.py b/src/isaacus/types/extractions/qa_create_params.py index 8cc1b91..0ea2e7b 100644 --- a/src/isaacus/types/extractions/qa_create_params.py +++ b/src/isaacus/types/extractions/qa_create_params.py @@ -7,10 +7,10 @@ from ..._types import SequenceNotStr -__all__ = ["QaCreateParams", "ChunkingOptions"] +__all__ = ["QACreateParams", "ChunkingOptions"] -class QaCreateParams(TypedDict, total=False): +class QACreateParams(TypedDict, total=False): model: Required[Literal["kanon-answer-extractor", "kanon-answer-extractor-mini"]] """ The ID of the diff --git a/tests/api_resources/extractions/test_qa.py b/tests/api_resources/extractions/test_qa.py index 181cfce..dc9dd83 100644 --- a/tests/api_resources/extractions/test_qa.py +++ b/tests/api_resources/extractions/test_qa.py @@ -14,7 +14,7 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestQa: +class TestQA: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip(reason="Prism tests are disabled") @@ -83,7 +83,7 @@ def test_streaming_response_create(self, client: Isaacus) -> None: assert cast(Any, response.is_closed) is True -class TestAsyncQa: +class TestAsyncQA: parametrize = pytest.mark.parametrize( "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) From 3dc865c2ee865b334b7f0ca8810226f3ac251be8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 22:42:19 +0000 Subject: [PATCH 5/6] feat(sdk): order properties as in spec --- .stats.yml | 2 +- .../resources/classifications/universal.py | 16 +- src/isaacus/resources/embeddings.py | 48 ++--- src/isaacus/resources/extractions/qa.py | 16 +- src/isaacus/resources/rerankings.py | 24 +-- .../universal_classification_response.py | 44 ++--- .../universal_create_params.py | 12 +- src/isaacus/types/embedding_create_params.py | 22 +-- src/isaacus/types/embedding_response.py | 6 +- src/isaacus/types/enrichment_response.py | 6 +- .../extractions/answer_extraction_response.py | 24 +-- .../types/extractions/qa_create_params.py | 12 +- src/isaacus/types/ilgs_v1_crossreference.py | 16 +- src/isaacus/types/ilgs_v1_date.py | 26 +-- src/isaacus/types/ilgs_v1_document.py | 172 +++++++++--------- src/isaacus/types/ilgs_v1_email.py | 6 +- .../types/ilgs_v1_external_document.py | 78 ++++---- src/isaacus/types/ilgs_v1_id_number.py | 12 +- src/isaacus/types/ilgs_v1_location.py | 18 +- src/isaacus/types/ilgs_v1_person.py | 50 ++--- src/isaacus/types/ilgs_v1_phone_number.py | 12 +- src/isaacus/types/ilgs_v1_quote.py | 12 +- src/isaacus/types/ilgs_v1_segment.py | 152 ++++++++-------- src/isaacus/types/ilgs_v1_span.py | 12 +- src/isaacus/types/ilgs_v1_term.py | 22 +-- src/isaacus/types/ilgs_v1_website.py | 12 +- src/isaacus/types/reranking_create_params.py | 14 +- .../classifications/test_universal.py | 12 +- tests/api_resources/extractions/test_qa.py | 12 +- tests/api_resources/test_embeddings.py | 8 +- tests/api_resources/test_rerankings.py | 16 +- 31 files changed, 447 insertions(+), 447 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7a1bd39..3d7a14c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-fa910a5a3d1321234423bd8c042d202a64d4d956ef45847b4de358cb18e447eb.yml openapi_spec_hash: 926b9b619c15e8570e496e11d4fb753e -config_hash: 14b7f54005fa53738489a6f68b06a35c +config_hash: a23e347480e00cefa57ce68b1de9e16d diff --git a/src/isaacus/resources/classifications/universal.py b/src/isaacus/resources/classifications/universal.py index 8aee937..780394b 100644 --- a/src/isaacus/resources/classifications/universal.py +++ b/src/isaacus/resources/classifications/universal.py @@ -50,9 +50,9 @@ def create( model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], query: str, texts: SequenceNotStr[str], - chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit, is_iql: bool | Omit = omit, scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit, + chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -80,8 +80,6 @@ def create( Each text must contain at least one non-whitespace character. - chunking_options: Options for how to split text into smaller chunks. - is_iql: Whether the query should be interpreted as an [IQL](https://docs.isaacus.com/iql) query or else as a statement. @@ -97,6 +95,8 @@ def create( `chunk_min` uses the lowest confidence score of all of the texts' chunks. + chunking_options: Options for how to split text into smaller chunks. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -112,9 +112,9 @@ def create( "model": model, "query": query, "texts": texts, - "chunking_options": chunking_options, "is_iql": is_iql, "scoring_method": scoring_method, + "chunking_options": chunking_options, }, universal_create_params.UniversalCreateParams, ), @@ -151,9 +151,9 @@ async def create( model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], query: str, texts: SequenceNotStr[str], - chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit, is_iql: bool | Omit = omit, scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit, + chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -181,8 +181,6 @@ async def create( Each text must contain at least one non-whitespace character. - chunking_options: Options for how to split text into smaller chunks. - is_iql: Whether the query should be interpreted as an [IQL](https://docs.isaacus.com/iql) query or else as a statement. @@ -198,6 +196,8 @@ async def create( `chunk_min` uses the lowest confidence score of all of the texts' chunks. + chunking_options: Options for how to split text into smaller chunks. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -213,9 +213,9 @@ async def create( "model": model, "query": query, "texts": texts, - "chunking_options": chunking_options, "is_iql": is_iql, "scoring_method": scoring_method, + "chunking_options": chunking_options, }, universal_create_params.UniversalCreateParams, ), diff --git a/src/isaacus/resources/embeddings.py b/src/isaacus/resources/embeddings.py index 96f0c51..e7a5e3a 100644 --- a/src/isaacus/resources/embeddings.py +++ b/src/isaacus/resources/embeddings.py @@ -49,9 +49,9 @@ def create( *, model: Literal["kanon-2-embedder"], texts: Union[SequenceNotStr[str], str], - dimensions: Optional[int] | Omit = omit, - overflow_strategy: Optional[Literal["drop_end"]] | Omit = omit, task: Optional[Literal["retrieval/query", "retrieval/document"]] | Omit = omit, + overflow_strategy: Optional[Literal["drop_end"]] | Omit = omit, + dimensions: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,7 +72,13 @@ def create( No more than 128 texts can be embedded in a single request. - dimensions: A whole number greater than or equal to 1. + task: The task the embeddings will be used for. + + `retrieval/query` is meant for queries and statements, and `retrieval/document` + is meant for anything to be retrieved using query embeddings. + + If `null`, which is the default setting, embeddings will not be optimized for + any particular task. overflow_strategy: The strategy to employ when content exceeds the model's maximum input length. @@ -82,13 +88,7 @@ def create( If `null`, an error will be raised if any content exceeds the model's maximum input length. - task: The task the embeddings will be used for. - - `retrieval/query` is meant for queries and statements, and `retrieval/document` - is meant for anything to be retrieved using query embeddings. - - If `null`, which is the default setting, embeddings will not be optimized for - any particular task. + dimensions: A whole number greater than or equal to 1. extra_headers: Send extra headers @@ -104,9 +104,9 @@ def create( { "model": model, "texts": texts, - "dimensions": dimensions, - "overflow_strategy": overflow_strategy, "task": task, + "overflow_strategy": overflow_strategy, + "dimensions": dimensions, }, embedding_create_params.EmbeddingCreateParams, ), @@ -142,9 +142,9 @@ async def create( *, model: Literal["kanon-2-embedder"], texts: Union[SequenceNotStr[str], str], - dimensions: Optional[int] | Omit = omit, - overflow_strategy: Optional[Literal["drop_end"]] | Omit = omit, task: Optional[Literal["retrieval/query", "retrieval/document"]] | Omit = omit, + overflow_strategy: Optional[Literal["drop_end"]] | Omit = omit, + dimensions: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -165,7 +165,13 @@ async def create( No more than 128 texts can be embedded in a single request. - dimensions: A whole number greater than or equal to 1. + task: The task the embeddings will be used for. + + `retrieval/query` is meant for queries and statements, and `retrieval/document` + is meant for anything to be retrieved using query embeddings. + + If `null`, which is the default setting, embeddings will not be optimized for + any particular task. overflow_strategy: The strategy to employ when content exceeds the model's maximum input length. @@ -175,13 +181,7 @@ async def create( If `null`, an error will be raised if any content exceeds the model's maximum input length. - task: The task the embeddings will be used for. - - `retrieval/query` is meant for queries and statements, and `retrieval/document` - is meant for anything to be retrieved using query embeddings. - - If `null`, which is the default setting, embeddings will not be optimized for - any particular task. + dimensions: A whole number greater than or equal to 1. extra_headers: Send extra headers @@ -197,9 +197,9 @@ async def create( { "model": model, "texts": texts, - "dimensions": dimensions, - "overflow_strategy": overflow_strategy, "task": task, + "overflow_strategy": overflow_strategy, + "dimensions": dimensions, }, embedding_create_params.EmbeddingCreateParams, ), diff --git a/src/isaacus/resources/extractions/qa.py b/src/isaacus/resources/extractions/qa.py index 462761c..454f3e0 100644 --- a/src/isaacus/resources/extractions/qa.py +++ b/src/isaacus/resources/extractions/qa.py @@ -50,9 +50,9 @@ def create( model: Literal["kanon-answer-extractor", "kanon-answer-extractor-mini"], query: str, texts: SequenceNotStr[str], - chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit, ignore_inextractability: bool | Omit = omit, top_k: int | Omit = omit, + chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -82,8 +82,6 @@ def create( Each text must contain at least one non-whitespace character. - chunking_options: Options for how to split text into smaller chunks. - ignore_inextractability: Whether to, if the model's score of the likelihood that an answer can not be extracted from a text is greater than the highest score of all possible answers, still return the highest scoring answers for that text. @@ -96,6 +94,8 @@ def create( If `null`, which is the default, all answers will be returned. + chunking_options: Options for how to split text into smaller chunks. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -111,9 +111,9 @@ def create( "model": model, "query": query, "texts": texts, - "chunking_options": chunking_options, "ignore_inextractability": ignore_inextractability, "top_k": top_k, + "chunking_options": chunking_options, }, qa_create_params.QACreateParams, ), @@ -150,9 +150,9 @@ async def create( model: Literal["kanon-answer-extractor", "kanon-answer-extractor-mini"], query: str, texts: SequenceNotStr[str], - chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit, ignore_inextractability: bool | Omit = omit, top_k: int | Omit = omit, + chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -182,8 +182,6 @@ async def create( Each text must contain at least one non-whitespace character. - chunking_options: Options for how to split text into smaller chunks. - ignore_inextractability: Whether to, if the model's score of the likelihood that an answer can not be extracted from a text is greater than the highest score of all possible answers, still return the highest scoring answers for that text. @@ -196,6 +194,8 @@ async def create( If `null`, which is the default, all answers will be returned. + chunking_options: Options for how to split text into smaller chunks. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -211,9 +211,9 @@ async def create( "model": model, "query": query, "texts": texts, - "chunking_options": chunking_options, "ignore_inextractability": ignore_inextractability, "top_k": top_k, + "chunking_options": chunking_options, }, qa_create_params.QACreateParams, ), diff --git a/src/isaacus/resources/rerankings.py b/src/isaacus/resources/rerankings.py index 94b7b31..cde9f98 100644 --- a/src/isaacus/resources/rerankings.py +++ b/src/isaacus/resources/rerankings.py @@ -50,10 +50,10 @@ def create( model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], query: str, texts: SequenceNotStr[str], - chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit, + top_n: Optional[int] | Omit = omit, is_iql: bool | Omit = omit, scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit, - top_n: Optional[int] | Omit = omit, + chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -82,7 +82,7 @@ def create( Each text must contain at least one non-whitespace character. - chunking_options: Options for how to split text into smaller chunks. + top_n: A whole number greater than or equal to 1. is_iql: Whether the query should be interpreted as an [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query, which is not @@ -104,7 +104,7 @@ def create( `chunk_min` uses the lowest relevance score of all of a text's chunks. - top_n: A whole number greater than or equal to 1. + chunking_options: Options for how to split text into smaller chunks. extra_headers: Send extra headers @@ -121,10 +121,10 @@ def create( "model": model, "query": query, "texts": texts, - "chunking_options": chunking_options, + "top_n": top_n, "is_iql": is_iql, "scoring_method": scoring_method, - "top_n": top_n, + "chunking_options": chunking_options, }, reranking_create_params.RerankingCreateParams, ), @@ -161,10 +161,10 @@ async def create( model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], query: str, texts: SequenceNotStr[str], - chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit, + top_n: Optional[int] | Omit = omit, is_iql: bool | Omit = omit, scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit, - top_n: Optional[int] | Omit = omit, + chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -193,7 +193,7 @@ async def create( Each text must contain at least one non-whitespace character. - chunking_options: Options for how to split text into smaller chunks. + top_n: A whole number greater than or equal to 1. is_iql: Whether the query should be interpreted as an [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query, which is not @@ -215,7 +215,7 @@ async def create( `chunk_min` uses the lowest relevance score of all of a text's chunks. - top_n: A whole number greater than or equal to 1. + chunking_options: Options for how to split text into smaller chunks. extra_headers: Send extra headers @@ -232,10 +232,10 @@ async def create( "model": model, "query": query, "texts": texts, - "chunking_options": chunking_options, + "top_n": top_n, "is_iql": is_iql, "scoring_method": scoring_method, - "top_n": top_n, + "chunking_options": chunking_options, }, reranking_create_params.RerankingCreateParams, ), diff --git a/src/isaacus/types/classifications/universal_classification_response.py b/src/isaacus/types/classifications/universal_classification_response.py index aa4d93e..1c574fe 100644 --- a/src/isaacus/types/classifications/universal_classification_response.py +++ b/src/isaacus/types/classifications/universal_classification_response.py @@ -8,13 +8,6 @@ class ClassificationChunk(BaseModel): - end: int - """ - The index of the character immediately after the last character of the chunk in - the original text, beginning from `0` (such that, in Python, the chunk is - equivalent to `text[start:end]`). - """ - index: int """ The original position of the chunk in the outputted list of chunks before @@ -22,6 +15,19 @@ class ClassificationChunk(BaseModel): `1`). """ + start: int + """ + The index of the character in the original text where the chunk starts, + beginning from `0`. + """ + + end: int + """ + The index of the character immediately after the last character of the chunk in + the original text, beginning from `0` (such that, in Python, the chunk is + equivalent to `text[start:end]`). + """ + score: float """ The model's score of the likelihood that the query expressed about the chunk is @@ -31,26 +37,11 @@ class ClassificationChunk(BaseModel): score less than `0.5` indicates that the chunk does not support the query. """ - start: int - """ - The index of the character in the original text where the chunk starts, - beginning from `0`. - """ - text: str """The text of the chunk.""" class Classification(BaseModel): - chunks: Optional[List[ClassificationChunk]] = None - """ - The text as broken into chunks by - [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own - confidence score, ordered from highest to lowest score. - - If no chunking occurred, this will be `null`. - """ - index: int """ The index of the text in the input array of texts, starting from `0` (and, @@ -66,6 +57,15 @@ class Classification(BaseModel): score less than `0.5` indicates that the text does not support the query. """ + chunks: Optional[List[ClassificationChunk]] = None + """ + The text as broken into chunks by + [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own + confidence score, ordered from highest to lowest score. + + If no chunking occurred, this will be `null`. + """ + class Usage(BaseModel): """Statistics about the usage of resources in the process of classifying the text.""" diff --git a/src/isaacus/types/classifications/universal_create_params.py b/src/isaacus/types/classifications/universal_create_params.py index c79b494..8130d0e 100644 --- a/src/isaacus/types/classifications/universal_create_params.py +++ b/src/isaacus/types/classifications/universal_create_params.py @@ -34,9 +34,6 @@ class UniversalCreateParams(TypedDict, total=False): Each text must contain at least one non-whitespace character. """ - chunking_options: Optional[ChunkingOptions] - """Options for how to split text into smaller chunks.""" - is_iql: bool """ Whether the query should be interpreted as an @@ -57,15 +54,18 @@ class UniversalCreateParams(TypedDict, total=False): `chunk_min` uses the lowest confidence score of all of the texts' chunks. """ + chunking_options: Optional[ChunkingOptions] + """Options for how to split text into smaller chunks.""" + class ChunkingOptions(TypedDict, total=False): """Options for how to split text into smaller chunks.""" + size: Optional[int] + """A whole number greater than or equal to 1.""" + overlap_ratio: Optional[float] """A number greater than or equal to 0 and less than 1.""" overlap_tokens: Optional[int] """A whole number greater than or equal to 0.""" - - size: Optional[int] - """A whole number greater than or equal to 1.""" diff --git a/src/isaacus/types/embedding_create_params.py b/src/isaacus/types/embedding_create_params.py index 2db7c07..18803fb 100644 --- a/src/isaacus/types/embedding_create_params.py +++ b/src/isaacus/types/embedding_create_params.py @@ -25,8 +25,15 @@ class EmbeddingCreateParams(TypedDict, total=False): No more than 128 texts can be embedded in a single request. """ - dimensions: Optional[int] - """A whole number greater than or equal to 1.""" + task: Optional[Literal["retrieval/query", "retrieval/document"]] + """The task the embeddings will be used for. + + `retrieval/query` is meant for queries and statements, and `retrieval/document` + is meant for anything to be retrieved using query embeddings. + + If `null`, which is the default setting, embeddings will not be optimized for + any particular task. + """ overflow_strategy: Optional[Literal["drop_end"]] """The strategy to employ when content exceeds the model's maximum input length. @@ -38,12 +45,5 @@ class EmbeddingCreateParams(TypedDict, total=False): input length. """ - task: Optional[Literal["retrieval/query", "retrieval/document"]] - """The task the embeddings will be used for. - - `retrieval/query` is meant for queries and statements, and `retrieval/document` - is meant for anything to be retrieved using query embeddings. - - If `null`, which is the default setting, embeddings will not be optimized for - any particular task. - """ + dimensions: Optional[int] + """A whole number greater than or equal to 1.""" diff --git a/src/isaacus/types/embedding_response.py b/src/isaacus/types/embedding_response.py index 13d6c89..ed81db9 100644 --- a/src/isaacus/types/embedding_response.py +++ b/src/isaacus/types/embedding_response.py @@ -8,15 +8,15 @@ class Embedding(BaseModel): - embedding: List[float] - """The embedding of the content represented as an array of floating point numbers.""" - index: int """ The position of the content in the input array of contents, starting from `0` (and, therefore, ending at the number of contents minus `1`). """ + embedding: List[float] + """The embedding of the content represented as an array of floating point numbers.""" + class Usage(BaseModel): """Statistics about the usage of resources in the process of embedding the inputs.""" diff --git a/src/isaacus/types/enrichment_response.py b/src/isaacus/types/enrichment_response.py index 1570445..70de77f 100644 --- a/src/isaacus/types/enrichment_response.py +++ b/src/isaacus/types/enrichment_response.py @@ -11,15 +11,15 @@ class Result(BaseModel): """An enriched document alongside its index in the input array of texts.""" - document: ILGSv1Document - """The enriched document.""" - index: int """ The index of this document in the input array of texts, starting at `0` (and, therefore, ending at the number of inputs minus `1`). """ + document: ILGSv1Document + """The enriched document.""" + class Usage(BaseModel): """Statistics about the usage of resources in the process of enriching the input.""" diff --git a/src/isaacus/types/extractions/answer_extraction_response.py b/src/isaacus/types/extractions/answer_extraction_response.py index ba610f6..c6df224 100644 --- a/src/isaacus/types/extractions/answer_extraction_response.py +++ b/src/isaacus/types/extractions/answer_extraction_response.py @@ -10,6 +10,15 @@ class ExtractionAnswer(BaseModel): """An answer extracted from a text.""" + text: str + """The text of the answer.""" + + start: int + """ + The index of the first character of the answer in the text, starting from `0` + (and, therefore, ending at the number of characters in the text minus `1`). + """ + end: int """ The index of the character immediately after the last character of the answer in @@ -22,28 +31,19 @@ class ExtractionAnswer(BaseModel): A score between `0` and `1`, inclusive, representing the strength of the answer. """ - start: int - """ - The index of the first character of the answer in the text, starting from `0` - (and, therefore, ending at the number of characters in the text minus `1`). - """ - - text: str - """The text of the answer.""" - class Extraction(BaseModel): """The result of extracting answers from a text.""" - answers: List[ExtractionAnswer] - """Answers extracted from the text, ordered from highest to lowest score.""" - index: int """ The index of the text in the input array of texts that this result represents, starting from `0` (and, therefore, ending at the number of texts minus `1`). """ + answers: List[ExtractionAnswer] + """Answers extracted from the text, ordered from highest to lowest score.""" + inextractability_score: float """ A score between `0` and `1`, inclusive, representing the likelihood that an diff --git a/src/isaacus/types/extractions/qa_create_params.py b/src/isaacus/types/extractions/qa_create_params.py index 0ea2e7b..994fc00 100644 --- a/src/isaacus/types/extractions/qa_create_params.py +++ b/src/isaacus/types/extractions/qa_create_params.py @@ -35,9 +35,6 @@ class QACreateParams(TypedDict, total=False): Each text must contain at least one non-whitespace character. """ - chunking_options: Optional[ChunkingOptions] - """Options for how to split text into smaller chunks.""" - ignore_inextractability: bool """ Whether to, if the model's score of the likelihood that an answer can not be @@ -55,15 +52,18 @@ class QACreateParams(TypedDict, total=False): If `null`, which is the default, all answers will be returned. """ + chunking_options: Optional[ChunkingOptions] + """Options for how to split text into smaller chunks.""" + class ChunkingOptions(TypedDict, total=False): """Options for how to split text into smaller chunks.""" + size: Optional[int] + """A whole number greater than or equal to 1.""" + overlap_ratio: Optional[float] """A number greater than or equal to 0 and less than 1.""" overlap_tokens: Optional[int] """A whole number greater than or equal to 0.""" - - size: Optional[int] - """A whole number greater than or equal to 1.""" diff --git a/src/isaacus/types/ilgs_v1_crossreference.py b/src/isaacus/types/ilgs_v1_crossreference.py index 7f469d7..69b1fdc 100644 --- a/src/isaacus/types/ilgs_v1_crossreference.py +++ b/src/isaacus/types/ilgs_v1_crossreference.py @@ -9,6 +9,14 @@ class ILGSv1Crossreference(BaseModel): """A cross-reference within the document pointing to one or more segments.""" + start: str + """ + The unique identifier of the earliest segment in the span of segments being + cross-referenced with ties broken in favor of the least-nested (i.e., largest) + segment. If the cross-reference points to a single segment, `start` and `end` + will be identical. + """ + end: str """ The unique identifier of the latest segment in the span of segments being @@ -32,11 +40,3 @@ class ILGSv1Crossreference(BaseModel): need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). """ - - start: str - """ - The unique identifier of the earliest segment in the span of segments being - cross-referenced with ties broken in favor of the least-nested (i.e., largest) - segment. If the cross-reference points to a single segment, `start` and `end` - will be identical. - """ diff --git a/src/isaacus/types/ilgs_v1_date.py b/src/isaacus/types/ilgs_v1_date.py index d9b1c8a..f210daf 100644 --- a/src/isaacus/types/ilgs_v1_date.py +++ b/src/isaacus/types/ilgs_v1_date.py @@ -16,17 +16,8 @@ class ILGSv1Date(BaseModel): Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into one of the supported date types are extractable. """ - mentions: List[ILGSv1Span] - """ - An array of one or more spans within the document's text where the date is - mentioned. - """ - - person: Optional[str] = None - """ - A unique identifier for a legal person in the format `per:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. - """ + value: str + """The date in ISO 8601 format (YYYY-MM-DD).""" type: Literal["creation", "signature", "effective", "expiry", "delivery", "renewal", "payment", "birth", "death"] """ @@ -66,5 +57,14 @@ class ILGSv1Date(BaseModel): person. A person's `death` date will never be before their `birth` date. """ - value: str - """The date in ISO 8601 format (YYYY-MM-DD).""" + person: Optional[str] = None + """ + A unique identifier for a legal person in the format `per:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. + """ + + mentions: List[ILGSv1Span] + """ + An array of one or more spans within the document's text where the date is + mentioned. + """ diff --git a/src/isaacus/types/ilgs_v1_document.py b/src/isaacus/types/ilgs_v1_document.py index bbccd86..d173736 100644 --- a/src/isaacus/types/ilgs_v1_document.py +++ b/src/isaacus/types/ilgs_v1_document.py @@ -24,51 +24,54 @@ class ILGSv1Document(BaseModel): """The enriched document.""" - crossreferences: List[ILGSv1Crossreference] - """ - An array of cross-references within the document pointing to a single segment or - a span of segments. - """ + title: Optional[ILGSv1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. - dates: List[ILGSv1Date] - """ - An array of dates identified in the document belonging to one of the following - types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, - `payment`, `birth`, or `death`. + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. - Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into - one of the supported date types are extractable. - """ + A span cannot be empty and will never start or end at whitespace. - emails: List[ILGSv1Email] + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). """ - An array of email addresses identified in the document belonging to legal - persons. - Email addresses mentioned in the document that are not attributable to legal - persons will not be extracted. - """ + subtitle: Optional[ILGSv1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. - external_documents: List[ILGSv1ExternalDocument] - """An array of documents identified within the document.""" + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. - headings: List[ILGSv1Span] - """An array of spans within the document's text constituting headings.""" + A span cannot be empty and will never start or end at whitespace. - id_numbers: List[ILGSv1IDNumber] + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). """ - An array of identification numbers identified in the document belonging to legal - persons. - Identification numbers mentioned in the document that are not attributable to - legal persons will not be extracted. + type: Literal["statute", "regulation", "decision", "contract", "other"] """ + The type of the document, being one of `statute`, `regulation`, `decision`, + `contract`, or `other`. - junk: List[ILGSv1Span] - """ - An array of spans within the document's text constituting non-operative, - non-substantive 'junk' content such as headers, footers, page numbers, and OCR - artifacts. + `statute` denotes primary legislation such as acts, bills, codes, and + constitutions. + + `regulation` denotes secondary legislation such as rules, statutory instruments, + and ordinances. + + `decision` denotes judicial or quasi-judicial decisions such as court judgments, + judicial opinions, and tribunal rulings. + + `other` is used for all other types of legal documents that do not fit into any + of the predefined types. """ jurisdiction: Optional[str] = None @@ -85,88 +88,85 @@ class ILGSv1Document(BaseModel): code for federal law. """ + segments: List[ILGSv1Segment] + """ + An array of segments within the document representing structurally distinct + portions of its content. + """ + + crossreferences: List[ILGSv1Crossreference] + """ + An array of cross-references within the document pointing to a single segment or + a span of segments. + """ + locations: List[ILGSv1Location] """An array of locations identified in the document.""" persons: List[ILGSv1Person] """An array of legal persons identified in the document.""" - phone_numbers: List[ILGSv1PhoneNumber] + emails: List[ILGSv1Email] """ - An array of valid phone numbers identified in the document belonging to legal + An array of email addresses identified in the document belonging to legal persons. - Phone numbers mentioned in the document that are not valid, possible, or - attributable to legal persons will not be extracted. + Email addresses mentioned in the document that are not attributable to legal + persons will not be extracted. """ - quotes: List[ILGSv1Quote] - """An array of quotations within the document.""" + websites: List[ILGSv1Website] + """An array of websites identified in the document belonging to legal persons. - segments: List[ILGSv1Segment] - """ - An array of segments within the document representing structurally distinct - portions of its content. + Websites mentioned in the document that are not attributable to legal persons + will not be extracted. """ - subtitle: Optional[ILGSv1Span] = None - """A zero-based, half-open span into the Unicode code point space of input text. + phone_numbers: List[ILGSv1PhoneNumber] + """ + An array of valid phone numbers identified in the document belonging to legal + persons. - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. + Phone numbers mentioned in the document that are not valid, possible, or + attributable to legal persons will not be extracted. + """ - A span cannot be empty and will never start or end at whitespace. + id_numbers: List[ILGSv1IDNumber] + """ + An array of identification numbers identified in the document belonging to legal + persons. - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). + Identification numbers mentioned in the document that are not attributable to + legal persons will not be extracted. """ terms: List[ILGSv1Term] """An array of terms assigned definite meanings within the document.""" - title: Optional[ILGSv1Span] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. + external_documents: List[ILGSv1ExternalDocument] + """An array of documents identified within the document.""" - A span cannot be empty and will never start or end at whitespace. + quotes: List[ILGSv1Quote] + """An array of quotations within the document.""" - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). + dates: List[ILGSv1Date] """ + An array of dates identified in the document belonging to one of the following + types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, + `payment`, `birth`, or `death`. - type: Literal["statute", "regulation", "decision", "contract", "other"] + Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into + one of the supported date types are extractable. """ - The type of the document, being one of `statute`, `regulation`, `decision`, - `contract`, or `other`. - - `statute` denotes primary legislation such as acts, bills, codes, and - constitutions. - `regulation` denotes secondary legislation such as rules, statutory instruments, - and ordinances. - - `decision` denotes judicial or quasi-judicial decisions such as court judgments, - judicial opinions, and tribunal rulings. + headings: List[ILGSv1Span] + """An array of spans within the document's text constituting headings.""" - `other` is used for all other types of legal documents that do not fit into any - of the predefined types. + junk: List[ILGSv1Span] + """ + An array of spans within the document's text constituting non-operative, + non-substantive 'junk' content such as headers, footers, page numbers, and OCR + artifacts. """ version: Literal["ilgs@1"] - - websites: List[ILGSv1Website] - """An array of websites identified in the document belonging to legal persons. - - Websites mentioned in the document that are not attributable to legal persons - will not be extracted. - """ diff --git a/src/isaacus/types/ilgs_v1_email.py b/src/isaacus/types/ilgs_v1_email.py index 6d040b5..ccae60d 100644 --- a/src/isaacus/types/ilgs_v1_email.py +++ b/src/isaacus/types/ilgs_v1_email.py @@ -17,11 +17,11 @@ class ILGSv1Email(BaseModel): address: str """The normalized email address.""" + person: str + """The unique identifier of the person that this email address belongs to.""" + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the email address is mentioned. """ - - person: str - """The unique identifier of the person that this email address belongs to.""" diff --git a/src/isaacus/types/ilgs_v1_external_document.py b/src/isaacus/types/ilgs_v1_external_document.py index ad970c0..893624c 100644 --- a/src/isaacus/types/ilgs_v1_external_document.py +++ b/src/isaacus/types/ilgs_v1_external_document.py @@ -18,27 +18,6 @@ class ILGSv1ExternalDocument(BaseModel): `{index}` is a non-negative incrementing integer starting from zero. """ - jurisdiction: Optional[str] = None - """ - A jurisdiction code representing a country (via an initial country code) and, - optionally, a subdivision within that country (via a subsequent subdivision code - prefixed by a hyphen). - - All 249 ISO 3166-1 alpha-2 country codes are representable in addition to - special `INT` and `EU` codes for international and European Union law, - respectively. - - All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED` - code for federal law. - """ - - mentions: List[ILGSv1Span] - """ - An array of one or more spans within the document's text where the external - document is mentioned by name, for example, 'the US Constitution' in 'the Second - Amendment to the US Constitution protects freedom of speech'. - """ - name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. @@ -55,11 +34,36 @@ class ILGSv1ExternalDocument(BaseModel): code units instead of Unicode code points). """ - pinpoints: List[ILGSv1Span] + type: Literal["statute", "regulation", "decision", "contract", "other"] """ - An array of spans within the document's text where specific parts of the - external document are referenced, for example, 'Section 2' in 'as defined in - Section 2 of the US Constitution'. + The type of the external document, being one of `statute`, `regulation`, + `decision`, `contract`, or `other`. + + `statute` denotes primary legislation such as acts, bills, codes, and + constitutions. + + `regulation` denotes secondary legislation such as rules, statutory instruments, + and ordinances. + + `decision` denotes judicial or quasi-judicial decisions such as court judgments, + judicial opinions, and tribunal rulings. + + `other` is used for all other types of legal documents that do not fit into any + of the predefined types. + """ + + jurisdiction: Optional[str] = None + """ + A jurisdiction code representing a country (via an initial country code) and, + optionally, a subdivision within that country (via a subsequent subdivision code + prefixed by a hyphen). + + All 249 ISO 3166-1 alpha-2 country codes are representable in addition to + special `INT` and `EU` codes for international and European Union law, + respectively. + + All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED` + code for federal law. """ reception: Literal["positive", "mixed", "negative", "neutral"] @@ -82,20 +86,16 @@ class ILGSv1ExternalDocument(BaseModel): expressing any particular sentiment towards it. """ - type: Literal["statute", "regulation", "decision", "contract", "other"] + mentions: List[ILGSv1Span] + """ + An array of one or more spans within the document's text where the external + document is mentioned by name, for example, 'the US Constitution' in 'the Second + Amendment to the US Constitution protects freedom of speech'. """ - The type of the external document, being one of `statute`, `regulation`, - `decision`, `contract`, or `other`. - - `statute` denotes primary legislation such as acts, bills, codes, and - constitutions. - - `regulation` denotes secondary legislation such as rules, statutory instruments, - and ordinances. - - `decision` denotes judicial or quasi-judicial decisions such as court judgments, - judicial opinions, and tribunal rulings. - `other` is used for all other types of legal documents that do not fit into any - of the predefined types. + pinpoints: List[ILGSv1Span] + """ + An array of spans within the document's text where specific parts of the + external document are referenced, for example, 'Section 2' in 'as defined in + Section 2 of the US Constitution'. """ diff --git a/src/isaacus/types/ilgs_v1_id_number.py b/src/isaacus/types/ilgs_v1_id_number.py index 80b8bb0..33fe661 100644 --- a/src/isaacus/types/ilgs_v1_id_number.py +++ b/src/isaacus/types/ilgs_v1_id_number.py @@ -14,14 +14,14 @@ class ILGSv1IDNumber(BaseModel): If an identification number was mentioned in the document but is not attributable to a legal person, it will not be extracted. """ - mentions: List[ILGSv1Span] - """ - An array of one or more spans within the document's text where the - identification number is mentioned. - """ - number: str """The identification number.""" person: str """The unique identifier of the person that this identification number belongs to.""" + + mentions: List[ILGSv1Span] + """ + An array of one or more spans within the document's text where the + identification number is mentioned. + """ diff --git a/src/isaacus/types/ilgs_v1_location.py b/src/isaacus/types/ilgs_v1_location.py index 9e8b3ef..a441c4d 100644 --- a/src/isaacus/types/ilgs_v1_location.py +++ b/src/isaacus/types/ilgs_v1_location.py @@ -18,12 +18,6 @@ class ILGSv1Location(BaseModel): `{index}` is a non-negative incrementing integer starting from zero. """ - mentions: List[ILGSv1Span] - """ - An array of one or more spans within the document's text where the location is - mentioned. - """ - name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. @@ -40,14 +34,20 @@ class ILGSv1Location(BaseModel): code units instead of Unicode code points). """ + type: Literal["country", "state", "city", "address", "other"] + """ + The type of the location, being one of `country`, `state`, `city`, `address`, or + `other`. + """ + parent: Optional[str] = None """ A unique identifier for a location in the format `loc:{index}` where `{index}` is a non-negative incrementing integer starting from zero. """ - type: Literal["country", "state", "city", "address", "other"] + mentions: List[ILGSv1Span] """ - The type of the location, being one of `country`, `state`, `city`, `address`, or - `other`. + An array of one or more spans within the document's text where the location is + mentioned. """ diff --git a/src/isaacus/types/ilgs_v1_person.py b/src/isaacus/types/ilgs_v1_person.py index 5b5b888..db1a9e7 100644 --- a/src/isaacus/types/ilgs_v1_person.py +++ b/src/isaacus/types/ilgs_v1_person.py @@ -18,12 +18,6 @@ class ILGSv1Person(BaseModel): is a non-negative incrementing integer starting from zero. """ - mentions: List[ILGSv1Span] - """ - An array of one or more spans within the document's text where the person is - mentioned. - """ - name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. @@ -40,16 +34,20 @@ class ILGSv1Person(BaseModel): code units instead of Unicode code points). """ - parent: Optional[str] = None - """ - A unique identifier for a legal person in the format `per:{index}` where - `{index}` is a non-negative incrementing integer starting from zero. + type: Literal["natural", "corporate", "politic"] """ + The legal entity type of the person, being one of `natural`, `corporate`, or + `politic`. - residence: Optional[str] = None - """ - A unique identifier for a location in the format `loc:{index}` where `{index}` - is a non-negative incrementing integer starting from zero. + `natural` denotes a human being in their capacity as a natural legal person, + including when representing unincorporated entities such as partnerships and + trusts. + + `corporate` denotes a body corporate such as a company, incorporated + partnership, or statutory corporation. + + `politic` denotes a body politic such as a court, state, government, or + intergovernmental organization. """ role: Literal[ @@ -178,18 +176,20 @@ class ILGSv1Person(BaseModel): legislation, or regulation that is the subject of the document. | """ - type: Literal["natural", "corporate", "politic"] + parent: Optional[str] = None + """ + A unique identifier for a legal person in the format `per:{index}` where + `{index}` is a non-negative incrementing integer starting from zero. """ - The legal entity type of the person, being one of `natural`, `corporate`, or - `politic`. - - `natural` denotes a human being in their capacity as a natural legal person, - including when representing unincorporated entities such as partnerships and - trusts. - `corporate` denotes a body corporate such as a company, incorporated - partnership, or statutory corporation. + residence: Optional[str] = None + """ + A unique identifier for a location in the format `loc:{index}` where `{index}` + is a non-negative incrementing integer starting from zero. + """ - `politic` denotes a body politic such as a court, state, government, or - intergovernmental organization. + mentions: List[ILGSv1Span] + """ + An array of one or more spans within the document's text where the person is + mentioned. """ diff --git a/src/isaacus/types/ilgs_v1_phone_number.py b/src/isaacus/types/ilgs_v1_phone_number.py index 58cebfe..6906278 100644 --- a/src/isaacus/types/ilgs_v1_phone_number.py +++ b/src/isaacus/types/ilgs_v1_phone_number.py @@ -14,12 +14,6 @@ class ILGSv1PhoneNumber(BaseModel): If a phone number was mentioned in the document but is not valid, possible, or attributable to a legal person, it will not be extracted. """ - mentions: List[ILGSv1Span] - """ - An array of one or more spans within the document's text where the phone number - is mentioned. - """ - number: str """ The normalized phone number in E.123 international notation conforming with @@ -28,3 +22,9 @@ class ILGSv1PhoneNumber(BaseModel): person: str """The unique identifier of the person that this phone number belongs to.""" + + mentions: List[ILGSv1Span] + """ + An array of one or more spans within the document's text where the phone number + is mentioned. + """ diff --git a/src/isaacus/types/ilgs_v1_quote.py b/src/isaacus/types/ilgs_v1_quote.py index a12da90..36a2288 100644 --- a/src/isaacus/types/ilgs_v1_quote.py +++ b/src/isaacus/types/ilgs_v1_quote.py @@ -11,10 +11,10 @@ class ILGSv1Quote(BaseModel): """A quotation within a document.""" - amending: bool + source_segment: Optional[str] = None """ - Whether the quote is being used to amend or modify content, typically in other - documents. + A unique identifier for a segment in the format `seg:{index}` where `{index}` is + a non-negative incrementing integer starting from zero. """ source_document: Optional[str] = None @@ -29,10 +29,10 @@ class ILGSv1Quote(BaseModel): `{index}` is a non-negative incrementing integer starting from zero. """ - source_segment: Optional[str] = None + amending: bool """ - A unique identifier for a segment in the format `seg:{index}` where `{index}` is - a non-negative incrementing integer starting from zero. + Whether the quote is being used to amend or modify content, typically in other + documents. """ span: ILGSv1Span diff --git a/src/isaacus/types/ilgs_v1_segment.py b/src/isaacus/types/ilgs_v1_segment.py index 8d903cc..b3a61dd 100644 --- a/src/isaacus/types/ilgs_v1_segment.py +++ b/src/isaacus/types/ilgs_v1_segment.py @@ -20,44 +20,6 @@ class ILGSv1Segment(BaseModel): is a non-negative incrementing integer starting from zero. """ - category: Literal["front_matter", "scope", "main", "annotation", "back_matter", "other"] - """ - The functional 'category' of the segment within the document, being one of - `front_matter`, `scope`, `main`, `annotation`, `back_matter`, or `other`. - - `front_matter` denotes non-operative contextualizing content occurring at the - start of a document such as a preamble or recitals. - - `scope` denotes operative content defining the application or interpretation of - a document such as definition sections and governing law clauses. - - `main` denotes operative, non-scopal content. - - `annotation` denotes non-operative annotative content providing explanatory or - referential information such as commentary, footnotes, and endnotes. - - `back_matter` denotes non-operative contextualizing content occurring at the end - of a document such as authority statements. - - `other` denotes content that does not fit into any of the other categories. - """ - - code: Optional[ILGSv1Span] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - kind: Literal["container", "unit", "item", "figure"] """ The structural 'kind' of the segment, being one of `container`, `unit`, `item`, @@ -80,44 +42,6 @@ class ILGSv1Segment(BaseModel): diagram, equation, or table. It cannot contain segments. """ - parent: Optional[str] = None - """ - A unique identifier for a segment in the format `seg:{index}` where `{index}` is - a non-negative incrementing integer starting from zero. - """ - - span: ILGSv1Span - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - - title: Optional[ILGSv1Span] = None - """A zero-based, half-open span into the Unicode code point space of input text. - - All spans are globally laminar and well-nested similar to XML—it is impossible - for any two spans to partially overlap; they can only be disjoint, adjacent, or - wholly nested. Spans of the exact same type (e.g., segments) will never be - duplicated. - - A span cannot be empty and will never start or end at whitespace. - - Note that, when using programming languages other than Python (which uses - zero-based, half-open, Unicode code point-spaced string indexing), indices may - need to be translated accordingly (for example, JavaScript slices into UTF-16 - code units instead of Unicode code points). - """ - type: Optional[ Literal[ "title", @@ -188,6 +112,28 @@ class ILGSv1Segment(BaseModel): of which are exclusive to it. """ + category: Literal["front_matter", "scope", "main", "annotation", "back_matter", "other"] + """ + The functional 'category' of the segment within the document, being one of + `front_matter`, `scope`, `main`, `annotation`, `back_matter`, or `other`. + + `front_matter` denotes non-operative contextualizing content occurring at the + start of a document such as a preamble or recitals. + + `scope` denotes operative content defining the application or interpretation of + a document such as definition sections and governing law clauses. + + `main` denotes operative, non-scopal content. + + `annotation` denotes non-operative annotative content providing explanatory or + referential information such as commentary, footnotes, and endnotes. + + `back_matter` denotes non-operative contextualizing content occurring at the end + of a document such as authority statements. + + `other` denotes content that does not fit into any of the other categories. + """ + type_name: Optional[ILGSv1Span] = None """A zero-based, half-open span into the Unicode code point space of input text. @@ -203,3 +149,57 @@ class ILGSv1Segment(BaseModel): need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). """ + + code: Optional[ILGSv1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + title: Optional[ILGSv1Span] = None + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ + + parent: Optional[str] = None + """ + A unique identifier for a segment in the format `seg:{index}` where `{index}` is + a non-negative incrementing integer starting from zero. + """ + + span: ILGSv1Span + """A zero-based, half-open span into the Unicode code point space of input text. + + All spans are globally laminar and well-nested similar to XML—it is impossible + for any two spans to partially overlap; they can only be disjoint, adjacent, or + wholly nested. Spans of the exact same type (e.g., segments) will never be + duplicated. + + A span cannot be empty and will never start or end at whitespace. + + Note that, when using programming languages other than Python (which uses + zero-based, half-open, Unicode code point-spaced string indexing), indices may + need to be translated accordingly (for example, JavaScript slices into UTF-16 + code units instead of Unicode code points). + """ diff --git a/src/isaacus/types/ilgs_v1_span.py b/src/isaacus/types/ilgs_v1_span.py index e7b5ff1..45aad71 100644 --- a/src/isaacus/types/ilgs_v1_span.py +++ b/src/isaacus/types/ilgs_v1_span.py @@ -15,14 +15,14 @@ class ILGSv1Span(BaseModel): Note that, when using programming languages other than Python (which uses zero-based, half-open, Unicode code point-spaced string indexing), indices may need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). """ - end: int - """ - The zero-based end index of the half-open span (i.e., the end is exclusive) of - Unicode code points in the input text. - """ - start: int """ The zero-based start index of the half-open span of Unicode code points in the input text. """ + + end: int + """ + The zero-based end index of the half-open span (i.e., the end is exclusive) of + Unicode code points in the input text. + """ diff --git a/src/isaacus/types/ilgs_v1_term.py b/src/isaacus/types/ilgs_v1_term.py index 963f312..db03338 100644 --- a/src/isaacus/types/ilgs_v1_term.py +++ b/src/isaacus/types/ilgs_v1_term.py @@ -17,7 +17,7 @@ class ILGSv1Term(BaseModel): is a non-negative incrementing integer starting from zero. """ - meaning: ILGSv1Span + name: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -33,16 +33,7 @@ class ILGSv1Term(BaseModel): code units instead of Unicode code points). """ - mentions: List[ILGSv1Span] - """ - An array of spans within the document's text where the term is mentioned outside - of its definition. - - It is possible for the term to have no mentions if, outside of its definition, - it is never referred to in the document. - """ - - name: ILGSv1Span + meaning: ILGSv1Span """A zero-based, half-open span into the Unicode code point space of input text. All spans are globally laminar and well-nested similar to XML—it is impossible @@ -57,3 +48,12 @@ class ILGSv1Term(BaseModel): need to be translated accordingly (for example, JavaScript slices into UTF-16 code units instead of Unicode code points). """ + + mentions: List[ILGSv1Span] + """ + An array of spans within the document's text where the term is mentioned outside + of its definition. + + It is possible for the term to have no mentions if, outside of its definition, + it is never referred to in the document. + """ diff --git a/src/isaacus/types/ilgs_v1_website.py b/src/isaacus/types/ilgs_v1_website.py index 6415320..5c0ac9a 100644 --- a/src/isaacus/types/ilgs_v1_website.py +++ b/src/isaacus/types/ilgs_v1_website.py @@ -14,15 +14,15 @@ class ILGSv1Website(BaseModel): If a website was mentioned in the document but is not attributable to a legal person, it will not be extracted. """ + url: str + """The normalized URL of the website in the form `https://{host}/`.""" + + person: str + """The unique identifier of the person that this website belongs to.""" + mentions: List[ILGSv1Span] """ An array of one or more spans within the document's text where the website is mentioned (including paths and slugs which are not part of the website's normalized URL). """ - - person: str - """The unique identifier of the person that this website belongs to.""" - - url: str - """The normalized URL of the website in the form `https://{host}/`.""" diff --git a/src/isaacus/types/reranking_create_params.py b/src/isaacus/types/reranking_create_params.py index 416cab9..ab4a75a 100644 --- a/src/isaacus/types/reranking_create_params.py +++ b/src/isaacus/types/reranking_create_params.py @@ -34,8 +34,8 @@ class RerankingCreateParams(TypedDict, total=False): Each text must contain at least one non-whitespace character. """ - chunking_options: Optional[ChunkingOptions] - """Options for how to split text into smaller chunks.""" + top_n: Optional[int] + """A whole number greater than or equal to 1.""" is_iql: bool """ @@ -62,18 +62,18 @@ class RerankingCreateParams(TypedDict, total=False): `chunk_min` uses the lowest relevance score of all of a text's chunks. """ - top_n: Optional[int] - """A whole number greater than or equal to 1.""" + chunking_options: Optional[ChunkingOptions] + """Options for how to split text into smaller chunks.""" class ChunkingOptions(TypedDict, total=False): """Options for how to split text into smaller chunks.""" + size: Optional[int] + """A whole number greater than or equal to 1.""" + overlap_ratio: Optional[float] """A number greater than or equal to 0 and less than 1.""" overlap_tokens: Optional[int] """A whole number greater than or equal to 0.""" - - size: Optional[int] - """A whole number greater than or equal to 1.""" diff --git a/tests/api_resources/classifications/test_universal.py b/tests/api_resources/classifications/test_universal.py index 48de376..c85ac3a 100644 --- a/tests/api_resources/classifications/test_universal.py +++ b/tests/api_resources/classifications/test_universal.py @@ -34,13 +34,13 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: model="kanon-universal-classifier", query="This is a confidentiality clause.", texts=["I agree not to tell anyone about the document."], + is_iql=True, + scoring_method="auto", chunking_options={ + "size": 512, "overlap_ratio": 0.1, "overlap_tokens": 10, - "size": 512, }, - is_iql=True, - scoring_method="auto", ) assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) @@ -97,13 +97,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - model="kanon-universal-classifier", query="This is a confidentiality clause.", texts=["I agree not to tell anyone about the document."], + is_iql=True, + scoring_method="auto", chunking_options={ + "size": 512, "overlap_ratio": 0.1, "overlap_tokens": 10, - "size": 512, }, - is_iql=True, - scoring_method="auto", ) assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) diff --git a/tests/api_resources/extractions/test_qa.py b/tests/api_resources/extractions/test_qa.py index dc9dd83..9aa7ecb 100644 --- a/tests/api_resources/extractions/test_qa.py +++ b/tests/api_resources/extractions/test_qa.py @@ -38,13 +38,13 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: texts=[ "The standard sentence for murder in the State of Victoria is 30 years if the person murdered was a police officer and 25 years in any other case." ], + ignore_inextractability=False, + top_k=1, chunking_options={ + "size": 512, "overlap_ratio": 0.1, "overlap_tokens": 10, - "size": 512, }, - ignore_inextractability=False, - top_k=1, ) assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) @@ -109,13 +109,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - texts=[ "The standard sentence for murder in the State of Victoria is 30 years if the person murdered was a police officer and 25 years in any other case." ], + ignore_inextractability=False, + top_k=1, chunking_options={ + "size": 512, "overlap_ratio": 0.1, "overlap_tokens": 10, - "size": 512, }, - ignore_inextractability=False, - top_k=1, ) assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py index abab3cc..af293c5 100644 --- a/tests/api_resources/test_embeddings.py +++ b/tests/api_resources/test_embeddings.py @@ -32,9 +32,9 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: embedding = client.embeddings.create( model="kanon-2-embedder", texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"], - dimensions=1, - overflow_strategy="drop_end", task="retrieval/query", + overflow_strategy="drop_end", + dimensions=1, ) assert_matches_type(EmbeddingResponse, embedding, path=["response"]) @@ -87,9 +87,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - embedding = await async_client.embeddings.create( model="kanon-2-embedder", texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"], - dimensions=1, - overflow_strategy="drop_end", task="retrieval/query", + overflow_strategy="drop_end", + dimensions=1, ) assert_matches_type(EmbeddingResponse, embedding, path=["response"]) diff --git a/tests/api_resources/test_rerankings.py b/tests/api_resources/test_rerankings.py index a9d965b..36707ac 100644 --- a/tests/api_resources/test_rerankings.py +++ b/tests/api_resources/test_rerankings.py @@ -46,14 +46,14 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: "Negligence in tort law requires establishing a duty of care that the defendant owed to the plaintiff.", "The concept of negligence is central to tort law, with courts assessing whether a breach of duty caused harm.", ], + top_n=1, + is_iql=False, + scoring_method="auto", chunking_options={ + "size": 512, "overlap_ratio": 0.1, "overlap_tokens": 10, - "size": 512, }, - is_iql=False, - scoring_method="auto", - top_n=1, ) assert_matches_type(RerankingResponse, reranking, path=["response"]) @@ -134,14 +134,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - "Negligence in tort law requires establishing a duty of care that the defendant owed to the plaintiff.", "The concept of negligence is central to tort law, with courts assessing whether a breach of duty caused harm.", ], + top_n=1, + is_iql=False, + scoring_method="auto", chunking_options={ + "size": 512, "overlap_ratio": 0.1, "overlap_tokens": 10, - "size": 512, }, - is_iql=False, - scoring_method="auto", - top_n=1, ) assert_matches_type(RerankingResponse, reranking, path=["response"]) From cf342496505c088ea93b1c6cbb05294aa1d243b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 22:42:37 +0000 Subject: [PATCH 6/6] release: 0.12.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ pyproject.toml | 2 +- src/isaacus/_version.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f7014c3..a713055 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.11.0" + ".": "0.12.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f06b9a6..aecae9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.12.0 (2026-02-03) + +Full Changelog: [v0.11.0...v0.12.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.11.0...v0.12.0) + +### Features + +* **sdk:** add `qa` as an initialism ([27162f3](https://github.com/isaacus-dev/isaacus-python/commit/27162f3e98efa095e41f67801c6a3497709be9d6)) +* **sdk:** force ilgs v1 prefix on models ([62bc9ff](https://github.com/isaacus-dev/isaacus-python/commit/62bc9ffc03feb68e3638cfee3d9df9a8547bb9e8)) +* **sdk:** modify how ILGSv1 models are cased ([f295222](https://github.com/isaacus-dev/isaacus-python/commit/f2952227e58618b33c4d0da9515a1c73942a771a)) +* **sdk:** order properties as in spec ([3dc865c](https://github.com/isaacus-dev/isaacus-python/commit/3dc865c2ee865b334b7f0ca8810226f3ac251be8)) + + +### Bug Fixes + +* **api:** merge duplicate components, reorder required fields ([55b68ce](https://github.com/isaacus-dev/isaacus-python/commit/55b68ce2bc294f094ccaf3750ea1b932ed4f95f5)) + ## 0.11.0 (2026-02-03) Full Changelog: [v0.10.1...v0.11.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.10.1...v0.11.0) diff --git a/pyproject.toml b/pyproject.toml index 8dc0afb..3ae9563 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "isaacus" -version = "0.11.0" +version = "0.12.0" description = "The official Python library for the isaacus API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/isaacus/_version.py b/src/isaacus/_version.py index e96fb03..23add34 100644 --- a/src/isaacus/_version.py +++ b/src/isaacus/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "isaacus" -__version__ = "0.11.0" # x-release-please-version +__version__ = "0.12.0" # x-release-please-version