|
2 | 2 | title: Unstructured
|
3 | 3 | sidebarTitle: Welcome
|
4 | 4 | mode: wide
|
5 |
| -description: "`Unstructured` offers tools designed to help preprocess unstructured documents for use in downstream machine learning tasks. This documentation covers three product lines: Unstructured API, Unstructured Enterprise Platform, and the Unstructured Open Source Library." |
| 5 | +description: "**Unstructured** provides tools to ingest and preprocess unstructured documents for `Retrieval Augmented Generation (RAG)` and `Fine Tuning`." |
6 | 6 | ---
|
7 | 7 |
|
8 |
| -<CardGroup cols={2}> |
9 |
| - <Card |
10 |
| - title="Unstructured API Services" |
11 |
| - icon="square-terminal" |
12 |
| - href="/api-reference/api-services/overview" |
13 |
| - iconType="duotone" |
14 |
| - > |
15 |
| - Access all the power of `unstructured` through the `unstructured-api` or learn to host it locally. |
16 |
| - </Card> |
17 |
| - <Card |
18 |
| - title="Unstructured Platform" |
19 |
| - icon="browser" |
20 |
| - href="/platform/overview" |
21 |
| - iconType="duotone" |
22 |
| - > |
23 |
| - Explore the enterprise-grade platform for enterprises and high-growth companies with large data volume looking to automatically retrieve, transform, and stage their data for LLMs. |
24 |
| - </Card> |
25 |
| - <Card |
26 |
| - title="Unstructured Open Source Library" |
27 |
| - icon="hammer" |
28 |
| - href="/open-source/introduction/overview" |
29 |
| - iconType="duotone" |
30 |
| - > |
31 |
| - Learn more about the partitioning, chunking, cleaning, and staging functionality available within the Unstructured library. |
32 |
| - </Card> |
33 |
| -</CardGroup> |
| 8 | +We offer **3 products**: |
| 9 | + |
| 10 | +1. [API](/api-reference/api-services/overview "API") - The quickest way to get started for document transformation. |
| 11 | +2. [Open Source](/open-source/introduction/overview/ "OSS") - Best for prototyping. |
| 12 | +3. [Enterprise Platform](/platform/overview "Platform") - Entirely no code platform for end-to-end RAG. |
| 13 | + |
| 14 | + |
| 15 | +## TLDR |
| 16 | + |
| 17 | +If you're here just to process docs, here's the too long didn't read version: |
| 18 | + |
| 19 | + |
| 20 | +1. **Get an API Key** and **Server URL** by signing up to the [SaaS Unstructured API](https://unstructured.io/api-key-hosted) page on our website. |
| 21 | +2. Copy and run this code to **install** the Unstructured Python/JavaScript API SDK. |
| 22 | +<CodeGroup> |
| 23 | + |
| 24 | +```bash Python |
| 25 | +pip install unstructured-client |
| 26 | +``` |
| 27 | + |
| 28 | +```bash JavaScript |
| 29 | +npm install unstructured-client |
| 30 | +``` |
| 31 | +</CodeGroup> |
| 32 | +3. Copy and run this code, replacing `api_key_auth`, `server_url`, and `filename` with actual values. |
| 33 | + |
| 34 | +<CodeGroup> |
| 35 | + |
| 36 | +```python Python |
| 37 | +from unstructured_client import UnstructuredClient |
| 38 | +from unstructured_client.models import shared |
| 39 | +from unstructured_client.models.errors import SDKError |
| 40 | + |
| 41 | +client = UnstructuredClient( |
| 42 | + api_key_auth="YOUR_API_KEY", |
| 43 | + server_url="YOUR_API_URL", |
| 44 | +) |
| 45 | + |
| 46 | +filename = "sample-docs/family-day.eml" |
| 47 | + |
| 48 | +with open(filename, "rb") as f: |
| 49 | + files=shared.Files( |
| 50 | + content=f.read(), |
| 51 | + file_name=filename, |
| 52 | + ) |
| 53 | + |
| 54 | +req = shared.PartitionParameters(files=files) |
| 55 | + |
| 56 | +try: |
| 57 | + resp = client.general.partition(req) |
| 58 | + print(resp.elements) |
| 59 | +except SDKError as e: |
| 60 | + print(e) |
| 61 | +``` |
| 62 | + |
| 63 | +```javascript JavaScript |
| 64 | +import { UnstructuredClient } from "unstructured-client"; |
| 65 | +import { PartitionResponse } from "unstructured-client/dist/sdk/models/operations"; |
| 66 | +import * as fs from "fs"; |
| 67 | + |
| 68 | +const key = "YOUR-API-KEY"; |
| 69 | + |
| 70 | +const client = new UnstructuredClient({ |
| 71 | + serverURL: "YOUR_API_URL", |
| 72 | + security: { |
| 73 | + apiKeyAuth: key, |
| 74 | + }, |
| 75 | +}); |
| 76 | + |
| 77 | +const filename = "sample-docs/ragtest.pdf"; |
| 78 | +const data = fs.readFileSync(filename); |
| 79 | + |
| 80 | +client.general.partition({ |
| 81 | + files: { |
| 82 | + content: data, |
| 83 | + fileName: filename, |
| 84 | + }, |
| 85 | +}).then((res: PartitionResponse) => { |
| 86 | + if (res.statusCode == 200) { |
| 87 | + console.log(res.elements); |
| 88 | + } |
| 89 | +}).catch((e) => { |
| 90 | + console.log(e.statusCode); |
| 91 | + console.log(e.body); |
| 92 | +}); |
| 93 | +``` |
| 94 | +</CodeGroup> |
| 95 | + |
| 96 | +4. **Done!** If you'd like a deeper dive on the API, see the details [API Documentation](/api-reference/api-services/overview "API"). |
| 97 | + |
34 | 98 |
|
35 | 99 | ## Get in touch
|
36 | 100 |
|
|
0 commit comments