diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5a7b79..9cedc85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,14 +61,18 @@ jobs: run: rye build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/isaacus-python' + if: |- + github.repository == 'stainless-sdks/isaacus-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/isaacus-python' + if: |- + github.repository == 'stainless-sdks/isaacus-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1b4d3bf..0c2ecec 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.19.3" + ".": "0.20.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d3f723c..f028d53 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-baf5ebdd05d1b5192759a356c2701131c47cfb5b7239a49fcb94e68d4210648c.yml -openapi_spec_hash: 6ea786d56726e18156adf57915fcbe5f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-3fc0da1b03c07a47ee0a04ff61443710b99e6d24e8ba5986aab0b1c023c6f0d5.yml +openapi_spec_hash: 5992dd036e090cc43fa15ea5ff985f77 config_hash: 9040e7359f066240ad536041fb2c5185 diff --git a/CHANGELOG.md b/CHANGELOG.md index f7365b1..0b47b22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 0.20.0 (2026-03-11) + +Full Changelog: [v0.19.3...v0.20.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.19.3...v0.20.0) + +### Features + +* **api:** add kanon-2-reranker ([e3f7e03](https://github.com/isaacus-dev/isaacus-python/commit/e3f7e03cac7b73838a31bec0e1d0507a67a41f13)) +* **api:** drop mini models ([0031fe3](https://github.com/isaacus-dev/isaacus-python/commit/0031fe3c4a60500981031dd78fa4fd010fac7eec)) + + +### Chores + +* **ci:** skip uploading artifacts on stainless-internal branches ([54b727d](https://github.com/isaacus-dev/isaacus-python/commit/54b727d4799d95bce4143399039538f3c30c744f)) +* **internal:** codegen related update ([025587b](https://github.com/isaacus-dev/isaacus-python/commit/025587b946c3ece7a34a346280dbd688880a7276)) + + +### Documentation + +* **api:** reworded descriptions ([dd1a29d](https://github.com/isaacus-dev/isaacus-python/commit/dd1a29da595815016f988cf5e6a03cc6b160daf8)) + ## 0.19.3 (2026-03-03) Full Changelog: [v0.19.2...v0.19.3](https://github.com/isaacus-dev/isaacus-python/compare/v0.19.2...v0.19.3) diff --git a/pyproject.toml b/pyproject.toml index 5e636a5..5bfa1a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "isaacus" -version = "0.19.3" +version = "0.20.0" description = "The official Python library for the isaacus API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/isaacus/_client.py b/src/isaacus/_client.py index ae83c36..e7d9b81 100644 --- a/src/isaacus/_client.py +++ b/src/isaacus/_client.py @@ -98,6 +98,7 @@ def __init__( @cached_property def embeddings(self) -> EmbeddingsResource: + """Vectorize content with an Isaacus embedding model.""" from .resources.embeddings import EmbeddingsResource return EmbeddingsResource(self) @@ -110,6 +111,9 @@ def classifications(self) -> ClassificationsResource: @cached_property def rerankings(self) -> RerankingsResource: + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ from .resources.rerankings import RerankingsResource return RerankingsResource(self) @@ -122,6 +126,7 @@ def extractions(self) -> ExtractionsResource: @cached_property def enrichments(self) -> EnrichmentsResource: + """Enrich documents with an Isaacus enrichment model.""" from .resources.enrichments import EnrichmentsResource return EnrichmentsResource(self) @@ -296,6 +301,7 @@ def __init__( @cached_property def embeddings(self) -> AsyncEmbeddingsResource: + """Vectorize content with an Isaacus embedding model.""" from .resources.embeddings import AsyncEmbeddingsResource return AsyncEmbeddingsResource(self) @@ -308,6 +314,9 @@ def classifications(self) -> AsyncClassificationsResource: @cached_property def rerankings(self) -> AsyncRerankingsResource: + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ from .resources.rerankings import AsyncRerankingsResource return AsyncRerankingsResource(self) @@ -320,6 +329,7 @@ def extractions(self) -> AsyncExtractionsResource: @cached_property def enrichments(self) -> AsyncEnrichmentsResource: + """Enrich documents with an Isaacus enrichment model.""" from .resources.enrichments import AsyncEnrichmentsResource return AsyncEnrichmentsResource(self) @@ -445,6 +455,7 @@ def __init__(self, client: Isaacus) -> None: @cached_property def embeddings(self) -> embeddings.EmbeddingsResourceWithRawResponse: + """Vectorize content with an Isaacus embedding model.""" from .resources.embeddings import EmbeddingsResourceWithRawResponse return EmbeddingsResourceWithRawResponse(self._client.embeddings) @@ -457,6 +468,9 @@ def classifications(self) -> classifications.ClassificationsResourceWithRawRespo @cached_property def rerankings(self) -> rerankings.RerankingsResourceWithRawResponse: + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ from .resources.rerankings import RerankingsResourceWithRawResponse return RerankingsResourceWithRawResponse(self._client.rerankings) @@ -469,6 +483,7 @@ def extractions(self) -> extractions.ExtractionsResourceWithRawResponse: @cached_property def enrichments(self) -> enrichments.EnrichmentsResourceWithRawResponse: + """Enrich documents with an Isaacus enrichment model.""" from .resources.enrichments import EnrichmentsResourceWithRawResponse return EnrichmentsResourceWithRawResponse(self._client.enrichments) @@ -482,6 +497,7 @@ def __init__(self, client: AsyncIsaacus) -> None: @cached_property def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithRawResponse: + """Vectorize content with an Isaacus embedding model.""" from .resources.embeddings import AsyncEmbeddingsResourceWithRawResponse return AsyncEmbeddingsResourceWithRawResponse(self._client.embeddings) @@ -494,6 +510,9 @@ def classifications(self) -> classifications.AsyncClassificationsResourceWithRaw @cached_property def rerankings(self) -> rerankings.AsyncRerankingsResourceWithRawResponse: + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ from .resources.rerankings import AsyncRerankingsResourceWithRawResponse return AsyncRerankingsResourceWithRawResponse(self._client.rerankings) @@ -506,6 +525,7 @@ def extractions(self) -> extractions.AsyncExtractionsResourceWithRawResponse: @cached_property def enrichments(self) -> enrichments.AsyncEnrichmentsResourceWithRawResponse: + """Enrich documents with an Isaacus enrichment model.""" from .resources.enrichments import AsyncEnrichmentsResourceWithRawResponse return AsyncEnrichmentsResourceWithRawResponse(self._client.enrichments) @@ -519,6 +539,7 @@ def __init__(self, client: Isaacus) -> None: @cached_property def embeddings(self) -> embeddings.EmbeddingsResourceWithStreamingResponse: + """Vectorize content with an Isaacus embedding model.""" from .resources.embeddings import EmbeddingsResourceWithStreamingResponse return EmbeddingsResourceWithStreamingResponse(self._client.embeddings) @@ -531,6 +552,9 @@ def classifications(self) -> classifications.ClassificationsResourceWithStreamin @cached_property def rerankings(self) -> rerankings.RerankingsResourceWithStreamingResponse: + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ from .resources.rerankings import RerankingsResourceWithStreamingResponse return RerankingsResourceWithStreamingResponse(self._client.rerankings) @@ -543,6 +567,7 @@ def extractions(self) -> extractions.ExtractionsResourceWithStreamingResponse: @cached_property def enrichments(self) -> enrichments.EnrichmentsResourceWithStreamingResponse: + """Enrich documents with an Isaacus enrichment model.""" from .resources.enrichments import EnrichmentsResourceWithStreamingResponse return EnrichmentsResourceWithStreamingResponse(self._client.enrichments) @@ -556,6 +581,7 @@ def __init__(self, client: AsyncIsaacus) -> None: @cached_property def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithStreamingResponse: + """Vectorize content with an Isaacus embedding model.""" from .resources.embeddings import AsyncEmbeddingsResourceWithStreamingResponse return AsyncEmbeddingsResourceWithStreamingResponse(self._client.embeddings) @@ -568,6 +594,9 @@ def classifications(self) -> classifications.AsyncClassificationsResourceWithStr @cached_property def rerankings(self) -> rerankings.AsyncRerankingsResourceWithStreamingResponse: + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ from .resources.rerankings import AsyncRerankingsResourceWithStreamingResponse return AsyncRerankingsResourceWithStreamingResponse(self._client.rerankings) @@ -580,6 +609,7 @@ def extractions(self) -> extractions.AsyncExtractionsResourceWithStreamingRespon @cached_property def enrichments(self) -> enrichments.AsyncEnrichmentsResourceWithStreamingResponse: + """Enrich documents with an Isaacus enrichment model.""" from .resources.enrichments import AsyncEnrichmentsResourceWithStreamingResponse return AsyncEnrichmentsResourceWithStreamingResponse(self._client.enrichments) diff --git a/src/isaacus/_version.py b/src/isaacus/_version.py index c406bb8..7547219 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.19.3" # x-release-please-version +__version__ = "0.20.0" # x-release-please-version diff --git a/src/isaacus/resources/classifications/classifications.py b/src/isaacus/resources/classifications/classifications.py index 19b4d4b..7b56aa8 100644 --- a/src/isaacus/resources/classifications/classifications.py +++ b/src/isaacus/resources/classifications/classifications.py @@ -19,6 +19,7 @@ class ClassificationsResource(SyncAPIResource): @cached_property def universal(self) -> UniversalResource: + """Classify documents with an Isaacus classification model.""" return UniversalResource(self._client) @cached_property @@ -44,6 +45,7 @@ def with_streaming_response(self) -> ClassificationsResourceWithStreamingRespons class AsyncClassificationsResource(AsyncAPIResource): @cached_property def universal(self) -> AsyncUniversalResource: + """Classify documents with an Isaacus classification model.""" return AsyncUniversalResource(self._client) @cached_property @@ -72,6 +74,7 @@ def __init__(self, classifications: ClassificationsResource) -> None: @cached_property def universal(self) -> UniversalResourceWithRawResponse: + """Classify documents with an Isaacus classification model.""" return UniversalResourceWithRawResponse(self._classifications.universal) @@ -81,6 +84,7 @@ def __init__(self, classifications: AsyncClassificationsResource) -> None: @cached_property def universal(self) -> AsyncUniversalResourceWithRawResponse: + """Classify documents with an Isaacus classification model.""" return AsyncUniversalResourceWithRawResponse(self._classifications.universal) @@ -90,6 +94,7 @@ def __init__(self, classifications: ClassificationsResource) -> None: @cached_property def universal(self) -> UniversalResourceWithStreamingResponse: + """Classify documents with an Isaacus classification model.""" return UniversalResourceWithStreamingResponse(self._classifications.universal) @@ -99,4 +104,5 @@ def __init__(self, classifications: AsyncClassificationsResource) -> None: @cached_property def universal(self) -> AsyncUniversalResourceWithStreamingResponse: + """Classify documents with an Isaacus classification model.""" return AsyncUniversalResourceWithStreamingResponse(self._classifications.universal) diff --git a/src/isaacus/resources/classifications/universal/universal.py b/src/isaacus/resources/classifications/universal/universal.py index 9784b9c..39ca183 100644 --- a/src/isaacus/resources/classifications/universal/universal.py +++ b/src/isaacus/resources/classifications/universal/universal.py @@ -25,6 +25,8 @@ class UniversalResource(SyncAPIResource): + """Classify documents with an Isaacus classification model.""" + @cached_property def with_raw_response(self) -> UniversalResourceWithRawResponse: """ @@ -47,7 +49,7 @@ def with_streaming_response(self) -> UniversalResourceWithStreamingResponse: def create( self, *, - model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], + model: Literal["kanon-universal-classifier"], query: str, texts: SequenceNotStr[str], is_iql: bool | Omit = omit, @@ -61,8 +63,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UniversalClassificationResponse: """ - Classify the relevance of legal documents to a query with an Isaacus universal - legal AI classifier. + Classify documents with an Isaacus universal classification model. Args: model: The ID of the [model](https://docs.isaacus.com/models#universal-classification) @@ -126,6 +127,8 @@ def create( class AsyncUniversalResource(AsyncAPIResource): + """Classify documents with an Isaacus classification model.""" + @cached_property def with_raw_response(self) -> AsyncUniversalResourceWithRawResponse: """ @@ -148,7 +151,7 @@ def with_streaming_response(self) -> AsyncUniversalResourceWithStreamingResponse async def create( self, *, - model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], + model: Literal["kanon-universal-classifier"], query: str, texts: SequenceNotStr[str], is_iql: bool | Omit = omit, @@ -162,8 +165,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UniversalClassificationResponse: """ - Classify the relevance of legal documents to a query with an Isaacus universal - legal AI classifier. + Classify documents with an Isaacus universal classification model. Args: model: The ID of the [model](https://docs.isaacus.com/models#universal-classification) diff --git a/src/isaacus/resources/embeddings.py b/src/isaacus/resources/embeddings.py index e7a5e3a..6550140 100644 --- a/src/isaacus/resources/embeddings.py +++ b/src/isaacus/resources/embeddings.py @@ -25,6 +25,8 @@ class EmbeddingsResource(SyncAPIResource): + """Vectorize content with an Isaacus embedding model.""" + @cached_property def with_raw_response(self) -> EmbeddingsResourceWithRawResponse: """ @@ -60,7 +62,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmbeddingResponse: """ - Embed legal texts with an Isaacus legal AI embedder. + Vectorize content with an Isaacus embedding model. Args: model: The ID of the [model](https://docs.isaacus.com/models#embedding) to use for @@ -118,6 +120,8 @@ def create( class AsyncEmbeddingsResource(AsyncAPIResource): + """Vectorize content with an Isaacus embedding model.""" + @cached_property def with_raw_response(self) -> AsyncEmbeddingsResourceWithRawResponse: """ @@ -153,7 +157,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmbeddingResponse: """ - Embed legal texts with an Isaacus legal AI embedder. + Vectorize content with an Isaacus embedding model. Args: model: The ID of the [model](https://docs.isaacus.com/models#embedding) to use for diff --git a/src/isaacus/resources/enrichments.py b/src/isaacus/resources/enrichments.py index dba9061..d416910 100644 --- a/src/isaacus/resources/enrichments.py +++ b/src/isaacus/resources/enrichments.py @@ -25,6 +25,8 @@ class EnrichmentsResource(SyncAPIResource): + """Enrich documents with an Isaacus enrichment model.""" + @cached_property def with_raw_response(self) -> EnrichmentsResourceWithRawResponse: """ @@ -58,7 +60,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnrichmentResponse: """ - Enrich documents with an Isaacus enricher model. + Enrich documents with an Isaacus enrichment model. Args: model: The ID of the [model](https://docs.isaacus.com/models#enrichment) to use for @@ -113,6 +115,8 @@ def create( class AsyncEnrichmentsResource(AsyncAPIResource): + """Enrich documents with an Isaacus enrichment model.""" + @cached_property def with_raw_response(self) -> AsyncEnrichmentsResourceWithRawResponse: """ @@ -146,7 +150,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnrichmentResponse: """ - Enrich documents with an Isaacus enricher model. + Enrich documents with an Isaacus enrichment model. Args: model: The ID of the [model](https://docs.isaacus.com/models#enrichment) to use for diff --git a/src/isaacus/resources/extractions/extractions.py b/src/isaacus/resources/extractions/extractions.py index 6733808..e17fe7b 100644 --- a/src/isaacus/resources/extractions/extractions.py +++ b/src/isaacus/resources/extractions/extractions.py @@ -19,6 +19,7 @@ class ExtractionsResource(SyncAPIResource): @cached_property def qa(self) -> QAResource: + """Extract information from documents with an Isaacus extraction model.""" return QAResource(self._client) @cached_property @@ -44,6 +45,7 @@ def with_streaming_response(self) -> ExtractionsResourceWithStreamingResponse: class AsyncExtractionsResource(AsyncAPIResource): @cached_property def qa(self) -> AsyncQAResource: + """Extract information from documents with an Isaacus extraction model.""" return AsyncQAResource(self._client) @cached_property @@ -72,6 +74,7 @@ def __init__(self, extractions: ExtractionsResource) -> None: @cached_property def qa(self) -> QAResourceWithRawResponse: + """Extract information from documents with an Isaacus extraction model.""" return QAResourceWithRawResponse(self._extractions.qa) @@ -81,6 +84,7 @@ def __init__(self, extractions: AsyncExtractionsResource) -> None: @cached_property def qa(self) -> AsyncQAResourceWithRawResponse: + """Extract information from documents with an Isaacus extraction model.""" return AsyncQAResourceWithRawResponse(self._extractions.qa) @@ -90,6 +94,7 @@ def __init__(self, extractions: ExtractionsResource) -> None: @cached_property def qa(self) -> QAResourceWithStreamingResponse: + """Extract information from documents with an Isaacus extraction model.""" return QAResourceWithStreamingResponse(self._extractions.qa) @@ -99,4 +104,5 @@ def __init__(self, extractions: AsyncExtractionsResource) -> None: @cached_property def qa(self) -> AsyncQAResourceWithStreamingResponse: + """Extract information from documents with an Isaacus extraction model.""" return AsyncQAResourceWithStreamingResponse(self._extractions.qa) diff --git a/src/isaacus/resources/extractions/qa/qa.py b/src/isaacus/resources/extractions/qa/qa.py index c356ece..b4a0559 100644 --- a/src/isaacus/resources/extractions/qa/qa.py +++ b/src/isaacus/resources/extractions/qa/qa.py @@ -25,6 +25,8 @@ class QAResource(SyncAPIResource): + """Extract information from documents with an Isaacus extraction model.""" + @cached_property def with_raw_response(self) -> QAResourceWithRawResponse: """ @@ -47,7 +49,7 @@ def with_streaming_response(self) -> QAResourceWithStreamingResponse: def create( self, *, - model: Literal["kanon-answer-extractor", "kanon-answer-extractor-mini"], + model: Literal["kanon-answer-extractor"], query: str, texts: SequenceNotStr[str], ignore_inextractability: bool | Omit = omit, @@ -61,8 +63,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AnswerExtractionResponse: """ - Extract answers to questions from legal documents with an Isaacus legal AI - answer extractor. + Extract information from documents with an Isaacus extractive question answering + model. Args: model: The ID of the @@ -125,6 +127,8 @@ def create( class AsyncQAResource(AsyncAPIResource): + """Extract information from documents with an Isaacus extraction model.""" + @cached_property def with_raw_response(self) -> AsyncQAResourceWithRawResponse: """ @@ -147,7 +151,7 @@ def with_streaming_response(self) -> AsyncQAResourceWithStreamingResponse: async def create( self, *, - model: Literal["kanon-answer-extractor", "kanon-answer-extractor-mini"], + model: Literal["kanon-answer-extractor"], query: str, texts: SequenceNotStr[str], ignore_inextractability: bool | Omit = omit, @@ -161,8 +165,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AnswerExtractionResponse: """ - Extract answers to questions from legal documents with an Isaacus legal AI - answer extractor. + Extract information from documents with an Isaacus extractive question answering + model. Args: model: The ID of the diff --git a/src/isaacus/resources/rerankings.py b/src/isaacus/resources/rerankings.py index cde9f98..b0fda3b 100644 --- a/src/isaacus/resources/rerankings.py +++ b/src/isaacus/resources/rerankings.py @@ -25,6 +25,10 @@ class RerankingsResource(SyncAPIResource): + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ + @cached_property def with_raw_response(self) -> RerankingsResourceWithRawResponse: """ @@ -47,7 +51,7 @@ def with_streaming_response(self) -> RerankingsResourceWithStreamingResponse: def create( self, *, - model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], + model: Literal["kanon-2-reranker", "kanon-universal-classifier"], query: str, texts: SequenceNotStr[str], top_n: Optional[int] | Omit = omit, @@ -62,12 +66,12 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RerankingResponse: """ - Rank legal documents by their relevance to a query with an Isaacus legal AI - reranker. + Score and rank documents by their relevance to queries with an Isaacus reranker. Args: - model: The ID of the [model](https://docs.isaacus.com/models#reranking) to use for - reranking. + model: The ID of the model to use for reranking, being either a + [reranking model](https://docs.isaacus.com/models/introduction#reranking) or + [universal classification model](https://docs.isaacus.com/models/introduction#universal-classification). query: The query to evaluate the relevance of the texts to. @@ -92,7 +96,9 @@ def create( before enabling IQL since queries can be crafted to consume an excessively large amount of tokens. - scoring_method: The method to use for producing an overall relevance score for a text. + scoring_method: The method to use for producing an overall relevance score for a text that + exceeds the model's local context window and has, therefore, been split into + multiple chunks. `auto` is the default scoring method and is recommended for most use cases. Currently, it is equivalent to `chunk_max`. In the future, it will automatically @@ -136,6 +142,10 @@ def create( class AsyncRerankingsResource(AsyncAPIResource): + """ + Score and rank documents by their relevance to queries with an Isaacus reranker. + """ + @cached_property def with_raw_response(self) -> AsyncRerankingsResourceWithRawResponse: """ @@ -158,7 +168,7 @@ def with_streaming_response(self) -> AsyncRerankingsResourceWithStreamingRespons async def create( self, *, - model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"], + model: Literal["kanon-2-reranker", "kanon-universal-classifier"], query: str, texts: SequenceNotStr[str], top_n: Optional[int] | Omit = omit, @@ -173,12 +183,12 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RerankingResponse: """ - Rank legal documents by their relevance to a query with an Isaacus legal AI - reranker. + Score and rank documents by their relevance to queries with an Isaacus reranker. Args: - model: The ID of the [model](https://docs.isaacus.com/models#reranking) to use for - reranking. + model: The ID of the model to use for reranking, being either a + [reranking model](https://docs.isaacus.com/models/introduction#reranking) or + [universal classification model](https://docs.isaacus.com/models/introduction#universal-classification). query: The query to evaluate the relevance of the texts to. @@ -203,7 +213,9 @@ async def create( before enabling IQL since queries can be crafted to consume an excessively large amount of tokens. - scoring_method: The method to use for producing an overall relevance score for a text. + scoring_method: The method to use for producing an overall relevance score for a text that + exceeds the model's local context window and has, therefore, been split into + multiple chunks. `auto` is the default scoring method and is recommended for most use cases. Currently, it is equivalent to `chunk_max`. In the future, it will automatically diff --git a/src/isaacus/types/classifications/universal/universal_classification_response.py b/src/isaacus/types/classifications/universal/universal_classification_response.py index b546438..f2d827a 100644 --- a/src/isaacus/types/classifications/universal/universal_classification_response.py +++ b/src/isaacus/types/classifications/universal/universal_classification_response.py @@ -78,7 +78,7 @@ class UniversalClassificationResponse(BaseModel): classifications: List[Classification] """ The classifications of the texts, by relevance to the query, in order from - highest to lowest relevance score. + highest to lowest confidence score. """ usage: Usage diff --git a/src/isaacus/types/classifications/universal/universal_create_params.py b/src/isaacus/types/classifications/universal/universal_create_params.py index d5833ab..3228177 100644 --- a/src/isaacus/types/classifications/universal/universal_create_params.py +++ b/src/isaacus/types/classifications/universal/universal_create_params.py @@ -11,7 +11,7 @@ class UniversalCreateParams(TypedDict, total=False): - model: Required[Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"]] + model: Required[Literal["kanon-universal-classifier"]] """ The ID of the [model](https://docs.isaacus.com/models#universal-classification) to use for universal classification. diff --git a/src/isaacus/types/extractions/qa/qa_create_params.py b/src/isaacus/types/extractions/qa/qa_create_params.py index fbd1715..c073f27 100644 --- a/src/isaacus/types/extractions/qa/qa_create_params.py +++ b/src/isaacus/types/extractions/qa/qa_create_params.py @@ -11,7 +11,7 @@ class QACreateParams(TypedDict, total=False): - model: Required[Literal["kanon-answer-extractor", "kanon-answer-extractor-mini"]] + model: Required[Literal["kanon-answer-extractor"]] """ The ID of the [model](https://docs.isaacus.com/models#extractive-question-answering) to use diff --git a/src/isaacus/types/reranking_create_params.py b/src/isaacus/types/reranking_create_params.py index ab4a75a..95c1bc2 100644 --- a/src/isaacus/types/reranking_create_params.py +++ b/src/isaacus/types/reranking_create_params.py @@ -11,10 +11,11 @@ class RerankingCreateParams(TypedDict, total=False): - model: Required[Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"]] + model: Required[Literal["kanon-2-reranker", "kanon-universal-classifier"]] """ - The ID of the [model](https://docs.isaacus.com/models#reranking) to use for - reranking. + The ID of the model to use for reranking, being either a + [reranking model](https://docs.isaacus.com/models/introduction#reranking) or + [universal classification model](https://docs.isaacus.com/models/introduction#universal-classification). """ query: Required[str] @@ -49,7 +50,10 @@ class RerankingCreateParams(TypedDict, total=False): """ scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] - """The method to use for producing an overall relevance score for a text. + """ + The method to use for producing an overall relevance score for a text that + exceeds the model's local context window and has, therefore, been split into + multiple chunks. `auto` is the default scoring method and is recommended for most use cases. Currently, it is equivalent to `chunk_max`. In the future, it will automatically diff --git a/src/isaacus/types/reranking_response.py b/src/isaacus/types/reranking_response.py index a0ba8d8..cd61196 100644 --- a/src/isaacus/types/reranking_response.py +++ b/src/isaacus/types/reranking_response.py @@ -31,8 +31,8 @@ class Usage(BaseModel): class RerankingResponse(BaseModel): results: List[Result] """ - The rerankings of the texts, by relevance to the query, in order from highest to - lowest relevance score. + The texts reranked by relevance to the query, in order from highest to lowest + relevance score. """ usage: Usage diff --git a/tests/api_resources/test_rerankings.py b/tests/api_resources/test_rerankings.py index fb37da6..51cb025 100644 --- a/tests/api_resources/test_rerankings.py +++ b/tests/api_resources/test_rerankings.py @@ -21,7 +21,7 @@ class TestRerankings: @parametrize def test_method_create(self, client: Isaacus) -> None: reranking = client.rerankings.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.", @@ -37,7 +37,7 @@ def test_method_create(self, client: Isaacus) -> None: @parametrize def test_method_create_with_all_params(self, client: Isaacus) -> None: reranking = client.rerankings.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.", @@ -61,7 +61,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: @parametrize def test_raw_response_create(self, client: Isaacus) -> None: response = client.rerankings.with_raw_response.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.", @@ -81,7 +81,7 @@ def test_raw_response_create(self, client: Isaacus) -> None: @parametrize def test_streaming_response_create(self, client: Isaacus) -> None: with client.rerankings.with_streaming_response.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.", @@ -109,7 +109,7 @@ class TestAsyncRerankings: @parametrize async def test_method_create(self, async_client: AsyncIsaacus) -> None: reranking = await async_client.rerankings.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.", @@ -125,7 +125,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None: reranking = await async_client.rerankings.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.", @@ -149,7 +149,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - @parametrize async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: response = await async_client.rerankings.with_raw_response.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.", @@ -169,7 +169,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None: async with async_client.rerankings.with_streaming_response.create( - model="kanon-universal-classifier", + model="kanon-2-reranker", query="What are the essential elements required to establish a negligence claim?", texts=[ "To form a contract, there must be an offer, acceptance, consideration, and mutual intent to be bound.",