retab 0.0.87__tar.gz → 0.0.88__tar.gz
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.
- {retab-0.0.87 → retab-0.0.88}/PKG-INFO +1 -1
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/split.py +17 -4
- {retab-0.0.87 → retab-0.0.88}/retab.egg-info/PKG-INFO +1 -1
- {retab-0.0.87 → retab-0.0.88}/setup.py +1 -1
- {retab-0.0.87 → retab-0.0.88}/README.md +0 -0
- {retab-0.0.87 → retab-0.0.88}/pyproject.toml +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/_resource.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/generate_types.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/py.typed +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/documents/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/documents/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/edit/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/edit/agent/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/edit/agent/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/edit/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/edit/templates/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/edit/templates/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/extractions/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/extractions/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/models.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/projects/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/projects/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/schemas.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/workflows/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/workflows/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/workflows/runs/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/resources/workflows/runs/client.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/chat.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/classify.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/correct_orientation.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/create_messages.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/edit.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/extract.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/documents/parse.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/edit/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/edit/templates.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/extractions/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/extractions/types.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/inference_settings.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/mime.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/modality.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/pagination.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/projects/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/projects/metrics.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/projects/model.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/projects/predictions.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/schemas/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/schemas/chat.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/schemas/generate.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/schemas/layout.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/schemas/model.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/schemas/templates.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/standards.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/workflows/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/types/workflows/model.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/utils/__init__.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/utils/display.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/utils/hashing.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/utils/json_schema.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/utils/mime.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab/utils/stream_context_managers.py +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab.egg-info/SOURCES.txt +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab.egg-info/dependency_links.txt +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab.egg-info/requires.txt +0 -0
- {retab-0.0.87 → retab-0.0.88}/retab.egg-info/top_level.txt +0 -0
- {retab-0.0.87 → retab-0.0.88}/setup.cfg +0 -0
- {retab-0.0.87 → retab-0.0.88}/tests/test_projects.py +0 -0
|
@@ -5,6 +5,7 @@ from ..mime import MIMEData
|
|
|
5
5
|
class Category(BaseModel):
|
|
6
6
|
name: str = Field(..., description="The name of the category")
|
|
7
7
|
description: str = Field(..., description="The description of the category")
|
|
8
|
+
partition_key: str | None = Field(default=None, description="The key to partition the category")
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class SplitRequest(BaseModel):
|
|
@@ -13,20 +14,32 @@ class SplitRequest(BaseModel):
|
|
|
13
14
|
model: str = Field(default="retab-small", description="The model to use to split the document")
|
|
14
15
|
|
|
15
16
|
|
|
17
|
+
class Partition(BaseModel):
|
|
18
|
+
key: str = Field(..., description="The partition key value (e.g., property ID, invoice number)")
|
|
19
|
+
pages: list[int] = Field(..., description="The pages of the partition (1-indexed)")
|
|
20
|
+
first_page_y_start: float = Field(default=0.0, description="The y coordinate of the first page of the partition")
|
|
21
|
+
last_page_y_end: float = Field(default=1.0, description="The y coordinate of the last page of the partition")
|
|
22
|
+
|
|
16
23
|
class SplitResult(BaseModel):
|
|
17
24
|
name: str = Field(..., description="The name of the category")
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
pages: list[int] = Field(..., description="The pages of the category (1-indexed)")
|
|
26
|
+
partitions: list[Partition] = Field(default_factory=list, description="The partitions of the category")
|
|
20
27
|
|
|
21
28
|
|
|
22
29
|
class SplitResponse(BaseModel):
|
|
23
30
|
splits: list[SplitResult] = Field(..., description="The list of document splits with their page ranges")
|
|
24
31
|
|
|
25
32
|
|
|
33
|
+
class SplitOutputItem(BaseModel):
|
|
34
|
+
"""Internal schema item for LLM structured output validation."""
|
|
35
|
+
name: str = Field(..., description="The name of the category")
|
|
36
|
+
start_page: int = Field(..., description="The start page of the category (1-indexed)")
|
|
37
|
+
end_page: int = Field(..., description="The end page of the category (1-indexed, inclusive)")
|
|
38
|
+
|
|
26
39
|
|
|
27
40
|
class SplitOutputSchema(BaseModel):
|
|
28
41
|
"""Schema for LLM structured output."""
|
|
29
|
-
splits: list[
|
|
30
|
-
...,
|
|
42
|
+
splits: list[SplitOutputItem] = Field(
|
|
43
|
+
...,
|
|
31
44
|
description="List of document sections, each classified into one of the provided categories with their page ranges"
|
|
32
45
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|