Skip to content

Commit e668eb8

Browse files
docs: update examples
1 parent fa77f22 commit e668eb8

File tree

7 files changed

+21
-17
lines changed

7 files changed

+21
-17
lines changed

packages/mcp-server/src/local-docs-search.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,21 @@ const EMBEDDED_METHODS: MethodEntry[] = [
211211
],
212212
response: '{ results: { index: number; document: object; }[]; usage: { input_tokens: number; }; }',
213213
markdown:
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: ['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```",
215215
perLanguage: {
216216
http: {
217217
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 }\'',
219219
},
220220
python: {
221221
method: 'enrichments.create',
222222
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)',
224224
},
225225
typescript: {
226226
method: 'client.enrichments.create',
227227
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);",
229229
},
230230
},
231231
},

src/resources/enrichments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class Enrichments extends APIResource {
1717
* const enrichmentResponse = await client.enrichments.create({
1818
* model: 'kanon-2-enricher',
1919
* texts: [
20-
* '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."',
2121
* ],
2222
* });
2323
* ```

tests/api-resources/classifications/universal.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ describe('resource universal', () => {
3434
scoring_method: 'auto',
3535
chunking_options: {
3636
size: 512,
37-
overlap_ratio: 0.1,
38-
overlap_tokens: 10,
37+
overlap_ratio: null,
38+
overlap_tokens: null,
3939
},
4040
});
4141
});

tests/api-resources/embeddings.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('resource embeddings', () => {
3030
texts: ['Are restraints of trade enforceable under English law?', 'What is a non-compete clause?'],
3131
task: 'retrieval/query',
3232
overflow_strategy: 'drop_end',
33-
dimensions: 1,
33+
dimensions: 1792,
3434
});
3535
});
3636
});

tests/api-resources/enrichments.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ describe('resource enrichments', () => {
1212
test.skip('create: only required params', async () => {
1313
const responsePromise = client.enrichments.create({
1414
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."',
17+
],
1618
});
1719
const rawResponse = await responsePromise.asResponse();
1820
expect(rawResponse).toBeInstanceOf(Response);
@@ -27,7 +29,9 @@ describe('resource enrichments', () => {
2729
test.skip('create: required and optional params', async () => {
2830
const response = await client.enrichments.create({
2931
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."',
34+
],
3135
overflow_strategy: 'auto',
3236
});
3337
});

tests/api-resources/extractions/qa.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ describe('resource qa', () => {
3737
ignore_inextractability: false,
3838
top_k: 1,
3939
chunking_options: {
40-
size: 512,
41-
overlap_ratio: 0.1,
42-
overlap_tokens: 10,
40+
size: null,
41+
overlap_ratio: null,
42+
overlap_tokens: null,
4343
},
4444
});
4545
});

tests/api-resources/rerankings.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ describe('resource rerankings', () => {
4242
'Negligence in tort law requires establishing a duty of care that the defendant owed to the plaintiff.',
4343
'The concept of negligence is central to tort law, with courts assessing whether a breach of duty caused harm.',
4444
],
45-
top_n: 1,
45+
top_n: null,
4646
is_iql: false,
4747
scoring_method: 'auto',
4848
chunking_options: {
49-
size: 512,
50-
overlap_ratio: 0.1,
51-
overlap_tokens: 10,
49+
size: null,
50+
overlap_ratio: null,
51+
overlap_tokens: null,
5252
},
5353
});
5454
});

0 commit comments

Comments
 (0)