Skip to content

Commit 14a9df4

Browse files
fix(sdk)!: add _response to response models to finally fix duplicated names
1 parent ed71d7d commit 14a9df4

File tree

17 files changed

+65
-62
lines changed

17 files changed

+65
-62
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-43557cfcc912900321433e1b633b39a81a3bfdbcfc86784aff4ff8219f5ebec4.yml
33
openapi_spec_hash: e612b47282935484c5de2ebbd49df824
4-
config_hash: 886b5eef0dbd90b8e6686e987a07b816
4+
config_hash: efa2ea406c5ecd6883ff8b0fb428e579

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ const client = new Isaacus({
2626
apiKey: process.env['ISAACUS_API_KEY'], // This is the default and can be omitted
2727
});
2828

29-
const universalClassification = await client.classifications.universal.create({
29+
const universalClassificationResponse = await client.classifications.universal.create({
3030
model: 'kanon-universal-classifier',
3131
query: 'This is a confidentiality clause.',
3232
texts: ['I agree not to tell anyone about the document.'],
3333
});
3434

35-
console.log(universalClassification.classifications);
35+
console.log(universalClassificationResponse.classifications);
3636
```
3737

3838
### Request & Response types
@@ -52,7 +52,7 @@ const params: Isaacus.Classifications.UniversalCreateParams = {
5252
query: 'This is a confidentiality clause.',
5353
texts: ['I agree not to tell anyone about the document.'],
5454
};
55-
const universalClassification: Isaacus.Classifications.UniversalClassification =
55+
const universalClassificationResponse: Isaacus.Classifications.UniversalClassificationResponse =
5656
await client.classifications.universal.create(params);
5757
```
5858

@@ -66,7 +66,7 @@ a subclass of `APIError` will be thrown:
6666

6767
<!-- prettier-ignore -->
6868
```ts
69-
const universalClassification = await client.classifications.universal
69+
const universalClassificationResponse = await client.classifications.universal
7070
.create({
7171
model: 'kanon-universal-classifier',
7272
query: 'This is a confidentiality clause.',
@@ -162,15 +162,15 @@ const response = await client.classifications.universal
162162
console.log(response.headers.get('X-My-Header'));
163163
console.log(response.statusText); // access the underlying Response object
164164

165-
const { data: universalClassification, response: raw } = await client.classifications.universal
165+
const { data: universalClassificationResponse, response: raw } = await client.classifications.universal
166166
.create({
167167
model: 'kanon-universal-classifier',
168168
query: 'This is a confidentiality clause.',
169169
texts: ['I agree not to tell anyone about the document.'],
170170
})
171171
.withResponse();
172172
console.log(raw.headers.get('X-My-Header'));
173-
console.log(universalClassification.classifications);
173+
console.log(universalClassificationResponse.classifications);
174174
```
175175

176176
### Logging

api.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@
22

33
Types:
44

5-
- <code><a href="./src/resources/embeddings.ts">Embedding</a></code>
5+
- <code><a href="./src/resources/embeddings.ts">EmbeddingResponse</a></code>
66

77
Methods:
88

9-
- <code title="post /embeddings">client.embeddings.<a href="./src/resources/embeddings.ts">create</a>({ ...params }) -> Embedding</code>
9+
- <code title="post /embeddings">client.embeddings.<a href="./src/resources/embeddings.ts">create</a>({ ...params }) -> EmbeddingResponse</code>
1010

1111
# Classifications
1212

1313
## Universal
1414

1515
Types:
1616

17-
- <code><a href="./src/resources/classifications/universal.ts">UniversalClassification</a></code>
17+
- <code><a href="./src/resources/classifications/universal.ts">UniversalClassificationResponse</a></code>
1818

1919
Methods:
2020

21-
- <code title="post /classifications/universal">client.classifications.universal.<a href="./src/resources/classifications/universal.ts">create</a>({ ...params }) -> UniversalClassification</code>
21+
- <code title="post /classifications/universal">client.classifications.universal.<a href="./src/resources/classifications/universal.ts">create</a>({ ...params }) -> UniversalClassificationResponse</code>
2222

2323
# Rerankings
2424

2525
Types:
2626

27-
- <code><a href="./src/resources/rerankings.ts">Reranking</a></code>
27+
- <code><a href="./src/resources/rerankings.ts">RerankingResponse</a></code>
2828

2929
Methods:
3030

31-
- <code title="post /rerankings">client.rerankings.<a href="./src/resources/rerankings.ts">create</a>({ ...params }) -> Reranking</code>
31+
- <code title="post /rerankings">client.rerankings.<a href="./src/resources/rerankings.ts">create</a>({ ...params }) -> RerankingResponse</code>
3232

3333
# Extractions
3434

3535
## Qa
3636

3737
Types:
3838

39-
- <code><a href="./src/resources/extractions/qa.ts">AnswerExtraction</a></code>
39+
- <code><a href="./src/resources/extractions/qa.ts">AnswerExtractionResponse</a></code>
4040

4141
Methods:
4242

43-
- <code title="post /extractions/qa">client.extractions.qa.<a href="./src/resources/extractions/qa.ts">create</a>({ ...params }) -> AnswerExtraction</code>
43+
- <code title="post /extractions/qa">client.extractions.qa.<a href="./src/resources/extractions/qa.ts">create</a>({ ...params }) -> AnswerExtractionResponse</code>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
1818
export const tool: Tool = {
1919
name: 'create_classifications_universal',
2020
description:
21-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nClassify the relevance of legal documents to a query with an Isaacus universal legal AI classifier.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/universal_classification',\n $defs: {\n universal_classification: {\n type: 'object',\n title: 'Universal classification response',\n description: 'Classifications of the relevance of legal documents to a query produced by an Isaacus universal legal AI classifier.',\n properties: {\n classifications: {\n type: 'array',\n description: 'The classifications of the texts, by relevance to the query, in order from highest to lowest relevance score.',\n items: {\n type: 'object',\n title: 'Universal classification',\n properties: {\n chunks: {\n type: 'array',\n description: 'The text as broken into chunks by [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own confidence score, ordered from highest to lowest score.\\n\\nIf no chunking occurred, this will be `null`.',\n items: {\n type: 'object',\n title: 'Universal classification chunk',\n properties: {\n end: {\n type: 'integer',\n description: 'The index of the character immediately after the last character of the chunk in the original text, beginning from `0` (such that, in Python, the chunk is equivalent to `text[start:end]`).'\n },\n index: {\n type: 'integer',\n description: 'The original position of the chunk in the outputted list of chunks before sorting, starting from `0` (and, therefore, ending at the number of chunks minus `1`).'\n },\n score: {\n type: 'number',\n description: 'The model\\'s score of the likelihood that the query expressed about the chunk is supported by the chunk.\\n\\nA score greater than `0.5` indicates that the chunk supports the query, while a score less than `0.5` indicates that the chunk does not support the query.'\n },\n start: {\n type: 'integer',\n description: 'The index of the character in the original text where the chunk starts, beginning from `0`.'\n },\n text: {\n type: 'string',\n description: 'The text of the chunk.'\n }\n },\n required: [ 'end',\n 'index',\n 'score',\n 'start',\n 'text'\n ]\n }\n },\n index: {\n type: 'integer',\n description: 'The index of the text in the input array of texts, starting from `0` (and, therefore, ending at the number of texts minus `1`).'\n },\n score: {\n type: 'number',\n description: 'A score of the likelihood that the query expressed about the text is supported by the text.\\n\\nA score greater than `0.5` indicates that the text supports the query, while a score less than `0.5` indicates that the text does not support the query.'\n }\n },\n required: [ 'chunks',\n 'index',\n 'score'\n ]\n }\n },\n usage: {\n type: 'object',\n title: 'Universal classification usage',\n description: 'Statistics about the usage of resources in the process of classifying the text.',\n properties: {\n input_tokens: {\n type: 'integer',\n description: 'The number of tokens inputted to the model.'\n }\n },\n required: [ 'input_tokens'\n ]\n }\n },\n required: [ 'classifications',\n 'usage'\n ]\n }\n }\n}\n```",
21+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nClassify the relevance of legal documents to a query with an Isaacus universal legal AI classifier.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/universal_classification_response',\n $defs: {\n universal_classification_response: {\n type: 'object',\n title: 'Universal classification response',\n description: 'Classifications of the relevance of legal documents to a query produced by an Isaacus universal legal AI classifier.',\n properties: {\n classifications: {\n type: 'array',\n description: 'The classifications of the texts, by relevance to the query, in order from highest to lowest relevance score.',\n items: {\n type: 'object',\n title: 'Universal classification',\n properties: {\n chunks: {\n type: 'array',\n description: 'The text as broken into chunks by [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own confidence score, ordered from highest to lowest score.\\n\\nIf no chunking occurred, this will be `null`.',\n items: {\n type: 'object',\n title: 'Universal classification chunk',\n properties: {\n end: {\n type: 'integer',\n description: 'The index of the character immediately after the last character of the chunk in the original text, beginning from `0` (such that, in Python, the chunk is equivalent to `text[start:end]`).'\n },\n index: {\n type: 'integer',\n description: 'The original position of the chunk in the outputted list of chunks before sorting, starting from `0` (and, therefore, ending at the number of chunks minus `1`).'\n },\n score: {\n type: 'number',\n description: 'The model\\'s score of the likelihood that the query expressed about the chunk is supported by the chunk.\\n\\nA score greater than `0.5` indicates that the chunk supports the query, while a score less than `0.5` indicates that the chunk does not support the query.'\n },\n start: {\n type: 'integer',\n description: 'The index of the character in the original text where the chunk starts, beginning from `0`.'\n },\n text: {\n type: 'string',\n description: 'The text of the chunk.'\n }\n },\n required: [ 'end',\n 'index',\n 'score',\n 'start',\n 'text'\n ]\n }\n },\n index: {\n type: 'integer',\n description: 'The index of the text in the input array of texts, starting from `0` (and, therefore, ending at the number of texts minus `1`).'\n },\n score: {\n type: 'number',\n description: 'A score of the likelihood that the query expressed about the text is supported by the text.\\n\\nA score greater than `0.5` indicates that the text supports the query, while a score less than `0.5` indicates that the text does not support the query.'\n }\n },\n required: [ 'chunks',\n 'index',\n 'score'\n ]\n }\n },\n usage: {\n type: 'object',\n title: 'Universal classification usage',\n description: 'Statistics about the usage of resources in the process of classifying the text.',\n properties: {\n input_tokens: {\n type: 'integer',\n description: 'The number of tokens inputted to the model.'\n }\n },\n required: [ 'input_tokens'\n ]\n }\n },\n required: [ 'classifications',\n 'usage'\n ]\n }\n }\n}\n```",
2222
inputSchema: {
2323
type: 'object',
2424
properties: {

packages/mcp-server/src/tools/embeddings/create-embeddings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
1818
export const tool: Tool = {
1919
name: 'create_embeddings',
2020
description:
21-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nEmbed legal texts with an Isaacus legal AI embedder.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/embedding',\n $defs: {\n embedding: {\n type: 'object',\n title: 'Embedding response',\n description: 'Embeddings of legal texts produced by an Isaacus legal AI embedder.',\n properties: {\n embeddings: {\n type: 'array',\n description: 'The embeddings of the inputs.',\n items: {\n type: 'object',\n title: 'Content embedding',\n properties: {\n embedding: {\n type: 'array',\n description: 'The embedding of the content represented as an array of floating point numbers.',\n items: {\n type: 'number'\n }\n },\n index: {\n type: 'integer',\n description: 'The position of the content in the input array of contents, starting from `0` (and, therefore, ending at the number of contents minus `1`).'\n }\n },\n required: [ 'embedding',\n 'index'\n ]\n }\n },\n usage: {\n type: 'object',\n title: 'Embedding usage',\n description: 'Statistics about the usage of resources in the process of embedding the inputs.',\n properties: {\n input_tokens: {\n type: 'integer',\n description: 'The number of tokens inputted to the model.'\n }\n },\n required: [ 'input_tokens'\n ]\n }\n },\n required: [ 'embeddings',\n 'usage'\n ]\n }\n }\n}\n```",
21+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nEmbed legal texts with an Isaacus legal AI embedder.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/embedding_response',\n $defs: {\n embedding_response: {\n type: 'object',\n title: 'Embedding response',\n description: 'Embeddings of legal texts produced by an Isaacus legal AI embedder.',\n properties: {\n embeddings: {\n type: 'array',\n description: 'The embeddings of the inputs.',\n items: {\n type: 'object',\n title: 'Content embedding',\n properties: {\n embedding: {\n type: 'array',\n description: 'The embedding of the content represented as an array of floating point numbers.',\n items: {\n type: 'number'\n }\n },\n index: {\n type: 'integer',\n description: 'The position of the content in the input array of contents, starting from `0` (and, therefore, ending at the number of contents minus `1`).'\n }\n },\n required: [ 'embedding',\n 'index'\n ]\n }\n },\n usage: {\n type: 'object',\n title: 'Embedding usage',\n description: 'Statistics about the usage of resources in the process of embedding the inputs.',\n properties: {\n input_tokens: {\n type: 'integer',\n description: 'The number of tokens inputted to the model.'\n }\n },\n required: [ 'input_tokens'\n ]\n }\n },\n required: [ 'embeddings',\n 'usage'\n ]\n }\n }\n}\n```",
2222
inputSchema: {
2323
type: 'object',
2424
properties: {

0 commit comments

Comments
 (0)