Skip to content

chore: 🐝 Update SDK - Generate 0.25.0 #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025
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
16 changes: 8 additions & 8 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: f42cb8e6-e2ce-4565-b975-5a9f38b94d5a
management:
docChecksum: 3e42d77bf491e4e7a999ec6d27d41fd1
docVersion: 1.1.17
speakeasyVersion: 1.552.0
generationVersion: 2.610.0
releaseVersion: 0.24.4
configChecksum: c0e0d6524bed361c1a8ebeda0e6333df
docChecksum: 251a87fb7643cd585e4ddf956bb1ae1f
docVersion: 1.1.23
speakeasyVersion: 1.555.3
generationVersion: 2.620.2
releaseVersion: 0.25.0
configChecksum: 3cf3f043a49108bf9cbc7c2f2476b151
repoURL: https://github.com/Unstructured-IO/unstructured-js-client.git
repoSubDirectory: .
installationURL: https://github.com/Unstructured-IO/unstructured-js-client
Expand All @@ -16,7 +16,7 @@ features:
acceptHeaders: 2.81.2
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.21.9
core: 3.21.10
defaultEnabledRetries: 0.1.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.2
Expand All @@ -30,7 +30,7 @@ features:
openEnums: 0.1.1
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.2.0
sdkHooks: 0.3.0
serverIDs: 2.81.2
unions: 2.85.8
uploadStreams: 0.1.0
Expand Down
16 changes: 8 additions & 8 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.552.0
speakeasyVersion: 1.555.3
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:11dc672fb20011d88c36c9e88092258b76ffe07dbf7d4d9493a4a8a63de97e0b
sourceBlobDigest: sha256:d70162f1aa06e4b75fdb38608d8ca25948651246e8da161f0947af385732aff3
sourceRevisionDigest: sha256:8eb1828e2c067201a3e864721b453543815bbbb71fb160723bb331bb01e4d9aa
sourceBlobDigest: sha256:614c15b826e255f33812df0a7bb989a7bfb194167fa111162594664c04c2c5f4
tags:
- latest
- speakeasy-sdk-regen-1748046653
- 1.1.17
- speakeasy-sdk-regen-1749083555
- 1.1.23
targets:
unstructed-typescript:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:11dc672fb20011d88c36c9e88092258b76ffe07dbf7d4d9493a4a8a63de97e0b
sourceBlobDigest: sha256:d70162f1aa06e4b75fdb38608d8ca25948651246e8da161f0947af385732aff3
sourceRevisionDigest: sha256:8eb1828e2c067201a3e864721b453543815bbbb71fb160723bb331bb01e4d9aa
sourceBlobDigest: sha256:614c15b826e255f33812df0a7bb989a7bfb194167fa111162594664c04c2c5f4
codeSamplesNamespace: my-source-typescript-code-samples
codeSamplesRevisionDigest: sha256:116507a44839dec1f86e45a1a782df522e4ff29c592635c14f2f5e8196ec91d7
codeSamplesRevisionDigest: sha256:145ca0fb688e7d825c8f66ba00ecfee5a960ce4ad2c9a07c0e7683306d0b92e2
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
30 changes: 7 additions & 23 deletions FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ specific category of applications.
import { openAsBlob } from "node:fs";
import { UnstructuredClientCore } from "unstructured-client/core.js";
import { generalPartition } from "unstructured-client/funcs/generalPartition.js";
import { SDKValidationError } from "unstructured-client/sdk/models/errors/sdkvalidationerror.js";
import { VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
import { Strategy, VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";

// Use `UnstructuredClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
Expand All @@ -38,32 +37,17 @@ async function run() {
1,
10,
],
strategy: Strategy.Auto,
vlmModel: VLMModel.Gpt4o,
vlmModelProvider: VLMModelProvider.Openai,
},
});

