Skip to content

Commit 4e9c114

Browse files
authored
Merge pull request #43 from isaacus-dev/release-please--branches--main--changes--next--components--isaacus
release: 0.6.0
2 parents c441312 + 4cce17f commit 4e9c114

File tree

12 files changed

+106
-69
lines changed

12 files changed

+106
-69
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.5.1"
2+
".": "0.6.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 2
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-d58ccd91625a3b12fd8d1ceece128b604010bd840096000287c927cb5dcf79eb.yml
3-
openapi_spec_hash: 22c8c973d55f26649e9df96c89ea537f
4-
config_hash: 1d603d50b7183a492ad6df5f728a1863
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-213d554b23f35e746460af23dd32bdde471230549ad223518c86d42ea917a180.yml
3+
openapi_spec_hash: 3672281fe031a42fc59e3a2af758a8f8
4+
config_hash: 1d15d860383a3f6da1ac388297687cc9

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 0.6.0 (2025-04-19)
4+
5+
Full Changelog: [v0.5.1...v0.6.0](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.5.1...v0.6.0)
6+
7+
### ⚠ BREAKING CHANGES
8+
9+
* **api:** made universal classification endpoint multi-input only
10+
11+
### Features
12+
13+
* **api:** made universal classification endpoint multi-input only ([af242f4](https://github.com/isaacus-dev/isaacus-typescript/commit/af242f49a223c9521b713ff6f35343913a3d804f))
14+
315
## 0.5.1 (2025-04-16)
416

517
Full Changelog: [v0.5.0...v0.5.1](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.5.0...v0.5.1)

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ async function main() {
3030
const universalClassification = await client.classifications.universal.create({
3131
model: 'kanon-universal-classifier',
3232
query: 'This is a confidentiality clause.',
33-
text: 'I agree not to tell anyone about the document.',
33+
texts: ['I agree not to tell anyone about the document.'],
3434
});
3535

36-
console.log(universalClassification.chunks);
36+
console.log(universalClassification.classifications);
3737
}
3838

3939
main();
@@ -55,7 +55,7 @@ async function main() {
5555
const params: Isaacus.Classifications.UniversalCreateParams = {
5656
model: 'kanon-universal-classifier',
5757
query: 'This is a confidentiality clause.',
58-
text: 'I agree not to tell anyone about the document.',
58+
texts: ['I agree not to tell anyone about the document.'],
5959
};
6060
const universalClassification: Isaacus.Classifications.UniversalClassification =
6161
await client.classifications.universal.create(params);
@@ -79,7 +79,7 @@ async function main() {
7979
.create({
8080
model: 'kanon-universal-classifier',
8181
query: 'This is a confidentiality clause.',
82-
text: 'I agree not to tell anyone about the document.',
82+
texts: ['I agree not to tell anyone about the document.'],
8383
})
8484
.catch(async (err) => {
8585
if (err instanceof Isaacus.APIError) {
@@ -124,7 +124,7 @@ const client = new Isaacus({
124124
});
125125

126126
// Or, configure per-request:
127-
await client.classifications.universal.create({ model: 'kanon-universal-classifier', query: 'This is a confidentiality clause.', text: 'I agree not to tell anyone about the document.' }, {
127+
await client.classifications.universal.create({ model: 'kanon-universal-classifier', query: 'This is a confidentiality clause.', texts: ['I agree not to tell anyone about the document.'] }, {
128128
maxRetries: 5,
129129
});
130130
```
@@ -141,7 +141,7 @@ const client = new Isaacus({
141141
});
142142

143143
// Override per-request:
144-
await client.classifications.universal.create({ model: 'kanon-universal-classifier', query: 'This is a confidentiality clause.', text: 'I agree not to tell anyone about the document.' }, {
144+
await client.classifications.universal.create({ model: 'kanon-universal-classifier', query: 'This is a confidentiality clause.', texts: ['I agree not to tell anyone about the document.'] }, {
145145
timeout: 5 * 1000,
146146
});
147147
```
@@ -168,7 +168,7 @@ const response = await client.classifications.universal
168168
.create({
169169
model: 'kanon-universal-classifier',
170170
query: 'This is a confidentiality clause.',
171-
text: 'I agree not to tell anyone about the document.',
171+
texts: ['I agree not to tell anyone about the document.'],
172172
})
173173
.asResponse();
174174
console.log(response.headers.get('X-My-Header'));
@@ -178,11 +178,11 @@ const { data: universalClassification, response: raw } = await client.classifica
178178
.create({
179179
model: 'kanon-universal-classifier',
180180
query: 'This is a confidentiality clause.',
181-
text: 'I agree not to tell anyone about the document.',
181+
texts: ['I agree not to tell anyone about the document.'],
182182
})
183183
.withResponse();
184184
console.log(raw.headers.get('X-My-Header'));
185-
console.log(universalClassification.chunks);
185+
console.log(universalClassification.classifications);
186186
```
187187

188188
### Logging

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isaacus",
3-
"version": "0.5.1",
3+
"version": "0.6.0",
44
"description": "The official TypeScript library for the Isaacus API",
55
"author": "Isaacus <support@isaacus.com>",
66
"types": "dist/index.d.ts",

packages/mcp-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The following tools are available in this MCP server.
9393

9494
### Resource `classifications.universal`:
9595

96-
- `create_classifications_universal` (`write`): Classify the relevance of a legal document to a query with an Isaacus universal legal AI classifier.
96+
- `create_classifications_universal` (`write`): Classify the relevance of legal documents to a query with an Isaacus universal legal AI classifier.
9797

9898
### Resource `rerankings`:
9999

packages/mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isaacus-mcp",
3-
"version": "0.5.1",
3+
"version": "0.6.0",
44
"description": "The official MCP Server for the Isaacus API",
55
"author": "Isaacus <support@isaacus.com>",
66
"types": "dist/index.d.ts",

packages/mcp-server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export { endpoints } from './tools';
1111
export const server = new McpServer(
1212
{
1313
name: 'isaacus_api',
14-
version: '0.5.1',
14+
version: '0.6.0',
1515
},
1616
{
1717
capabilities: {

packages/mcp-server/src/tools/classifications/universal/create-classifications-universal.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const metadata: Metadata = {
1313
export const tool: Tool = {
1414
name: 'create_classifications_universal',
1515
description:
16-
'Classify the relevance of a legal document to a query with an Isaacus universal legal AI classifier.',
16+
'Classify the relevance of legal documents to a query with an Isaacus universal legal AI classifier.',
1717
inputSchema: {
1818
type: 'object',
1919
properties: {
@@ -26,11 +26,16 @@ export const tool: Tool = {
2626
query: {
2727
type: 'string',
2828
description:
29-
'The [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query or, if IQL is disabled, the statement, to evaluate the text against.\n\nThe query must contain at least one non-whitespace character.\n\nUnlike the text being classified, the query cannot be so long that it exceeds the maximum input length of the universal classifier.',
29+
'The [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query or, if IQL is disabled, the statement, to evaluate the texts against.\n\nThe query must contain at least one non-whitespace character.\n\nUnlike the texts being classified, the query cannot be so long that it exceeds the maximum input length of the universal classifier.',
3030
},
31-
text: {
32-
type: 'string',
33-
description: 'The text to classify.\n\nThe text must contain at least one non-whitespace character.',
31+
texts: {
32+
type: 'array',
33+
description:
34+
'The texts to classify.\n\nThe texts must contain at least one non-whitespace character.',
35+
items: {
36+
type: 'string',
37+
title: 'Non-blank string',
38+
},
3439
},
3540
chunking_options: {
3641
type: 'object',
@@ -63,7 +68,7 @@ export const tool: Tool = {
6368
scoring_method: {
6469
type: 'string',
6570
description:
66-
"The method to use for producing an overall confidence score.\n\n`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 select the best method based on the model and input.\n\n`chunk_max` uses the highest confidence score of all of the text's chunks.\n\n`chunk_avg` averages the confidence scores of all of the text's chunks.\n\n`chunk_min` uses the lowest confidence score of all of the text's chunks.",
71+
"The method to use for producing an overall confidence score.\n\n`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 select the best method based on the model and inputs.\n\n`chunk_max` uses the highest confidence score of all of the texts' chunks.\n\n`chunk_avg` averages the confidence scores of all of the texts' chunks.\n\n`chunk_min` uses the lowest confidence score of all of the texts' chunks.",
6772
enum: ['auto', 'chunk_max', 'chunk_avg', 'chunk_min'],
6873
},
6974
},

src/resources/classifications/universal.ts

Lines changed: 63 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RequestOptions } from '../../internal/request-options';
66

77
export class Universal extends APIResource {
88
/**
9-
* Classify the relevance of a legal document to a query with an Isaacus universal
9+
* Classify the relevance of legal documents to a query with an Isaacus universal
1010
* legal AI classifier.
1111
*/
1212
create(body: UniversalCreateParams, options?: RequestOptions): APIPromise<UniversalClassification> {
@@ -15,27 +15,15 @@ export class Universal extends APIResource {
1515
}
1616

1717
/**
18-
* A classification of the relevance of a legal document to a query produced by an
18+
* Classifications of the relevance of legal documents to a query produced by an
1919
* Isaacus universal legal AI classifier.
2020
*/
2121
export interface UniversalClassification {
2222
/**
23-
* The text as broken into chunks by
24-
* [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own
25-
* confidence score, ordered from highest to lowest score.
26-
*
27-
* If no chunking occurred, this will be `null`.
28-
*/
29-
chunks: Array<UniversalClassification.Chunk> | null;
30-
31-
/**
32-
* A score of the likelihood that the query expressed about the text is supported
33-
* by the text.
34-
*
35-
* A score greater than `0.5` indicates that the text supports the query, while a
36-
* score less than `0.5` indicates that the text does not support the query.
23+
* The classifications of the texts, by relevance to the query, in order from
24+
* highest to lowest relevance score.
3725
*/
38-
score: number;
26+
classifications: Array<UniversalClassification.Classification>;
3927

4028
/**
4129
* Statistics about the usage of resources in the process of classifying the text.
@@ -44,35 +32,67 @@ export interface UniversalClassification {
4432
}
4533

4634
export namespace UniversalClassification {
47-
export interface Chunk {
35+
export interface Classification {
4836
/**
49-
* The end index of the chunk in the original text.
37+
* The text as broken into chunks by
38+
* [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own
39+
* confidence score, ordered from highest to lowest score.
40+
*
41+
* If no chunking occurred, this will be `null`.
5042
*/
51-
end: number;
43+
chunks: Array<Classification.Chunk> | null;
5244

5345
/**
54-
* The index of the chunk in the list of chunks.
46+
* The index of the text in the input array of texts, starting from `0` (and,
47+
* therefore, ending at the number of texts minus `1`).
5548
*/
5649
index: number;
5750

5851
/**
59-
* The model's score of the likelihood that the query expressed about the chunk is
60-
* supported by the chunk.
52+
* A score of the likelihood that the query expressed about the text is supported
53+
* by the text.
6154
*
62-
* A score greater than `0.5` indicates that the chunk supports the query, while a
63-
* score less than `0.5` indicates that the chunk does not support the query.
55+
* A score greater than `0.5` indicates that the text supports the query, while a
56+
* score less than `0.5` indicates that the text does not support the query.
6457
*/
6558
score: number;
59+
}
6660

67-
/**
68-
* The start index of the chunk in the original text.
69-
*/
70-
start: number;
71-
72-
/**
73-
* The text of the chunk.
74-
*/
75-
text: string;
61+
export namespace Classification {
62+
export interface Chunk {
63+
/**
64+
* The index of the character in the original text where the chunk ends, beginning
65+
* from `0` (such that, in Python, the chunk is equivalent to `text[start:end+1]`).
66+
*/
67+
end: number;
68+
69+
/**
70+
* The original position of the chunk in the outputted list of chunks before
71+
* sorting, starting from `0` (and, therefore, ending at the number of chunks minus
72+
* `1`).
73+
*/
74+
index: number;
75+
76+
/**
77+
* The model's score of the likelihood that the query expressed about the chunk is
78+
* supported by the chunk.
79+
*
80+
* A score greater than `0.5` indicates that the chunk supports the query, while a
81+
* score less than `0.5` indicates that the chunk does not support the query.
82+
*/
83+
score: number;
84+
85+
/**
86+
* The index of the character in the original text where the chunk starts,
87+
* beginning from `0`.
88+
*/
89+
start: number;
90+
91+
/**
92+
* The text of the chunk.
93+
*/
94+
text: string;
95+
}
7696
}
7797

7898
/**
@@ -95,21 +115,21 @@ export interface UniversalCreateParams {
95115

96116
/**
97117
* The [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query or, if
98-
* IQL is disabled, the statement, to evaluate the text against.
118+
* IQL is disabled, the statement, to evaluate the texts against.
99119
*
100120
* The query must contain at least one non-whitespace character.
101121
*
102-
* Unlike the text being classified, the query cannot be so long that it exceeds
122+
* Unlike the texts being classified, the query cannot be so long that it exceeds
103123
* the maximum input length of the universal classifier.
104124
*/
105125
query: string;
106126

107127
/**
108-
* The text to classify.
128+
* The texts to classify.
109129
*
110-
* The text must contain at least one non-whitespace character.
130+
* The texts must contain at least one non-whitespace character.
111131
*/
112-
text: string;
132+
texts: Array<string>;
113133

114134
/**
115135
* Options for how to split text into smaller chunks.
@@ -127,13 +147,13 @@ export interface UniversalCreateParams {
127147
*
128148
* `auto` is the default scoring method and is recommended for most use cases.
129149
* Currently, it is equivalent to `chunk_max`. In the future, it will automatically
130-
* select the best method based on the model and input.
150+
* select the best method based on the model and inputs.
131151
*
132-
* `chunk_max` uses the highest confidence score of all of the text's chunks.
152+
* `chunk_max` uses the highest confidence score of all of the texts' chunks.
133153
*
134-
* `chunk_avg` averages the confidence scores of all of the text's chunks.
154+
* `chunk_avg` averages the confidence scores of all of the texts' chunks.
135155
*
136-
* `chunk_min` uses the lowest confidence score of all of the text's chunks.
156+
* `chunk_min` uses the lowest confidence score of all of the texts' chunks.
137157
*/
138158
scoring_method?: 'auto' | 'chunk_max' | 'chunk_avg' | 'chunk_min';
139159
}

0 commit comments

Comments
 (0)