Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 22
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-82683f2fd5f8778a27960ebabda40d6dc4640bdfb77ac4ec7f173b8bf8076d3c.yml
2 changes: 0 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ Types:

- <code><a href="./src/resources/tools/tools.ts">ToolContextAwareSplittingResponse</a></code>
- <code><a href="./src/resources/tools/tools.ts">ToolParsePdfResponse</a></code>
- <code><a href="./src/resources/tools/tools.ts">ToolTextToGraphResponse</a></code>

Methods:

- <code title="post /v1/tools/context-aware-splitting">client.tools.<a href="./src/resources/tools/tools.ts">contextAwareSplitting</a>({ ...params }) -> ToolContextAwareSplittingResponse</code>
- <code title="post /v1/tools/pdf-parser/{file_id}">client.tools.<a href="./src/resources/tools/tools.ts">parsePdf</a>(fileId, { ...params }) -> ToolParsePdfResponse</code>
- <code title="post /v1/tools/text-to-graph">client.tools.<a href="./src/resources/tools/tools.ts">textToGraph</a>({ ...params }) -> ToolTextToGraphResponse</code>

## Comprehend

Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ import {
ToolContextAwareSplittingResponse,
ToolParsePdfParams,
ToolParsePdfResponse,
ToolTextToGraphParams,
ToolTextToGraphResponse,
Tools,
} from './resources/tools/tools';

Expand Down Expand Up @@ -299,10 +297,8 @@ export declare namespace Writer {
Tools as Tools,
type ToolContextAwareSplittingResponse as ToolContextAwareSplittingResponse,
type ToolParsePdfResponse as ToolParsePdfResponse,
type ToolTextToGraphResponse as ToolTextToGraphResponse,
type ToolContextAwareSplittingParams as ToolContextAwareSplittingParams,
type ToolParsePdfParams as ToolParsePdfParams,
type ToolTextToGraphParams as ToolTextToGraphParams,
};
}

Expand Down
2 changes: 0 additions & 2 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export {
Tools,
type ToolContextAwareSplittingResponse,
type ToolParsePdfResponse,
type ToolTextToGraphResponse,
type ToolContextAwareSplittingParams,
type ToolParsePdfParams,
type ToolTextToGraphParams,
} from './tools/tools';
2 changes: 0 additions & 2 deletions src/resources/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export {
Tools,
type ToolContextAwareSplittingResponse,
type ToolParsePdfResponse,
type ToolTextToGraphResponse,
type ToolContextAwareSplittingParams,
type ToolParsePdfParams,
type ToolTextToGraphParams,
} from './tools';
28 changes: 0 additions & 28 deletions src/resources/tools/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ export class Tools extends APIResource {
): Core.APIPromise<ToolParsePdfResponse> {
return this._client.post(`/v1/tools/pdf-parser/${fileId}`, { body, ...options });
}

/**
* Performs name entity recognition on the supplied text accepting a maximum of
* 35000 words.
*/
textToGraph(
body: ToolTextToGraphParams,
options?: Core.RequestOptions,
): Core.APIPromise<ToolTextToGraphResponse> {
return this._client.post('/v1/tools/text-to-graph', { body, ...options });
}
}

export interface ToolContextAwareSplittingResponse {
Expand All @@ -57,14 +46,6 @@ export interface ToolParsePdfResponse {
content: string;
}

export interface ToolTextToGraphResponse {
/**
* The graph structure generated from the input text, represented by a string array
* of entities and relationships.
*/
graph: Array<Array<string>>;
}

export interface ToolContextAwareSplittingParams {
/**
* The strategy to be used for splitting the text into chunks. `llm_split` uses the
Expand All @@ -86,23 +67,14 @@ export interface ToolParsePdfParams {
format: 'text' | 'markdown';
}

export interface ToolTextToGraphParams {
/**
* The text to be converted into a graph structure. Maximum of 35000 words.
*/
text: string;
}

Tools.Comprehend = Comprehend;

export declare namespace Tools {
export {
type ToolContextAwareSplittingResponse as ToolContextAwareSplittingResponse,
type ToolParsePdfResponse as ToolParsePdfResponse,
type ToolTextToGraphResponse as ToolTextToGraphResponse,
type ToolContextAwareSplittingParams as ToolContextAwareSplittingParams,
type ToolParsePdfParams as ToolParsePdfParams,
type ToolTextToGraphParams as ToolTextToGraphParams,
};

export {
Expand Down
15 changes: 0 additions & 15 deletions tests/api-resources/tools/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,4 @@ describe('resource tools', () => {
test('parsePdf: required and optional params', async () => {
const response = await client.tools.parsePdf('file_id', { format: 'text' });
});

test('textToGraph: only required params', async () => {
const responsePromise = client.tools.textToGraph({ text: 'text' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

test('textToGraph: required and optional params', async () => {
const response = await client.tools.textToGraph({ text: 'text' });
});
});