switch (true) {
case res.ok:
// The success case will be handled outside of the switch block
break;
case res.error instanceof SDKValidationError:
// Pretty-print validation errors.
return console.log(res.error.pretty());
case res.error instanceof Error:
return console.log(res.error);
default:
// TypeScript's type checking will fail on the following line if the above
// cases were not exhaustive.
res.error satisfies never;
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("generalPartition failed:", res.error);
}


const { value: result } = res;

// Handle the result
console.log(result);
}

run();
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ To change the default retry strategy for a single API call, simply provide a ret
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import {
Strategy,
VLMModel,
VLMModelProvider,
} from "unstructured-client/sdk/models/shared";
Expand All @@ -221,6 +222,7 @@ async function run() {
1,
10,
],
strategy: Strategy.Auto,
vlmModel: VLMModel.Gpt4o,
vlmModelProvider: VLMModelProvider.Openai,
},
Expand All @@ -237,7 +239,6 @@ async function run() {
},
});

// Handle the result
console.log(result);
}

Expand All @@ -250,6 +251,7 @@ If you'd like to override the default retry strategy for all operations that sup
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import {
Strategy,
VLMModel,
VLMModelProvider,
} from "unstructured-client/sdk/models/shared";
Expand All @@ -276,12 +278,12 @@ async function run() {
1,
10,
],
strategy: Strategy.Auto,
vlmModel: VLMModel.Gpt4o,
vlmModelProvider: VLMModelProvider.Openai,
},
});

// Handle the result
console.log(result);
}

Expand Down Expand Up @@ -378,6 +380,7 @@ Certain SDK methods accept files as part of a multi-part request. It is possible
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import {
Strategy,
VLMModel,
VLMModelProvider,
} from "unstructured-client/sdk/models/shared";
Expand All @@ -393,12 +396,12 @@ async function run() {
1,
10,
],
strategy: Strategy.Auto,
vlmModel: VLMModel.Gpt4o,
vlmModelProvider: VLMModelProvider.Openai,
},
});

// Handle the result
console.log(result);
}

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,4 +604,14 @@ Based on:
### Generated
- [typescript v0.24.4] .
### Releases
- [NPM v0.24.4] https://www.npmjs.com/package/unstructured-client/v/0.24.4 - .
- [NPM v0.24.4] https://www.npmjs.com/package/unstructured-client/v/0.24.4 - .

## 2025-06-05 00:32:18
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.555.3 (2.620.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.25.0] .
### Releases
- [NPM v0.25.0] https://www.npmjs.com/package/unstructured-client/v/0.25.0 - .
3 changes: 2 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import {
Strategy,
VLMModel,
VLMModelProvider,
} from "unstructured-client/sdk/models/shared";
Expand All @@ -18,12 +19,12 @@ async function run() {
1,
10,
],
strategy: Strategy.Auto,
vlmModel: VLMModel.Gpt4o,
vlmModelProvider: VLMModelProvider.Openai,
},
});

// Handle the result
console.log(result);
}

