clerk-sdk 0.5.8__tar.gz → 0.5.9__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.
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/PKG-INFO +1 -1
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/__init__.py +1 -1
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/client.py +22 -0
- clerk_sdk-0.5.9/clerk/models/prevalidation.py +33 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/pyproject.toml +1 -1
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/setup.py +1 -1
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/.github/workflows/ci.yaml +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/.github/workflows/pypi_publish.yml +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/.gitignore +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/LICENSE +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/MANIFEST.in +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/README.md +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/base.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/decorator/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/decorator/models.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/decorator/task_decorator.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/cli.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/code_runner.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/gui/graph_checker.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/gui/test_session.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/init_project.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/schema/fetch_schema.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/exceptions.py.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/launch.json.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/main_basic.py.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/main_gui.py.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/rollbacks.py.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/states.py.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/tasks.json.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/test_payload.py.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/development/templates/transitions.py.template +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/exceptions/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/exceptions/exceptions.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/exceptions/remote_device.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/action_model/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/action_model/model.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/action_model/utils.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/client.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/client_actor/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/client_actor/client_actor.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/client_actor/exception.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/client_actor/model.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/decorators/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/decorators/gui_automation.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/exceptions/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/exceptions/agent_manager.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/exceptions/modality/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/exceptions/modality/exc.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/exceptions/websocket.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/requirements.txt +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_actions/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_actions/actions.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_actions/base.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_actions/support.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_inspector/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_inspector/gui_vision.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_inspector/models.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_machine/Readme.md +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_machine/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_machine/ai_recovery.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_machine/decorators.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_machine/exceptions.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/gui_automation/ui_state_machine/state_machine.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/models/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/models/document.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/models/document_statuses.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/models/file.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/models/remote_device.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/models/response_model.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/models/ui_operator.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/utils/__init__.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/utils/logger.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/clerk/utils/save_artifact.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/requirements.txt +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/conftest.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_base.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_client.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_document_models.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_exceptions.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_file_models.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_gui_automation.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_task_decorator.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/tests/test_utils.py +0 -0
- {clerk_sdk-0.5.8 → clerk_sdk-0.5.9}/uv.lock +0 -0
|
@@ -2,6 +2,7 @@ from typing import Any, Dict, List, Literal
|
|
|
2
2
|
|
|
3
3
|
from clerk.base import BaseClerk
|
|
4
4
|
from clerk.models.document import Document, GetDocumentsRequest, UploadDocumentRequest
|
|
5
|
+
from clerk.models.prevalidation import FileClassificationResponse
|
|
5
6
|
from .models.file import ParsedFile, UploadFile
|
|
6
7
|
|
|
7
8
|
|
|
@@ -141,3 +142,24 @@ class ClerkDocument(BaseClerk):
|
|
|
141
142
|
params = {"type": type}
|
|
142
143
|
files_data = [f.to_multipart_format() for f in files]
|
|
143
144
|
self.post_request(endpoint, params=params, files=files_data)
|
|
145
|
+
|
|
146
|
+
def prevalidate_file(
|
|
147
|
+
self, project_id: str, workflow_id: str, file: UploadFile
|
|
148
|
+
) -> Dict[str, Any]:
|
|
149
|
+
"""Submit a prevalidation for a specific file. Returns the id for fetching the results later."""
|
|
150
|
+
endpoint = f"/prevalidation/file"
|
|
151
|
+
files_data = [file.to_multipart_format()]
|
|
152
|
+
res = self.post_request(
|
|
153
|
+
endpoint,
|
|
154
|
+
files=files_data,
|
|
155
|
+
data={"project_id": project_id, "workflow_id": workflow_id},
|
|
156
|
+
)
|
|
157
|
+
return res.data[0]
|
|
158
|
+
|
|
159
|
+
def get_prevalidation_results(
|
|
160
|
+
self, workflow_run_id: str
|
|
161
|
+
) -> FileClassificationResponse:
|
|
162
|
+
"""Fetch the results of a previously submitted prevalidation."""
|
|
163
|
+
endpoint = f"/prevalidation/file"
|
|
164
|
+
res = self.get_request(endpoint, params={"workflow_run_id": workflow_run_id})
|
|
165
|
+
return FileClassificationResponse(**res.data[0])
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from typing import Dict, List, Optional
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LabelWithDescriptions(BaseModel):
|
|
6
|
+
label: str = Field(..., description="The label/category name")
|
|
7
|
+
description: Optional[str] = Field(
|
|
8
|
+
None, description="Optional description of the label/category"
|
|
9
|
+
)
|
|
10
|
+
attributes: Optional[List[str]] = Field(
|
|
11
|
+
None, description="Optional attributes for the label/category"
|
|
12
|
+
)
|
|
13
|
+
start_page: Optional[int] = Field(
|
|
14
|
+
None, description="Start page for classification (0-based, inclusive)"
|
|
15
|
+
)
|
|
16
|
+
end_page: Optional[int] = Field(
|
|
17
|
+
None, description="End page for classification (0-based, exclusive)"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class FileClassificationResponse(BaseModel):
|
|
22
|
+
valid: bool = Field(False, description="Whether the file classification is valid")
|
|
23
|
+
filename: str = Field(..., description="The name of the file that was classified")
|
|
24
|
+
classification: Optional[str] = Field(
|
|
25
|
+
None, description="The selected classification category"
|
|
26
|
+
)
|
|
27
|
+
reason: Optional[str] = Field(
|
|
28
|
+
None,
|
|
29
|
+
description="The reasoning behind the classification. To be filled if no classification is made.",
|
|
30
|
+
)
|
|
31
|
+
possible_categories: Optional[Dict[str, LabelWithDescriptions]] = Field(
|
|
32
|
+
None, description="Possible categories for classification"
|
|
33
|
+
)
|
|
@@ -13,7 +13,7 @@ gui_requirements = get_requirements("./clerk/gui_automation")
|
|
|
13
13
|
|
|
14
14
|
setup(
|
|
15
15
|
name="clerk-sdk",
|
|
16
|
-
version="0.5.
|
|
16
|
+
version="0.5.9",
|
|
17
17
|
description="Library for interacting with Clerk",
|
|
18
18
|
long_description=open("README.md").read(),
|
|
19
19
|
long_description_content_type="text/markdown",
|
|
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
|
|
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
|