You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"## create\n\n`client.enrichments.create(model: 'kanon-2-enricher', texts: string[] | string, overflow_strategy?: 'auto' | 'drop_end' | 'chunk'): { results: object[]; usage: object; }`\n\n**post** `/enrichments`\n\nEnrich documents with an Isaacus enrichment model.\n\n### Parameters\n\n- `model: 'kanon-2-enricher'`\n The ID of the [model](https://docs.isaacus.com/models#enrichment) to use for enrichment.\n\n- `texts: string[] | string`\n A text or array of texts to be enriched, each containing at least one non-whitespace character.\n\nNo more than 8 texts can be enriched in a single request.\n\n- `overflow_strategy?: 'auto' | 'drop_end' | 'chunk'`\n The strategy for handling content exceeding the model's maximum input length.\n\n`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.\n\n`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.\n\n`drop_end` drops tokens from the end of input exceeding the model's maximum input length.\n\n`null`, which is the default setting, raises an error if the input exceeds the model's maximum input length.\n\n### Returns\n\n- `{ results: { index: number; document: object; }[]; usage: { input_tokens: number; }; }`\n\n - `results: { index: number; document: { text: string; title: object; subtitle: object; type: 'statute' | 'regulation' | 'decision' | 'contract' | 'other'; jurisdiction: string; segments: object[]; crossreferences: object[]; locations: object[]; persons: object[]; emails: object[]; websites: object[]; phone_numbers: object[]; id_numbers: object[]; terms: object[]; external_documents: object[]; quotes: object[]; dates: object[]; headings: object[]; junk: object[]; version: 'ilgs@1'; }; }[]`\n - `usage: { input_tokens: number; }`\n\n### Example\n\n```typescript\nimport Isaacus from 'isaacus';\n\nconst client = new Isaacus();\n\nconst enrichmentResponse = await client.enrichments.create({ model: 'kanon-2-enricher', texts: ['1.5 You (the \"User\") agree to be bound by these Terms.'] });\n\nconsole.log(enrichmentResponse);\n```",
214
+
"## create\n\n`client.enrichments.create(model: 'kanon-2-enricher', texts: string[] | string, overflow_strategy?: 'auto' | 'drop_end' | 'chunk'): { results: object[]; usage: object; }`\n\n**post** `/enrichments`\n\nEnrich documents with an Isaacus enrichment model.\n\n### Parameters\n\n- `model: 'kanon-2-enricher'`\n The ID of the [model](https://docs.isaacus.com/models#enrichment) to use for enrichment.\n\n- `texts: string[] | string`\n A text or array of texts to be enriched, each containing at least one non-whitespace character.\n\nNo more than 8 texts can be enriched in a single request.\n\n- `overflow_strategy?: 'auto' | 'drop_end' | 'chunk'`\n The strategy for handling content exceeding the model's maximum input length.\n\n`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.\n\n`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.\n\n`drop_end` drops tokens from the end of input exceeding the model's maximum input length.\n\n`null`, which is the default setting, raises an error if the input exceeds the model's maximum input length.\n\n### Returns\n\n- `{ results: { index: number; document: object; }[]; usage: { input_tokens: number; }; }`\n\n - `results: { index: number; document: { text: string; title: object; subtitle: object; type: 'statute' | 'regulation' | 'decision' | 'contract' | 'other'; jurisdiction: string; segments: object[]; crossreferences: object[]; locations: object[]; persons: object[]; emails: object[]; websites: object[]; phone_numbers: object[]; id_numbers: object[]; terms: object[]; external_documents: object[]; quotes: object[]; dates: object[]; headings: object[]; junk: object[]; version: 'ilgs@1'; }; }[]`\n - `usage: { input_tokens: number; }`\n\n### Example\n\n```typescript\nimport Isaacus from 'isaacus';\n\nconst client = new Isaacus();\n\nconst enrichmentResponse = await client.enrichments.create({ model: 'kanon-2-enricher', texts: ['[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.\"'] });\n\nconsole.log(enrichmentResponse);\n```",
215
215
perLanguage: {
216
216
http: {
217
217
example:
218
-
'curl https://api.isaacus.com/v1/enrichments \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ISAACUS_API_KEY" \\\n -d \'{\n "model": "kanon-2-enricher",\n "texts": [\n "1.5 You (the \\\\"User\\\\") agree to be bound by these Terms."\n ]\n }\'',
218
+
'curl https://api.isaacus.com/v1/enrichments \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ISAACUS_API_KEY" \\\n -d \'{\n "model": "kanon-2-enricher",\n "texts": [\n "[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.\\\\""\n ]\n }\'',
219
219
},
220
220
python: {
221
221
method: 'enrichments.create',
222
222
example:
223
-
'import os\nfrom isaacus import Isaacus\n\nclient = Isaacus(\n api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted\n)\nenrichment_response = client.enrichments.create(\n model="kanon-2-enricher",\n texts=["1.5 You (the \\"User\\") agree to be bound by these Terms."],\n)\nprint(enrichment_response.results)',
223
+
'import os\nfrom isaacus import Isaacus\n\nclient = Isaacus(\n api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted\n)\nenrichment_response = client.enrichments.create(\n model="kanon-2-enricher",\n texts=["[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.\\""],\n)\nprint(enrichment_response.results)',
224
224
},
225
225
typescript: {
226
226
method: 'client.enrichments.create',
227
227
example:
228
-
"import Isaacus from 'isaacus';\n\nconst client = new Isaacus({\n apiKey: process.env['ISAACUS_API_KEY'], // This is the default and can be omitted\n});\n\nconst enrichmentResponse = await client.enrichments.create({\n model: 'kanon-2-enricher',\n texts: ['1.5 You (the \"User\") agree to be bound by these Terms.'],\n});\n\nconsole.log(enrichmentResponse.results);",
228
+
"import Isaacus from 'isaacus';\n\nconst client = new Isaacus({\n apiKey: process.env['ISAACUS_API_KEY'], // This is the default and can be omitted\n});\n\nconst enrichmentResponse = await client.enrichments.create({\n model: 'kanon-2-enricher',\n texts: [\n '[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.\"',\n ],\n});\n\nconsole.log(enrichmentResponse.results);",
* '1.5 You (the "User") agree to be bound by these Terms.',
20
+
* '[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."',
test.skip('create: only required params',async()=>{
13
13
constresponsePromise=client.enrichments.create({
14
14
model: 'kanon-2-enricher',
15
-
texts: ['1.5 You (the "User") agree to be bound by these Terms.'],
15
+
texts: [
16
+
'[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."',
test.skip('create: required and optional params',async()=>{
28
30
constresponse=awaitclient.enrichments.create({
29
31
model: 'kanon-2-enricher',
30
-
texts: ['1.5 You (the "User") agree to be bound by these Terms.'],
32
+
texts: [
33
+
'[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."',
0 commit comments