retab 0.0.36__py3-none-any.whl → 0.0.38__py3-none-any.whl
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/__init__.py +4 -0
- {uiform → retab}/_resource.py +5 -5
- {uiform → retab}/_utils/ai_models.py +2 -2
- {uiform → retab}/_utils/benchmarking.py +15 -16
- {uiform → retab}/_utils/chat.py +29 -34
- {uiform → retab}/_utils/display.py +0 -3
- {uiform → retab}/_utils/json_schema.py +9 -14
- {uiform → retab}/_utils/mime.py +11 -14
- {uiform → retab}/_utils/responses.py +16 -10
- {uiform → retab}/_utils/stream_context_managers.py +1 -1
- {uiform → retab}/_utils/usage/usage.py +31 -31
- {uiform → retab}/client.py +54 -53
- {uiform → retab}/resources/consensus/client.py +19 -38
- {uiform → retab}/resources/consensus/completions.py +36 -59
- {uiform → retab}/resources/consensus/completions_stream.py +35 -47
- {uiform → retab}/resources/consensus/responses.py +37 -86
- {uiform → retab}/resources/consensus/responses_stream.py +41 -89
- retab/resources/documents/client.py +455 -0
- {uiform → retab}/resources/documents/extractions.py +192 -101
- {uiform → retab}/resources/evals.py +56 -43
- retab/resources/evaluations/__init__.py +3 -0
- retab/resources/evaluations/client.py +301 -0
- retab/resources/evaluations/documents.py +233 -0
- retab/resources/evaluations/iterations.py +452 -0
- {uiform → retab}/resources/files.py +2 -2
- {uiform → retab}/resources/jsonlUtils.py +225 -221
- retab/resources/models.py +73 -0
- retab/resources/processors/automations/client.py +244 -0
- {uiform → retab}/resources/processors/automations/endpoints.py +79 -120
- retab/resources/processors/automations/links.py +294 -0
- {uiform → retab}/resources/processors/automations/logs.py +30 -19
- retab/resources/processors/automations/mailboxes.py +397 -0
- retab/resources/processors/automations/outlook.py +337 -0
- {uiform → retab}/resources/processors/automations/tests.py +22 -25
- {uiform → retab}/resources/processors/client.py +181 -166
- {uiform → retab}/resources/schemas.py +78 -66
- {uiform → retab}/resources/secrets/external_api_keys.py +1 -5
- retab/resources/secrets/webhook.py +64 -0
- {uiform → retab}/resources/usage.py +41 -4
- {uiform → retab}/types/ai_models.py +17 -17
- {uiform → retab}/types/automations/cron.py +19 -12
- {uiform → retab}/types/automations/endpoints.py +7 -4
- {uiform → retab}/types/automations/links.py +7 -3
- {uiform → retab}/types/automations/mailboxes.py +10 -10
- {uiform → retab}/types/automations/outlook.py +15 -11
- {uiform → retab}/types/automations/webhooks.py +1 -1
- retab/types/browser_canvas.py +3 -0
- retab/types/chat.py +8 -0
- {uiform → retab}/types/completions.py +12 -15
- retab/types/consensus.py +19 -0
- {uiform → retab}/types/db/annotations.py +3 -3
- {uiform → retab}/types/db/files.py +8 -6
- {uiform → retab}/types/documents/create_messages.py +20 -22
- {uiform → retab}/types/documents/extractions.py +71 -26
- {uiform → retab}/types/evals.py +5 -5
- retab/types/evaluations/__init__.py +31 -0
- retab/types/evaluations/documents.py +30 -0
- retab/types/evaluations/iterations.py +112 -0
- retab/types/evaluations/model.py +73 -0
- retab/types/events.py +79 -0
- {uiform → retab}/types/extractions.py +36 -13
- retab/types/inference_settings.py +15 -0
- retab/types/jobs/base.py +54 -0
- retab/types/jobs/batch_annotation.py +12 -0
- {uiform → retab}/types/jobs/evaluation.py +1 -2
- {uiform → retab}/types/logs.py +37 -34
- retab/types/metrics.py +32 -0
- {uiform → retab}/types/mime.py +22 -20
- {uiform → retab}/types/modalities.py +10 -10
- retab/types/predictions.py +19 -0
- {uiform → retab}/types/schemas/enhance.py +4 -2
- {uiform → retab}/types/schemas/evaluate.py +7 -4
- {uiform → retab}/types/schemas/generate.py +6 -3
- {uiform → retab}/types/schemas/layout.py +1 -1
- {uiform → retab}/types/schemas/object.py +16 -17
- {uiform → retab}/types/schemas/templates.py +1 -3
- {uiform → retab}/types/secrets/external_api_keys.py +0 -1
- {uiform → retab}/types/standards.py +18 -1
- {retab-0.0.36.dist-info → retab-0.0.38.dist-info}/METADATA +78 -77
- retab-0.0.38.dist-info/RECORD +107 -0
- retab-0.0.38.dist-info/top_level.txt +1 -0
- retab-0.0.36.dist-info/RECORD +0 -96
- retab-0.0.36.dist-info/top_level.txt +0 -1
- uiform/__init__.py +0 -4
- uiform/_utils/benchmarking copy.py +0 -588
- uiform/resources/documents/client.py +0 -255
- uiform/resources/models.py +0 -45
- uiform/resources/processors/automations/client.py +0 -78
- uiform/resources/processors/automations/links.py +0 -356
- uiform/resources/processors/automations/mailboxes.py +0 -435
- uiform/resources/processors/automations/outlook.py +0 -444
- uiform/resources/secrets/webhook.py +0 -62
- uiform/types/chat.py +0 -8
- uiform/types/consensus.py +0 -10
- uiform/types/events.py +0 -76
- uiform/types/jobs/base.py +0 -150
- uiform/types/jobs/batch_annotation.py +0 -22
- {uiform → retab}/_utils/__init__.py +0 -0
- {uiform → retab}/_utils/usage/__init__.py +0 -0
- {uiform → retab}/py.typed +0 -0
- {uiform → retab}/resources/__init__.py +0 -0
- {uiform → retab}/resources/consensus/__init__.py +0 -0
- {uiform → retab}/resources/documents/__init__.py +0 -0
- {uiform → retab}/resources/finetuning.py +0 -0
- {uiform → retab}/resources/openai_example.py +0 -0
- {uiform → retab}/resources/processors/__init__.py +0 -0
- {uiform → retab}/resources/processors/automations/__init__.py +0 -0
- {uiform → retab}/resources/prompt_optimization.py +0 -0
- {uiform → retab}/resources/secrets/__init__.py +0 -0
- {uiform → retab}/resources/secrets/client.py +0 -0
- {uiform → retab}/types/__init__.py +0 -0
- {uiform → retab}/types/automations/__init__.py +0 -0
- {uiform → retab}/types/db/__init__.py +0 -0
- {uiform → retab}/types/documents/__init__.py +0 -0
- {uiform → retab}/types/documents/correct_orientation.py +0 -0
- {uiform → retab}/types/jobs/__init__.py +0 -0
- {uiform → retab}/types/jobs/finetune.py +0 -0
- {uiform → retab}/types/jobs/prompt_optimization.py +0 -0
- {uiform → retab}/types/jobs/webcrawl.py +0 -0
- {uiform → retab}/types/pagination.py +0 -0
- {uiform → retab}/types/schemas/__init__.py +0 -0
- {uiform → retab}/types/secrets/__init__.py +0 -0
- {retab-0.0.36.dist-info → retab-0.0.38.dist-info}/WHEEL +0 -0
uiform/types/jobs/base.py
DELETED
@@ -1,150 +0,0 @@
|
|
1
|
-
from typing import Literal, Optional, Self
|
2
|
-
|
3
|
-
from openai.types.chat.chat_completion_reasoning_effort import ChatCompletionReasoningEffort
|
4
|
-
from pydantic import BaseModel, Field, model_validator
|
5
|
-
|
6
|
-
from ..modalities import Modality
|
7
|
-
|
8
|
-
SelectionMode = Literal["all", "manual"]
|
9
|
-
|
10
|
-
|
11
|
-
# This is the input data for the prepare_dataset job
|
12
|
-
class PrepareDatasetInputData(BaseModel):
|
13
|
-
dataset_id: Optional[str] = None
|
14
|
-
schema_id: Optional[str] = None
|
15
|
-
schema_data_id: Optional[str] = None
|
16
|
-
|
17
|
-
selection_model: SelectionMode = "all"
|
18
|
-
|
19
|
-
@model_validator(mode="after")
|
20
|
-
def validate_input(self) -> Self:
|
21
|
-
# The preference is:
|
22
|
-
# 1. dataset_id
|
23
|
-
# 2. schema_id
|
24
|
-
# 3. schema_data_id
|
25
|
-
if self.dataset_id is None and self.schema_id is None and self.schema_data_id is None:
|
26
|
-
raise ValueError("At least one of dataset_id, schema_id, or schema_data_id must be provided")
|
27
|
-
|
28
|
-
return self
|
29
|
-
|
30
|
-
|
31
|
-
# This is the input data for the split_dataset job
|
32
|
-
class DatasetSplitInputData(BaseModel):
|
33
|
-
dataset_id: str
|
34
|
-
train_size: Optional[int | float] = None
|
35
|
-
eval_size: Optional[int | float] = None
|
36
|
-
|
37
|
-
@model_validator(mode="after")
|
38
|
-
def validate_input(self) -> Self:
|
39
|
-
if self.train_size is not None and self.eval_size is not None:
|
40
|
-
raise ValueError("train_size and eval_size cannot both be provided")
|
41
|
-
return self
|
42
|
-
|
43
|
-
|
44
|
-
# This is the input data for the batch annotation job
|
45
|
-
class InferenceSettings(BaseModel):
|
46
|
-
model: str = "gpt-4o-mini"
|
47
|
-
temperature: float = 0.0
|
48
|
-
modality: Modality = "native"
|
49
|
-
reasoning_effort: ChatCompletionReasoningEffort = "medium"
|
50
|
-
image_resolution_dpi: int = 96
|
51
|
-
browser_canvas: Literal['A3', 'A4', 'A5'] = 'A4'
|
52
|
-
n_consensus: int = Field(default=1, description="Number of consensus rounds to perform")
|
53
|
-
|
54
|
-
|
55
|
-
class AnnotationInputData(BaseModel):
|
56
|
-
data_file: str
|
57
|
-
schema_id: str
|
58
|
-
inference_settings: InferenceSettings
|
59
|
-
|
60
|
-
|
61
|
-
# This is the input data for the evaluation job
|
62
|
-
class EvaluationInputData(BaseModel):
|
63
|
-
eval_data_file: str
|
64
|
-
schema_id: str
|
65
|
-
inference_settings_1: InferenceSettings | None = None
|
66
|
-
inference_settings_2: InferenceSettings
|
67
|
-
|
68
|
-
|
69
|
-
# from pydantic import BaseModel, Field, model_validator
|
70
|
-
# from typing import Literal, Optional, Any
|
71
|
-
# import datetime
|
72
|
-
|
73
|
-
|
74
|
-
# JobType = Literal["prompt-optimization", "annotate-files", "finetune-dataset", "webcrawl"]
|
75
|
-
# JobStatus = Literal["pending", "running", "completed", "failed"]
|
76
|
-
#### JOBS ####
|
77
|
-
|
78
|
-
# class JobTemplateCreateRequest(BaseModel):
|
79
|
-
# job_type: JobType
|
80
|
-
# default_input_data: dict = Field(default_factory=dict)
|
81
|
-
# description: Optional[str] = None
|
82
|
-
# cron: Optional[str] = None
|
83
|
-
|
84
|
-
|
85
|
-
# class JobTemplateDocument(BaseModel):
|
86
|
-
# object: Literal["job_template"] = "job_template"
|
87
|
-
# id: str
|
88
|
-
# type: JobType
|
89
|
-
# identity: Any | None = None
|
90
|
-
# description: Optional[str] = None
|
91
|
-
# default_input_data: dict = Field(default_factory=dict)
|
92
|
-
# # For scheduled jobs, include a valid CRON expression (None for on-demand only jobs)
|
93
|
-
# cron: Optional[str] = None
|
94
|
-
# next_run: Optional[datetime.datetime] = None
|
95
|
-
# created_at: Optional[datetime.datetime] = None
|
96
|
-
# updated_at: Optional[datetime.datetime] = None
|
97
|
-
# is_active: bool = True # Change to status.
|
98
|
-
|
99
|
-
# class JobTemplateUpdateRequest(BaseModel):
|
100
|
-
# cron: Optional[str] = None
|
101
|
-
# default_input_data: Optional[dict] = None
|
102
|
-
# description: Optional[str] = None
|
103
|
-
# is_active: Optional[bool] = None # Change to status.
|
104
|
-
|
105
|
-
|
106
|
-
#### EXECUTIONS ####
|
107
|
-
|
108
|
-
# class JobExecutionCreateRequest(BaseModel):
|
109
|
-
# type: JobType
|
110
|
-
# template_id: Optional[str] = None
|
111
|
-
# input_data: dict = Field(default_factory=dict)
|
112
|
-
|
113
|
-
# @model_validator(mode='before')
|
114
|
-
# @classmethod
|
115
|
-
# def validate_job_identifiers(cls, data: Any) -> Any:
|
116
|
-
# if isinstance(data, dict):
|
117
|
-
# if bool(data.get('job_type')) == bool(data.get('job_template_id')):
|
118
|
-
# raise ValueError("Either job_type or job_template_id must be provided")
|
119
|
-
# return data
|
120
|
-
|
121
|
-
# class JobExecutionResponse(BaseModel):
|
122
|
-
# id: str
|
123
|
-
# template_id: Optional[str] = None
|
124
|
-
# type: JobType
|
125
|
-
# status: JobStatus
|
126
|
-
# result: Optional[dict] = None
|
127
|
-
# error: Optional[str] = None
|
128
|
-
# created_at: Optional[datetime.datetime] = None
|
129
|
-
# updated_at: Optional[datetime.datetime] = None
|
130
|
-
|
131
|
-
# class JobExecutionDocument(BaseModel):
|
132
|
-
# object: Literal["job_execution"] = "job_execution"
|
133
|
-
# id: str
|
134
|
-
# template_id: Optional[str] = None
|
135
|
-
# type: JobType
|
136
|
-
# identity: Any | None = None
|
137
|
-
# status: JobStatus
|
138
|
-
# input_data_gcs_path: str
|
139
|
-
# result: Optional[dict] = None
|
140
|
-
# error: Optional[str] = None
|
141
|
-
# created_at: Optional[datetime.datetime] = None
|
142
|
-
# updated_at: Optional[datetime.datetime] = None
|
143
|
-
# checkpoint: Any = None # Useful for jobs that need to be resumed
|
144
|
-
# checkpoint_data: Optional[dict] = None
|
145
|
-
# needs: list[str] = Field(default_factory=list, description="list of jobs execution id that must be completed before this job can run")
|
146
|
-
|
147
|
-
|
148
|
-
# class Workflow(BaseModel):
|
149
|
-
# name: str
|
150
|
-
# jobs: list[JobExecutionDocument]
|
@@ -1,22 +0,0 @@
|
|
1
|
-
from typing import Literal, Optional
|
2
|
-
|
3
|
-
from openai.types.chat.chat_completion_reasoning_effort import ChatCompletionReasoningEffort
|
4
|
-
from pydantic import BaseModel, Field
|
5
|
-
|
6
|
-
from ..modalities import Modality
|
7
|
-
|
8
|
-
|
9
|
-
class InferenceSettings(BaseModel):
|
10
|
-
model: str = "gpt-4o-mini"
|
11
|
-
temperature: float = 0.0
|
12
|
-
modality: Modality
|
13
|
-
image_resolution_dpi: int = 96
|
14
|
-
browser_canvas: Literal['A3', 'A4', 'A5'] = 'A4'
|
15
|
-
reasoning_effort: ChatCompletionReasoningEffort = "medium"
|
16
|
-
|
17
|
-
|
18
|
-
class AnnotationInputData(BaseModel):
|
19
|
-
dataset_id: str
|
20
|
-
files_ids: Optional[list[str]] = None
|
21
|
-
upsert: bool = False
|
22
|
-
inference_settings: InferenceSettings
|
File without changes
|
File without changes
|
{uiform → retab}/py.typed
RENAMED
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
|