Skip to main content
POST
/
enrichments
Python
import os
from isaacus import Isaacus

client = Isaacus(
    api_key=os.environ.get("ISAACUS_API_KEY"),  # This is the default and can be omitted
)
enrichment_response = client.enrichments.create(
    model="kanon-2-enricher",
    texts=["1.5 You (the \"User\") agree to be bound by these Terms."],
)
print(enrichment_response.results)
{
"results": [
{
"index": 0,
"document": {
"version": "ilgs@1",
"text": "[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that \"§ 206 of Title 29 of the U.S. Code (the \"Labor Title\") does not apply to the plaintiff, Ms. Moody, given the definition of an \"employee\" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria.\"",
"title": null,
"subtitle": null,
"type": "other",
"jurisdiction": "US-FED",
"segments": [
{
"id": "seg:0",
"kind": "unit",
"type": "paragraph",
"category": "annotation",
"type_name": null,
"code": {
"start": 0,
"end": 4
},
"title": null,
"parent": null,
"children": [],
"level": 0,
"span": {
"start": 0,
"end": 317
}
}
],
"crossreferences": [],
"locations": [
{
"id": "loc:0",
"name": {
"start": 308,
"end": 315
},
"type": "country",
"parent": null,
"children": [],
"mentions": [
{
"start": 308,
"end": 315
}
]
}
],
"persons": [
{
"id": "per:0",
"name": {
"start": 32,
"end": 42
},
"type": "natural",
"role": "defense_counsel",
"parent": null,
"children": [],
"residence": null,
"mentions": [
{
"start": 32,
"end": 42
}
]
},
{
"id": "per:1",
"name": {
"start": 167,
"end": 176
},
"type": "natural",
"role": "plaintiff",
"parent": null,
"children": [],
"residence": "loc:0",
"mentions": [
{
"start": 167,
"end": 176
}
]
}
],
"emails": [],
"websites": [],
"phone_numbers": [],
"id_numbers": [],
"terms": [
{
"id": "term:0",
"name": {
"start": 120,
"end": 131
},
"meaning": {
"start": 88,
"end": 113
},
"mentions": [
{
"start": 237,
"end": 248
}
]
}
],
"external_documents": [
{
"id": "exd:0",
"name": {
"start": 66,
"end": 72
},
"type": "other",
"jurisdiction": "US-FED",
"reception": "neutral",
"mentions": [
{
"start": 66,
"end": 72
}
],
"pinpoints": [
{
"start": 54,
"end": 58
}
]
},
{
"id": "exd:1",
"name": {
"start": 80,
"end": 113
},
"type": "statute",
"jurisdiction": "US-FED",
"reception": "neutral",
"mentions": [
{
"start": 80,
"end": 113
}
],
"pinpoints": [
{
"start": 79,
"end": 84
},
{
"start": 219,
"end": 229
}
]
}
],
"quotes": [
{
"source_segment": null,
"source_document": "exd:0",
"source_person": "per:0",
"amending": false,
"span": {
"start": 79,
"end": 317
}
}
],
"dates": [],
"headings": [],
"junk": []
}
}
],
"usage": {
"input_tokens": 91
}
}

Authorizations

Authorization
string
header
required

An Isaacus-issued API key passed as a bearer token via the Authorization header in the format Authorization: Bearer YOUR_API_KEY.

Body

application/json

A request to enrich texts with an Isaacus enrichment model.

Note that this endpoint is currently in closed beta and is subject to change or be removed without notice until its official release. To get access, apply to the Isaacus Beta Program.

model
string
required

The ID of the model to use for enrichment.

Allowed value: "kanon-2-enricher"
Example:

"kanon-2-enricher"

texts
required

A text or array of texts to be enriched, each containing at least one non-whitespace character.

No more than 8 texts can be enriched in a single request.

Example:
[
"1.5 You (the \"User\") agree to be bound by these Terms."
]
overflow_strategy
null | enum<string>

The strategy for handling content exceeding the model's maximum input length.

auto, which is the recommended setting, currently behaves the same as chunk, which intelligently breaks the input up into smaller chunks and then stitches the results back together into a single prediction. In the future auto may implement even more sophisticated strategies for handling long contexts such as leveraging chunk overlap and/or a specialized stitching model.

chunk breaks the input up into smaller chunks that fit within the model's context window and then intelligently merges the results into a single prediction at the cost of a minor accuracy drop.

drop_end drops tokens from the end of input exceeding the model's maximum input length.

null, which is the default setting, raises an error if the input exceeds the model's maximum input length.

Available options:
auto,
drop_end,
chunk,
Example:

"auto"

Response

The enriched documents alongside usage statistics.

results
Enrichment result · object[]
required

The enriched documents alongside, and in order of, their indices in the input array of texts.

Example:
{
"version": "ilgs@1",
"text": "[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that \"§ 206 of Title 29 of the U.S. Code (the \"Labor Title\") does not apply to the plaintiff, Ms. Moody, given the definition of an \"employee\" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria.\"",
"title": null,
"subtitle": null,
"type": "other",
"jurisdiction": "US-FED",
"segments": [
{
"id": "seg:0",
"kind": "unit",
"type": "paragraph",
"category": "annotation",
"type_name": null,
"code": { "start": 0, "end": 4 },
"title": null,
"parent": null,
"children": [],
"level": 0,
"span": { "start": 0, "end": 317 }
}
],
"crossreferences": [],
"locations": [
{
"id": "loc:0",
"name": { "start": 308, "end": 315 },
"type": "country",
"parent": null,
"children": [],
"mentions": [{ "start": 308, "end": 315 }]
}
],
"persons": [
{
"id": "per:0",
"name": { "start": 32, "end": 42 },
"type": "natural",
"role": "defense_counsel",
"parent": null,
"children": [],
"residence": null,
"mentions": [{ "start": 32, "end": 42 }]
},
{
"id": "per:1",
"name": { "start": 167, "end": 176 },
"type": "natural",
"role": "plaintiff",
"parent": null,
"children": [],
"residence": "loc:0",
"mentions": [{ "start": 167, "end": 176 }]
}
],
"emails": [],
"websites": [],
"phone_numbers": [],
"id_numbers": [],
"terms": [
{
"id": "term:0",
"name": { "start": 120, "end": 131 },
"meaning": { "start": 88, "end": 113 },
"mentions": [{ "start": 237, "end": 248 }]
}
],
"external_documents": [
{
"id": "exd:0",
"name": { "start": 66, "end": 72 },
"type": "other",
"jurisdiction": "US-FED",
"reception": "neutral",
"mentions": [{ "start": 66, "end": 72 }],
"pinpoints": [{ "start": 54, "end": 58 }]
},
{
"id": "exd:1",
"name": { "start": 80, "end": 113 },
"type": "statute",
"jurisdiction": "US-FED",
"reception": "neutral",
"mentions": [{ "start": 80, "end": 113 }],
"pinpoints": [
{ "start": 79, "end": 84 },
{ "start": 219, "end": 229 }
]
}
],
"quotes": [
{
"source_segment": null,
"source_document": "exd:0",
"source_person": "per:0",
"amending": false,
"span": { "start": 79, "end": 317 }
}
],
"dates": [],
"headings": [],
"junk": []
}
usage
Enrichment usage · object
required

Statistics about the usage of resources in the process of enriching the input.

Example:
{ "input_tokens": 91 }