# sema-unstructured 0.1.0 — API reference

Source declarations extracted without executing package code. Signatures describe declarations, not inferred runtime behavior.

## unstructured/client

```sema
(unstructured/client . opts)
```

Build an Unstructured client map. Options: :api-key (default: UNSTRUCTURED_API_KEY env var), :base-url (default "https://api.unstructuredapp.io"), :timeout in ms (default 120000). Errors if no API key is found.

[Source line 48](https://pkg.sema-lang.com/packages/sema-unstructured/0.1.0/source/package.sema#L48)

## unstructured/partition

```sema
(unstructured/partition client source . opts)
```

Partition a document into element maps via POST /general/v0/general. source is either a file path string or a {:bytes &lt;bytevector&gt; :filename "name.ext"} map (bytes are uploaded verbatim). Options map: :strategy (e.g. "auto", "hi_res", "fast", "ocr_only", "vlm"; omitted → API default), :chunking-strategy (e.g. "by_title", "basic"; omitted → no chunking), :params (map of any other form fields, keyword or string keys, e.g. {:languages "eng" :coordinates #t}). Returns a list of element maps ({:type .. :element_id .. :text .. :metadata ..}).

[Source line 138](https://pkg.sema-lang.com/packages/sema-unstructured/0.1.0/source/package.sema#L138)

## unstructured/request

```sema
(unstructured/request client method path opts)
```

Make a raw Unstructured API request; the escape hatch every wrapper uses. method is "GET"/"POST"/..., path an API path ("/general/v0/general") or full URL. opts is a map: :multipart (list of {:name .. :content &lt;string|bytevector&gt; :filename ..?} parts) for form uploads, :body (map → JSON body) otherwise. Returns the decoded JSON body (nil when empty); raises on non-2xx with method, path, status, and the API message.

[Source line 88](https://pkg.sema-lang.com/packages/sema-unstructured/0.1.0/source/package.sema#L88)

## unstructured/text-of

```sema
(unstructured/text-of elements)
```

Join the :text of a partition element list into a single newline-separated string. Elements missing :text contribute nothing. Accepts nil or an empty list (→ "").

[Source line 149](https://pkg.sema-lang.com/packages/sema-unstructured/0.1.0/source/package.sema#L149)

---

Parser: sema-reader 1.37.0

Archive SHA-256: `edec2c43759bb1ad13f5622f727d05740387850cf5a99b5bf4151397793e30b7`