Expand Down
2 changes: 1 addition & 1 deletion codeSamples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ actions:
"x-codeSamples":
- "lang": "typescript"
"label": "partition"
"source": "import { openAsBlob } from \"node:fs\";\nimport { UnstructuredClient } from \"unstructured-client\";\nimport { VLMModel, VLMModelProvider } from \"unstructured-client/sdk/models/shared\";\n\nconst unstructuredClient = new UnstructuredClient();\n\nasync function run() {\n const result = await unstructuredClient.general.partition({\n partitionParameters: {\n files: await openAsBlob(\"example.file\"),\n vlmModelProvider: VLMModelProvider.Openai,\n vlmModel: VLMModel.Gpt4o,\n chunkingStrategy: \"by_title\",\n splitPdfPageRange: [\n 1,\n 10,\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
"source": "import { openAsBlob } from \"node:fs\";\nimport { UnstructuredClient } from \"unstructured-client\";\nimport { Strategy, VLMModel, VLMModelProvider } from \"unstructured-client/sdk/models/shared\";\n\nconst unstructuredClient = new UnstructuredClient();\n\nasync function run() {\n const result = await unstructuredClient.general.partition({\n partitionParameters: {\n files: await openAsBlob(\"example.file\"),\n strategy: Strategy.Auto,\n vlmModelProvider: VLMModelProvider.Openai,\n vlmModel: VLMModel.Gpt4o,\n chunkingStrategy: \"by_title\",\n splitPdfPageRange: [\n 1,\n 10,\n ],\n },\n });\n\n console.log(result);\n}\n\nrun();"
2 changes: 1 addition & 1 deletion docs/sdk/models/errors/detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const value: shared.ValidationError[] = [
{
loc: [
569227,
"<value>",
],
msg: "<value>",
type: "<value>",
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/models/shared/strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto.
```typescript
import { Strategy } from "unstructured-client/sdk/models/shared";

let value: Strategy = Strategy.Vlm;
let value: Strategy = Strategy.Auto;
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/models/shared/validationerror.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ValidationError } from "unstructured-client/sdk/models/shared";

let value: ValidationError = {
loc: [
598752,
929957,
],
msg: "<value>",
type: "<value>",
Expand Down
20 changes: 9 additions & 11 deletions docs/sdks/general/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Description
```typescript
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import { VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
import { Strategy, VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";

const unstructuredClient = new UnstructuredClient();

Expand All @@ -29,12 +29,12 @@ async function run() {
1,
10,
],
strategy: Strategy.Auto,
vlmModel: VLMModel.Gpt4o,
vlmModelProvider: VLMModelProvider.Openai,
},
});

// Handle the result
console.log(result);
}

Expand All @@ -49,7 +49,7 @@ The standalone function version of this method:
import { openAsBlob } from "node:fs";
import { UnstructuredClientCore } from "unstructured-client/core.js";
import { generalPartition } from "unstructured-client/funcs/generalPartition.js";
import { VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
import { Strategy, VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";

// Use `UnstructuredClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
Expand All @@ -64,19 +64,17 @@ async function run() {
1,
10,
],
strategy: Strategy.Auto,
vlmModel: VLMModel.Gpt4o,
vlmModelProvider: VLMModelProvider.Openai,
},
});

if (!res.ok) {
throw res.error;
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("generalPartition failed:", res.error);
}

const { value: result } = res;

// Handle the result
console.log(result);
}

run();
Expand Down
3 changes: 2 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ generation:
sdkClassName: unstructured_client
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
fixes:
nameResolutionFeb2025: false
parameterOrderingFeb2024: false
Expand All @@ -13,7 +14,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 0.24.4
version: 0.25.0
additionalDependencies:
dependencies:
async: ^3.2.5
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "unstructured-client",
"version": "0.24.4",
"version": "0.25.0",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unstructured-client",
"version": "0.24.4",
"version": "0.25.0",
"author": "Unstructured",
"type": "module",
"bin": {
Expand Down
2 changes: 2 additions & 0 deletions src/funcs/generalPartition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ async function $do(
const requestSecurity = resolveGlobalSecurity(securityInput);

const context = {
options: client._options,
baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "partition",
oAuth2Scopes: [],
Expand Down Expand Up @@ -387,6 +388,7 @@ async function $do(
path: path,
headers: headers,
body: body,
userAgent: client._options.userAgent,
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/

import { SDKOptions } from "../lib/config.js";
import { HTTPClient, RequestInput } from "../lib/http.js";
import { RetryConfig } from "../lib/retries.js";
import { SecurityState } from "../lib/security.js";
Expand All @@ -13,6 +14,7 @@ export type HookContext = {
securitySource?: any | (() => Promise<any>);
retryConfig: RetryConfig;
resolvedSecurity: SecurityState | null;
options: SDKOptions;
};

export type Awaitable<T> = T | Promise<T>;
Expand Down
Loading