@xberg-io/opencode-xberg 1.3.11 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/ai-rulez-content.js +1 -1
- package/.opencode/commands/xberg-extract.md +1 -1
- package/.opencode/commands/xberg-ocr.md +1 -1
- package/.opencode/plugins/xberg.js +1 -1
- package/.opencode/skills/xberg/SKILL.md +6 -6
- package/.opencode/skills/xberg/index.md +3 -3
- package/.opencode/skills/xberg/references/advanced-features.md +1 -1
- package/.opencode/skills/xberg/references/cli-reference.md +5 -3
- package/.opencode/skills/xberg/references/configuration.md +4 -4
- package/.opencode/skills/xberg/references/nodejs-api.md +1 -1
- package/.opencode/skills/xberg/references/other-bindings.md +1 -1
- package/.opencode/skills/xberg/references/python-api.md +5 -5
- package/.opencode/skills/xberg/references/rust-api.md +1 -1
- package/.opencode/skills/xberg/references/supported-formats.md +1 -1
- package/.opencode/skills/xberg-batch-extraction/SKILL.md +1 -1
- package/.opencode/skills/xberg-batch-extraction/index.md +3 -3
- package/.opencode/skills/xberg-batch-extraction/references/advanced-features.md +1 -1
- package/.opencode/skills/xberg-batch-extraction/references/cli-reference.md +5 -3
- package/.opencode/skills/xberg-batch-extraction/references/configuration.md +4 -4
- package/.opencode/skills/xberg-batch-extraction/references/nodejs-api.md +1 -1
- package/.opencode/skills/xberg-batch-extraction/references/other-bindings.md +1 -1
- package/.opencode/skills/xberg-batch-extraction/references/python-api.md +5 -5
- package/.opencode/skills/xberg-batch-extraction/references/rust-api.md +1 -1
- package/.opencode/skills/xberg-batch-extraction/references/supported-formats.md +1 -1
- package/.opencode/skills/xberg-chunking/SKILL.md +1 -1
- package/.opencode/skills/xberg-chunking/index.md +3 -3
- package/.opencode/skills/xberg-chunking/references/advanced-features.md +1 -1
- package/.opencode/skills/xberg-chunking/references/cli-reference.md +5 -3
- package/.opencode/skills/xberg-chunking/references/configuration.md +4 -4
- package/.opencode/skills/xberg-chunking/references/nodejs-api.md +1 -1
- package/.opencode/skills/xberg-chunking/references/other-bindings.md +1 -1
- package/.opencode/skills/xberg-chunking/references/python-api.md +5 -5
- package/.opencode/skills/xberg-chunking/references/rust-api.md +1 -1
- package/.opencode/skills/xberg-chunking/references/supported-formats.md +1 -1
- package/.opencode/skills/xberg-extracting-keywords/SKILL.md +1 -1
- package/.opencode/skills/xberg-extracting-keywords/index.md +3 -3
- package/.opencode/skills/xberg-extracting-keywords/references/advanced-features.md +1 -1
- package/.opencode/skills/xberg-extracting-keywords/references/cli-reference.md +5 -3
- package/.opencode/skills/xberg-extracting-keywords/references/configuration.md +4 -4
- package/.opencode/skills/xberg-extracting-keywords/references/nodejs-api.md +1 -1
- package/.opencode/skills/xberg-extracting-keywords/references/other-bindings.md +1 -1
- package/.opencode/skills/xberg-extracting-keywords/references/python-api.md +5 -5
- package/.opencode/skills/xberg-extracting-keywords/references/rust-api.md +1 -1
- package/.opencode/skills/xberg-extracting-keywords/references/supported-formats.md +1 -1
- package/.opencode/skills/xberg-extracting-tables/SKILL.md +1 -1
- package/.opencode/skills/xberg-extracting-tables/index.md +3 -3
- package/.opencode/skills/xberg-extracting-tables/references/advanced-features.md +1 -1
- package/.opencode/skills/xberg-extracting-tables/references/cli-reference.md +5 -3
- package/.opencode/skills/xberg-extracting-tables/references/configuration.md +4 -4
- package/.opencode/skills/xberg-extracting-tables/references/nodejs-api.md +1 -1
- package/.opencode/skills/xberg-extracting-tables/references/other-bindings.md +1 -1
- package/.opencode/skills/xberg-extracting-tables/references/python-api.md +5 -5
- package/.opencode/skills/xberg-extracting-tables/references/rust-api.md +1 -1
- package/.opencode/skills/xberg-extracting-tables/references/supported-formats.md +1 -1
- package/.opencode/skills/xberg-extracting-with-ocr/SKILL.md +1 -1
- package/.opencode/skills/xberg-extracting-with-ocr/index.md +3 -3
- package/.opencode/skills/xberg-extracting-with-ocr/references/advanced-features.md +1 -1
- package/.opencode/skills/xberg-extracting-with-ocr/references/cli-reference.md +5 -3
- package/.opencode/skills/xberg-extracting-with-ocr/references/configuration.md +4 -4
- package/.opencode/skills/xberg-extracting-with-ocr/references/nodejs-api.md +1 -1
- package/.opencode/skills/xberg-extracting-with-ocr/references/other-bindings.md +1 -1
- package/.opencode/skills/xberg-extracting-with-ocr/references/python-api.md +5 -5
- package/.opencode/skills/xberg-extracting-with-ocr/references/rust-api.md +1 -1
- package/.opencode/skills/xberg-extracting-with-ocr/references/supported-formats.md +1 -1
- package/.opencode/skills/xberg-picking-a-format/SKILL.md +1 -1
- package/.opencode/skills/xberg-picking-a-format/index.md +3 -3
- package/.opencode/skills/xberg-picking-a-format/references/advanced-features.md +1 -1
- package/.opencode/skills/xberg-picking-a-format/references/cli-reference.md +5 -3
- package/.opencode/skills/xberg-picking-a-format/references/configuration.md +4 -4
- package/.opencode/skills/xberg-picking-a-format/references/nodejs-api.md +1 -1
- package/.opencode/skills/xberg-picking-a-format/references/other-bindings.md +1 -1
- package/.opencode/skills/xberg-picking-a-format/references/python-api.md +5 -5
- package/.opencode/skills/xberg-picking-a-format/references/rust-api.md +1 -1
- package/.opencode/skills/xberg-picking-a-format/references/supported-formats.md +1 -1
- package/.pi/prompts/xberg-extract.md +1 -1
- package/.pi/prompts/xberg-ocr.md +1 -1
- package/.pi/skills/xberg/SKILL.md +6 -6
- package/.pi/skills/xberg/index.md +3 -3
- package/.pi/skills/xberg/references/advanced-features.md +1 -1
- package/.pi/skills/xberg/references/cli-reference.md +5 -3
- package/.pi/skills/xberg/references/configuration.md +4 -4
- package/.pi/skills/xberg/references/nodejs-api.md +1 -1
- package/.pi/skills/xberg/references/other-bindings.md +1 -1
- package/.pi/skills/xberg/references/python-api.md +5 -5
- package/.pi/skills/xberg/references/rust-api.md +1 -1
- package/.pi/skills/xberg/references/supported-formats.md +1 -1
- package/.pi/skills/xberg-batch-extraction/SKILL.md +1 -1
- package/.pi/skills/xberg-batch-extraction/index.md +3 -3
- package/.pi/skills/xberg-batch-extraction/references/advanced-features.md +1 -1
- package/.pi/skills/xberg-batch-extraction/references/cli-reference.md +5 -3
- package/.pi/skills/xberg-batch-extraction/references/configuration.md +4 -4
- package/.pi/skills/xberg-batch-extraction/references/nodejs-api.md +1 -1
- package/.pi/skills/xberg-batch-extraction/references/other-bindings.md +1 -1
- package/.pi/skills/xberg-batch-extraction/references/python-api.md +5 -5
- package/.pi/skills/xberg-batch-extraction/references/rust-api.md +1 -1
- package/.pi/skills/xberg-batch-extraction/references/supported-formats.md +1 -1
- package/.pi/skills/xberg-chunking/SKILL.md +1 -1
- package/.pi/skills/xberg-chunking/index.md +3 -3
- package/.pi/skills/xberg-chunking/references/advanced-features.md +1 -1
- package/.pi/skills/xberg-chunking/references/cli-reference.md +5 -3
- package/.pi/skills/xberg-chunking/references/configuration.md +4 -4
- package/.pi/skills/xberg-chunking/references/nodejs-api.md +1 -1
- package/.pi/skills/xberg-chunking/references/other-bindings.md +1 -1
- package/.pi/skills/xberg-chunking/references/python-api.md +5 -5
- package/.pi/skills/xberg-chunking/references/rust-api.md +1 -1
- package/.pi/skills/xberg-chunking/references/supported-formats.md +1 -1
- package/.pi/skills/xberg-extracting-keywords/SKILL.md +1 -1
- package/.pi/skills/xberg-extracting-keywords/index.md +3 -3
- package/.pi/skills/xberg-extracting-keywords/references/advanced-features.md +1 -1
- package/.pi/skills/xberg-extracting-keywords/references/cli-reference.md +5 -3
- package/.pi/skills/xberg-extracting-keywords/references/configuration.md +4 -4
- package/.pi/skills/xberg-extracting-keywords/references/nodejs-api.md +1 -1
- package/.pi/skills/xberg-extracting-keywords/references/other-bindings.md +1 -1
- package/.pi/skills/xberg-extracting-keywords/references/python-api.md +5 -5
- package/.pi/skills/xberg-extracting-keywords/references/rust-api.md +1 -1
- package/.pi/skills/xberg-extracting-keywords/references/supported-formats.md +1 -1
- package/.pi/skills/xberg-extracting-tables/SKILL.md +1 -1
- package/.pi/skills/xberg-extracting-tables/index.md +3 -3
- package/.pi/skills/xberg-extracting-tables/references/advanced-features.md +1 -1
- package/.pi/skills/xberg-extracting-tables/references/cli-reference.md +5 -3
- package/.pi/skills/xberg-extracting-tables/references/configuration.md +4 -4
- package/.pi/skills/xberg-extracting-tables/references/nodejs-api.md +1 -1
- package/.pi/skills/xberg-extracting-tables/references/other-bindings.md +1 -1
- package/.pi/skills/xberg-extracting-tables/references/python-api.md +5 -5
- package/.pi/skills/xberg-extracting-tables/references/rust-api.md +1 -1
- package/.pi/skills/xberg-extracting-tables/references/supported-formats.md +1 -1
- package/.pi/skills/xberg-extracting-with-ocr/SKILL.md +1 -1
- package/.pi/skills/xberg-extracting-with-ocr/index.md +3 -3
- package/.pi/skills/xberg-extracting-with-ocr/references/advanced-features.md +1 -1
- package/.pi/skills/xberg-extracting-with-ocr/references/cli-reference.md +5 -3
- package/.pi/skills/xberg-extracting-with-ocr/references/configuration.md +4 -4
- package/.pi/skills/xberg-extracting-with-ocr/references/nodejs-api.md +1 -1
- package/.pi/skills/xberg-extracting-with-ocr/references/other-bindings.md +1 -1
- package/.pi/skills/xberg-extracting-with-ocr/references/python-api.md +5 -5
- package/.pi/skills/xberg-extracting-with-ocr/references/rust-api.md +1 -1
- package/.pi/skills/xberg-extracting-with-ocr/references/supported-formats.md +1 -1
- package/.pi/skills/xberg-picking-a-format/SKILL.md +1 -1
- package/.pi/skills/xberg-picking-a-format/index.md +3 -3
- package/.pi/skills/xberg-picking-a-format/references/advanced-features.md +1 -1
- package/.pi/skills/xberg-picking-a-format/references/cli-reference.md +5 -3
- package/.pi/skills/xberg-picking-a-format/references/configuration.md +4 -4
- package/.pi/skills/xberg-picking-a-format/references/nodejs-api.md +1 -1
- package/.pi/skills/xberg-picking-a-format/references/other-bindings.md +1 -1
- package/.pi/skills/xberg-picking-a-format/references/python-api.md +5 -5
- package/.pi/skills/xberg-picking-a-format/references/rust-api.md +1 -1
- package/.pi/skills/xberg-picking-a-format/references/supported-formats.md +1 -1
- package/README.md +9 -9
- package/assets/icon.svg +16 -9
- package/assets/logo.png +0 -0
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
2
2
|
// Content-Hash: blake3:011ec20caa671eb4bd4e886b09e15f720a786de4bf747419efd0690889fc5549
|
|
3
|
-
// Source-Hash: blake3:
|
|
3
|
+
// Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
4
4
|
// Schema-Version: v1
|
|
5
5
|
|
|
6
6
|
// Generated by ai-rulez. Registers the skills, commands, agents, and MCP servers bundled with
|
|
@@ -5,7 +5,7 @@ description: Extract a document locally with Xberg
|
|
|
5
5
|
<!--
|
|
6
6
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
7
7
|
Content-Hash: blake3:3d695d0525269a1935328e6568418a562cac9ba7a64c6e8121d5136dc93b36e3
|
|
8
|
-
Source-Hash: blake3:
|
|
8
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
9
9
|
Schema-Version: v1
|
|
10
10
|
-->
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ description: Extract scanned documents with OCR
|
|
|
5
5
|
<!--
|
|
6
6
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
7
7
|
Content-Hash: blake3:1715ebd3d000212eb2e4dbfa814d6d5990bcc0c636bae67734a503f2c3ae8be4
|
|
8
|
-
Source-Hash: blake3:
|
|
8
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
9
9
|
Schema-Version: v1
|
|
10
10
|
-->
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
2
2
|
// Content-Hash: blake3:3fe1a33d721dfa8b49134cbe88659999cf9e481c558eb8e4b5ac81bc672c88db
|
|
3
|
-
// Source-Hash: blake3:
|
|
3
|
+
// Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
4
4
|
// Schema-Version: v1
|
|
5
5
|
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -10,8 +10,8 @@ name: xberg
|
|
|
10
10
|
|
|
11
11
|
<!--
|
|
12
12
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
13
|
-
Content-Hash: blake3:
|
|
14
|
-
Source-Hash: blake3:
|
|
13
|
+
Content-Hash: blake3:bdb659ec3959943d7e4b8da0cc3b8fbe51dc3bfec07e27dbbd8f84e190a63e1a
|
|
14
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
15
15
|
Schema-Version: v1
|
|
16
16
|
-->
|
|
17
17
|
|
|
@@ -314,16 +314,16 @@ config = ExtractionConfig(force_ocr=True) # OCR even if text is extractable
|
|
|
314
314
|
|
|
315
315
|
### Python
|
|
316
316
|
|
|
317
|
-
`extract` / `extract_batch` raise
|
|
317
|
+
`extract` / `extract_batch` raise an exported `XbergError` subclass, such as `ParsingError`, `SecurityError`, or `ValidationError`, including calls with `on_progress`. Catch `XbergError` for extraction failures. Per-input failures during `extract_batch` are reported non-fatally in `result.errors`.
|
|
318
318
|
|
|
319
319
|
```python
|
|
320
|
-
from xberg import ExtractInput, extract, ExtractionConfig
|
|
320
|
+
from xberg import ExtractInput, extract, ExtractionConfig, XbergError
|
|
321
321
|
|
|
322
322
|
try:
|
|
323
323
|
result = await extract(ExtractInput(uri="file.pdf"), ExtractionConfig())
|
|
324
324
|
for err in result.errors:
|
|
325
325
|
print(f"Per-input error: {err}")
|
|
326
|
-
except
|
|
326
|
+
except XbergError as e:
|
|
327
327
|
print(f"Extraction failed: {e}")
|
|
328
328
|
```
|
|
329
329
|
|
|
@@ -367,7 +367,7 @@ match extract(ExtractInput::from_uri("file.pdf"), &config).await {
|
|
|
367
367
|
2. **Async-only**: Python and Node have no sync variants — always `await extract(...)`. Rust `extract` is async; use `#[tokio::main]` or an async context.
|
|
368
368
|
3. **Build the input**: pass an `ExtractInput`, not a bare path. Use `ExtractInput(uri=...)` / `ExtractInput::from_uri(...)` (Python/Rust) or `{ kind: "uri", uri: "..." }` (Node); for bytes use `kind="bytes"` with `bytes`/`mime_type`.
|
|
369
369
|
4. **Python ChunkingConfig fields**: construct with `max_characters` and `overlap` (defaults 1000 / 200); these are also the readable attributes. When passing config as a dict/JSON, the `max_chars` / `max_overlap` aliases are also accepted. Node uses `maxCharacters` / `overlap`; Rust struct fields are `max_characters` / `overlap`.
|
|
370
|
-
5. **Python errors**:
|
|
370
|
+
5. **Python errors**: catch `XbergError` or a specific exported subclass for `extract` / `extract_batch` failures, including calls with `on_progress`. Node throws plain `Error` (no typed error subclasses).
|
|
371
371
|
6. **Rust extract signature**: `extract(input, &config)` — the config is a reference. Use `&ExtractionConfig::default()` for defaults.
|
|
372
372
|
7. **CLI --format vs --content-format**: `--format` controls CLI output (`text`, `json`, or `toon`). `--content-format` controls content rendering (`plain`, `markdown`, `djot`, `html`, `json`, or `doctags`).
|
|
373
373
|
8. **Config file field names**: Use snake_case in TOML/YAML/JSON config files — `[chunking]` fields are `max_characters` and `overlap`; other fields use names like `output_format`, `pdf_options`.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:03f23e46ea452f0a341ed6552d505e85c4d31333aea0862be9ff0774b399c82d
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
8
|
# Concepts
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- [Xberg](SKILL.md) - Extract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using Xberg. Use when writing code that calls Xberg APIs in Python, Node.js/TypeScript, Rust, or CLI. Covers installation, extraction (sync/async), configuration (OCR, chunking, output format), batch processing, error handling, and plugins.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:353a7a05cbe84a2af1d053c8173d2154f418972a2bbfc2846dbb2c17a8a46197
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:70bcb43e649e885bb822d41efb7221b365fd6f1870d1e6a5bb4ab3ec10be6acc
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -11,11 +11,13 @@ Comprehensive command-line interface for the Xberg document intelligence library
|
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
|
+
The pinned command below follows this source release (1.4.0); use it once that release is published.
|
|
15
|
+
|
|
14
16
|
```bash
|
|
15
17
|
brew install xberg-io/tap/xberg
|
|
16
18
|
# or run without a persistent install (self-installs the binary):
|
|
17
19
|
npx @xberg-io/xberg-cli --help
|
|
18
|
-
uvx --from xberg-cli xberg --help
|
|
20
|
+
uvx --from xberg-cli==1.4.0 xberg --help
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
Or download a pre-built binary from the [latest GitHub Release](https://github.com/xberg-io/xberg/releases/latest), or build from source:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:d9846749cb2b57685af6f077cfe2d16d5d7e58768437f14ee12f3c78a260106e
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -115,7 +115,7 @@ Nested sections (each `None`/unset by default unless noted): `ocr`, `xberg-chunk
|
|
|
115
115
|
enabled = true
|
|
116
116
|
backend = "tesseract"
|
|
117
117
|
language = ["eng"]
|
|
118
|
-
auto_rotate =
|
|
118
|
+
auto_rotate = true
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
| Option | Type | Default | Description |
|
|
@@ -123,7 +123,7 @@ auto_rotate = false
|
|
|
123
123
|
| `enabled` | boolean | `true` | Whether OCR is enabled. Setting `false` is equivalent to `disable_ocr` |
|
|
124
124
|
| `backend` | string | `"tesseract"` | OCR backend: `tesseract`, `paddleocr`/`paddle-ocr`, or `vlm` |
|
|
125
125
|
| `language` | string or array | `["eng"]` | Language code(s). Accepts `"eng"` or `["eng", "deu"]`. Tesseract joins with `+` |
|
|
126
|
-
| `auto_rotate` | boolean
|
|
126
|
+
| `auto_rotate` | boolean \| null | `null` | `true` always rotates, `false` never rotates or retries, unset keeps the orientation retry |
|
|
127
127
|
| `vlm_fallback` | string | `"disabled"` | VLM fallback policy |
|
|
128
128
|
| `output_format`| string \| null | `null` | Optional OCR output format override |
|
|
129
129
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:5dd1dce4a7814ed37c2ea273dda3dd60d7caa18b08b0aff933ce3a8f7717d1a6
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:dacb4d7def21681b8b237603d2c7b89beaf18b8ee4110175b6ea5593022f3229
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:9250a30997ec851cbb228ddcfd1f538e81e843f81e488e5f3d927ba94af93e4f
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -485,7 +485,7 @@ for table in result.results[0].tables:
|
|
|
485
485
|
|
|
486
486
|
## Error Classes
|
|
487
487
|
|
|
488
|
-
|
|
488
|
+
`extract()` and `extract_batch()` raise the exported exception subclass for the underlying Rust error kind, including calls with `on_progress`. Catch `XbergError` for extraction failures, or a specific subclass such as `ParsingError`, `SecurityError`, or `ValidationError`.
|
|
489
489
|
|
|
490
490
|
Xberg also defines a family of typed exception classes re-exported from `xberg`. The `XbergError`-rooted ones inherit from `XbergError` (base): `ParsingError`, `OcrError`, `ValidationError`, `MissingDependencyError`, `UnsupportedFormatError`, `CacheError`, `ImageProcessingError`, `SerializationError`, `PluginError`, `SecurityError`, `TranscriptionError`, `EmbeddingError`, `RerankingError`, `XbergTimeoutError`, `IoError`, and others. A few classes sit in separate hierarchies rooted at `Exception` rather than `XbergError` — e.g. `ConfigError`/`PdfAnalysisError` and `ParseError`/`SchemaValidationError`.
|
|
491
491
|
|
|
@@ -493,12 +493,12 @@ Xberg also defines a family of typed exception classes re-exported from `xberg`.
|
|
|
493
493
|
|
|
494
494
|
```python
|
|
495
495
|
import asyncio
|
|
496
|
-
from xberg import ExtractInput, extract, ExtractionConfig
|
|
496
|
+
from xberg import ExtractInput, extract, ExtractionConfig, XbergError
|
|
497
497
|
|
|
498
498
|
async def main() -> None:
|
|
499
499
|
try:
|
|
500
500
|
result = await extract(ExtractInput(uri="document.pdf"), ExtractionConfig())
|
|
501
|
-
except
|
|
501
|
+
except XbergError as e:
|
|
502
502
|
print(f"Extraction failed: {e}")
|
|
503
503
|
|
|
504
504
|
asyncio.run(main())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:a257c85add0ba02dd9ab63eecac13348152038919a09ba99964261256acf4ee4
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:e3c1dcb34a4784efc4f7fd868468061c3bd49d41e7e39792086633dcfe029d63
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -6,7 +6,7 @@ name: xberg-batch-extraction
|
|
|
6
6
|
<!--
|
|
7
7
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
8
8
|
Content-Hash: blake3:324433f2b10c7c9cdc1c06b98c1e427c8cb0ca9ccf034d336e28d49706add520
|
|
9
|
-
Source-Hash: blake3:
|
|
9
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
10
10
|
Schema-Version: v1
|
|
11
11
|
-->
|
|
12
12
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:3aac352725eacf5cb70a1f994f0a1d4b51eb2f4f30872b388f66d7d47e18c5f2
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
8
|
# Concepts
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- [Batch Extraction](SKILL.md) - Use when extracting from many files at once with shared config, bounded parallelism, per-file overrides, and error recovery. Covers the `batch` command, `--file-configs`, `--max-concurrent`, and output layout.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:353a7a05cbe84a2af1d053c8173d2154f418972a2bbfc2846dbb2c17a8a46197
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:70bcb43e649e885bb822d41efb7221b365fd6f1870d1e6a5bb4ab3ec10be6acc
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -11,11 +11,13 @@ Comprehensive command-line interface for the Xberg document intelligence library
|
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
|
+
The pinned command below follows this source release (1.4.0); use it once that release is published.
|
|
15
|
+
|
|
14
16
|
```bash
|
|
15
17
|
brew install xberg-io/tap/xberg
|
|
16
18
|
# or run without a persistent install (self-installs the binary):
|
|
17
19
|
npx @xberg-io/xberg-cli --help
|
|
18
|
-
uvx --from xberg-cli xberg --help
|
|
20
|
+
uvx --from xberg-cli==1.4.0 xberg --help
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
Or download a pre-built binary from the [latest GitHub Release](https://github.com/xberg-io/xberg/releases/latest), or build from source:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:d9846749cb2b57685af6f077cfe2d16d5d7e58768437f14ee12f3c78a260106e
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -115,7 +115,7 @@ Nested sections (each `None`/unset by default unless noted): `ocr`, `xberg-chunk
|
|
|
115
115
|
enabled = true
|
|
116
116
|
backend = "tesseract"
|
|
117
117
|
language = ["eng"]
|
|
118
|
-
auto_rotate =
|
|
118
|
+
auto_rotate = true
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
| Option | Type | Default | Description |
|
|
@@ -123,7 +123,7 @@ auto_rotate = false
|
|
|
123
123
|
| `enabled` | boolean | `true` | Whether OCR is enabled. Setting `false` is equivalent to `disable_ocr` |
|
|
124
124
|
| `backend` | string | `"tesseract"` | OCR backend: `tesseract`, `paddleocr`/`paddle-ocr`, or `vlm` |
|
|
125
125
|
| `language` | string or array | `["eng"]` | Language code(s). Accepts `"eng"` or `["eng", "deu"]`. Tesseract joins with `+` |
|
|
126
|
-
| `auto_rotate` | boolean
|
|
126
|
+
| `auto_rotate` | boolean \| null | `null` | `true` always rotates, `false` never rotates or retries, unset keeps the orientation retry |
|
|
127
127
|
| `vlm_fallback` | string | `"disabled"` | VLM fallback policy |
|
|
128
128
|
| `output_format`| string \| null | `null` | Optional OCR output format override |
|
|
129
129
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:5dd1dce4a7814ed37c2ea273dda3dd60d7caa18b08b0aff933ce3a8f7717d1a6
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:dacb4d7def21681b8b237603d2c7b89beaf18b8ee4110175b6ea5593022f3229
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:9250a30997ec851cbb228ddcfd1f538e81e843f81e488e5f3d927ba94af93e4f
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -485,7 +485,7 @@ for table in result.results[0].tables:
|
|
|
485
485
|
|
|
486
486
|
## Error Classes
|
|
487
487
|
|
|
488
|
-
|
|
488
|
+
`extract()` and `extract_batch()` raise the exported exception subclass for the underlying Rust error kind, including calls with `on_progress`. Catch `XbergError` for extraction failures, or a specific subclass such as `ParsingError`, `SecurityError`, or `ValidationError`.
|
|
489
489
|
|
|
490
490
|
Xberg also defines a family of typed exception classes re-exported from `xberg`. The `XbergError`-rooted ones inherit from `XbergError` (base): `ParsingError`, `OcrError`, `ValidationError`, `MissingDependencyError`, `UnsupportedFormatError`, `CacheError`, `ImageProcessingError`, `SerializationError`, `PluginError`, `SecurityError`, `TranscriptionError`, `EmbeddingError`, `RerankingError`, `XbergTimeoutError`, `IoError`, and others. A few classes sit in separate hierarchies rooted at `Exception` rather than `XbergError` — e.g. `ConfigError`/`PdfAnalysisError` and `ParseError`/`SchemaValidationError`.
|
|
491
491
|
|
|
@@ -493,12 +493,12 @@ Xberg also defines a family of typed exception classes re-exported from `xberg`.
|
|
|
493
493
|
|
|
494
494
|
```python
|
|
495
495
|
import asyncio
|
|
496
|
-
from xberg import ExtractInput, extract, ExtractionConfig
|
|
496
|
+
from xberg import ExtractInput, extract, ExtractionConfig, XbergError
|
|
497
497
|
|
|
498
498
|
async def main() -> None:
|
|
499
499
|
try:
|
|
500
500
|
result = await extract(ExtractInput(uri="document.pdf"), ExtractionConfig())
|
|
501
|
-
except
|
|
501
|
+
except XbergError as e:
|
|
502
502
|
print(f"Extraction failed: {e}")
|
|
503
503
|
|
|
504
504
|
asyncio.run(main())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:a257c85add0ba02dd9ab63eecac13348152038919a09ba99964261256acf4ee4
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:e3c1dcb34a4784efc4f7fd868468061c3bd49d41e7e39792086633dcfe029d63
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -6,7 +6,7 @@ name: xberg-chunking
|
|
|
6
6
|
<!--
|
|
7
7
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
8
8
|
Content-Hash: blake3:aaaffebaf030b1c214ffc0a869f0a63366360a5a568638f6996b98e75901d121
|
|
9
|
-
Source-Hash: blake3:
|
|
9
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
10
10
|
Schema-Version: v1
|
|
11
11
|
-->
|
|
12
12
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:1c68a3b266a19383b28a9915e14fda9bce6c6d4668ce923727e86b59a2e34e0e
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
8
|
# Concepts
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- [Chunking](SKILL.md) - Use when splitting extracted text into chunks for LLM context windows or RAG ingestion. Covers chunk size, overlap, markdown/yaml/semantic chunkers, tokenizer-based sizing, and the standalone `chunk` command.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:353a7a05cbe84a2af1d053c8173d2154f418972a2bbfc2846dbb2c17a8a46197
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:70bcb43e649e885bb822d41efb7221b365fd6f1870d1e6a5bb4ab3ec10be6acc
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -11,11 +11,13 @@ Comprehensive command-line interface for the Xberg document intelligence library
|
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
|
+
The pinned command below follows this source release (1.4.0); use it once that release is published.
|
|
15
|
+
|
|
14
16
|
```bash
|
|
15
17
|
brew install xberg-io/tap/xberg
|
|
16
18
|
# or run without a persistent install (self-installs the binary):
|
|
17
19
|
npx @xberg-io/xberg-cli --help
|
|
18
|
-
uvx --from xberg-cli xberg --help
|
|
20
|
+
uvx --from xberg-cli==1.4.0 xberg --help
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
Or download a pre-built binary from the [latest GitHub Release](https://github.com/xberg-io/xberg/releases/latest), or build from source:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:d9846749cb2b57685af6f077cfe2d16d5d7e58768437f14ee12f3c78a260106e
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -115,7 +115,7 @@ Nested sections (each `None`/unset by default unless noted): `ocr`, `xberg-chunk
|
|
|
115
115
|
enabled = true
|
|
116
116
|
backend = "tesseract"
|
|
117
117
|
language = ["eng"]
|
|
118
|
-
auto_rotate =
|
|
118
|
+
auto_rotate = true
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
| Option | Type | Default | Description |
|
|
@@ -123,7 +123,7 @@ auto_rotate = false
|
|
|
123
123
|
| `enabled` | boolean | `true` | Whether OCR is enabled. Setting `false` is equivalent to `disable_ocr` |
|
|
124
124
|
| `backend` | string | `"tesseract"` | OCR backend: `tesseract`, `paddleocr`/`paddle-ocr`, or `vlm` |
|
|
125
125
|
| `language` | string or array | `["eng"]` | Language code(s). Accepts `"eng"` or `["eng", "deu"]`. Tesseract joins with `+` |
|
|
126
|
-
| `auto_rotate` | boolean
|
|
126
|
+
| `auto_rotate` | boolean \| null | `null` | `true` always rotates, `false` never rotates or retries, unset keeps the orientation retry |
|
|
127
127
|
| `vlm_fallback` | string | `"disabled"` | VLM fallback policy |
|
|
128
128
|
| `output_format`| string \| null | `null` | Optional OCR output format override |
|
|
129
129
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:5dd1dce4a7814ed37c2ea273dda3dd60d7caa18b08b0aff933ce3a8f7717d1a6
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:dacb4d7def21681b8b237603d2c7b89beaf18b8ee4110175b6ea5593022f3229
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:9250a30997ec851cbb228ddcfd1f538e81e843f81e488e5f3d927ba94af93e4f
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -485,7 +485,7 @@ for table in result.results[0].tables:
|
|
|
485
485
|
|
|
486
486
|
## Error Classes
|
|
487
487
|
|
|
488
|
-
|
|
488
|
+
`extract()` and `extract_batch()` raise the exported exception subclass for the underlying Rust error kind, including calls with `on_progress`. Catch `XbergError` for extraction failures, or a specific subclass such as `ParsingError`, `SecurityError`, or `ValidationError`.
|
|
489
489
|
|
|
490
490
|
Xberg also defines a family of typed exception classes re-exported from `xberg`. The `XbergError`-rooted ones inherit from `XbergError` (base): `ParsingError`, `OcrError`, `ValidationError`, `MissingDependencyError`, `UnsupportedFormatError`, `CacheError`, `ImageProcessingError`, `SerializationError`, `PluginError`, `SecurityError`, `TranscriptionError`, `EmbeddingError`, `RerankingError`, `XbergTimeoutError`, `IoError`, and others. A few classes sit in separate hierarchies rooted at `Exception` rather than `XbergError` — e.g. `ConfigError`/`PdfAnalysisError` and `ParseError`/`SchemaValidationError`.
|
|
491
491
|
|
|
@@ -493,12 +493,12 @@ Xberg also defines a family of typed exception classes re-exported from `xberg`.
|
|
|
493
493
|
|
|
494
494
|
```python
|
|
495
495
|
import asyncio
|
|
496
|
-
from xberg import ExtractInput, extract, ExtractionConfig
|
|
496
|
+
from xberg import ExtractInput, extract, ExtractionConfig, XbergError
|
|
497
497
|
|
|
498
498
|
async def main() -> None:
|
|
499
499
|
try:
|
|
500
500
|
result = await extract(ExtractInput(uri="document.pdf"), ExtractionConfig())
|
|
501
|
-
except
|
|
501
|
+
except XbergError as e:
|
|
502
502
|
print(f"Extraction failed: {e}")
|
|
503
503
|
|
|
504
504
|
asyncio.run(main())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:a257c85add0ba02dd9ab63eecac13348152038919a09ba99964261256acf4ee4
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:e3c1dcb34a4784efc4f7fd868468061c3bd49d41e7e39792086633dcfe029d63
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
@@ -6,7 +6,7 @@ name: xberg-extracting-keywords
|
|
|
6
6
|
<!--
|
|
7
7
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
8
8
|
Content-Hash: blake3:491d3cbcd4f6128d43e32b39c13d03a023b397f97c71da48ed5a02d6be00ae28
|
|
9
|
-
Source-Hash: blake3:
|
|
9
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
10
10
|
Schema-Version: v1
|
|
11
11
|
-->
|
|
12
12
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
|
-
Content-Hash: blake3:
|
|
4
|
-
Source-Hash: blake3:
|
|
3
|
+
Content-Hash: blake3:57fac354e456e8f381c394e954fe4631b559ee89e90d2f2ff4366061ffeac686
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
8
|
# Concepts
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- [Extracting Keywords](SKILL.md) - Use when extracting keywords (YAKE/RAKE) from documents — and, secondarily, when detecting document language or generating embeddings for RAG and search. Covers the keyword config (and its feature gating), `--detect-language`, and the standalone `embed` command with real flags.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
|
|
3
3
|
Content-Hash: blake3:353a7a05cbe84a2af1d053c8173d2154f418972a2bbfc2846dbb2c17a8a46197
|
|
4
|
-
Source-Hash: blake3:
|
|
4
|
+
Source-Hash: blake3:ab2bcd453f9c2ded67752f6a9800186d42b6921f4be16f6ab3a773254a9fba00
|
|
5
5
|
Schema-Version: v1
|
|
6
6
|
-->
|
|
7
7
|
|