/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import dotenv from "dotenv"; dotenv.config(); /** * Example usage of the unstructured-client SDK * * To run this example from the examples directory: * npm run build && npx tsx generalPartition.example.ts */ import { openAsBlob } from "node:fs"; import { UnstructuredClient } from "unstructured-client"; import { Strategy, VLMModelProvider, } from "unstructured-client/sdk/models/shared"; const unstructuredClient = new UnstructuredClient(); async function main() { const result = await unstructuredClient.general.partition({ partitionParameters: { chunkingStrategy: "by_title", files: await openAsBlob("example.file"), splitPdfPageRange: [ 1, 10, ], strategy: Strategy.Auto, vlmModel: "gpt-4o", vlmModelProvider: VLMModelProvider.Openai, }, }); console.log(result); } main().catch(console.error);