clerk-sdk 0.3.4__tar.gz → 0.3.6__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.3.4/clerk_sdk.egg-info → clerk_sdk-0.3.6}/PKG-INFO +1 -1
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/base.py +10 -1
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/client.py +14 -2
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/models/file.py +10 -1
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6/clerk_sdk.egg-info}/PKG-INFO +1 -1
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/setup.py +1 -1
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/LICENSE +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/MANIFEST.in +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/README.md +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/decorator/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/decorator/models.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/decorator/task_decorator.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/exceptions/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/exceptions/exceptions.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/exceptions/remote_device.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/action_model/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/action_model/model.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/action_model/utils.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/client.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/client_actor/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/client_actor/client_actor.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/client_actor/exception.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/client_actor/model.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/decorators/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/decorators/gui_automation.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/exceptions/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/exceptions/agent_manager.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/exceptions/modality/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/exceptions/modality/exc.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/exceptions/websocket.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/requirements.txt +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_actions/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_actions/actions.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_actions/base.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_actions/support.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_inspector/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_inspector/gui_vision.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_inspector/models.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_machine/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_machine/ai_recovery.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_machine/decorators.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_machine/exceptions.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_machine/models.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/gui_automation/ui_state_machine/state_machine.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/models/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/models/document.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/models/document_statuses.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/models/remote_device.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/models/response_model.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/models/ui_operator.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/utils/__init__.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/utils/logger.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk/utils/save_artifact.py +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk_sdk.egg-info/SOURCES.txt +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk_sdk.egg-info/dependency_links.txt +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk_sdk.egg-info/requires.txt +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/clerk_sdk.egg-info/top_level.txt +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/pyproject.toml +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/requirements.txt +0 -0
- {clerk_sdk-0.3.4 → clerk_sdk-0.3.6}/setup.cfg +0 -0
|
@@ -79,6 +79,8 @@ class BaseClerk(BaseModel):
|
|
|
79
79
|
headers: Dict[str, str] = {},
|
|
80
80
|
json: Dict = {},
|
|
81
81
|
params: Dict = {},
|
|
82
|
+
data: Dict = None,
|
|
83
|
+
files: Dict = {},
|
|
82
84
|
) -> StandardResponse:
|
|
83
85
|
|
|
84
86
|
merged_headers = {**self.headers, **headers}
|
|
@@ -88,7 +90,14 @@ class BaseClerk(BaseModel):
|
|
|
88
90
|
|
|
89
91
|
# logger.info(f"POST {url} | body={json} | params={params}")
|
|
90
92
|
|
|
91
|
-
response = requests.post(
|
|
93
|
+
response = requests.post(
|
|
94
|
+
url,
|
|
95
|
+
headers=merged_headers,
|
|
96
|
+
json=json,
|
|
97
|
+
params=params,
|
|
98
|
+
data=data,
|
|
99
|
+
files=files,
|
|
100
|
+
)
|
|
92
101
|
response.raise_for_status()
|
|
93
102
|
|
|
94
103
|
return StandardResponse(**response.json())
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List, Literal
|
|
2
2
|
from xml.dom.minidom import Document
|
|
3
3
|
|
|
4
4
|
from clerk.base import BaseClerk
|
|
5
|
-
from .models.file import ParsedFile
|
|
5
|
+
from .models.file import ParsedFile, UploadFile
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Clerk(BaseClerk):
|
|
@@ -15,3 +15,15 @@ class Clerk(BaseClerk):
|
|
|
15
15
|
endpoint = f"/document/{document_id}/files"
|
|
16
16
|
res = self.get_request(endpoint=endpoint)
|
|
17
17
|
return [ParsedFile(**d) for d in res.data]
|
|
18
|
+
|
|
19
|
+
def add_files_to_document(
|
|
20
|
+
self,
|
|
21
|
+
document_id: str,
|
|
22
|
+
type: Literal["input", "output"],
|
|
23
|
+
files: List[UploadFile],
|
|
24
|
+
):
|
|
25
|
+
endpoint = f"/document/{document_id}/files/upload"
|
|
26
|
+
params = {"type": type}
|
|
27
|
+
files_data = []
|
|
28
|
+
files_data.append(f.to_multipart_format() for f in files)
|
|
29
|
+
self.post_request(endpoint, params=params, files=files_data)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import base64
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import Optional, Tuple
|
|
3
3
|
from pydantic import BaseModel, Field
|
|
4
4
|
|
|
5
5
|
|
|
@@ -14,3 +14,12 @@ class ParsedFile(BaseModel):
|
|
|
14
14
|
return base64.b64decode(self.content.encode("utf-8"))
|
|
15
15
|
except Exception as e:
|
|
16
16
|
raise ValueError(f"Invalid base64 content: {e}")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class UploadFile(BaseModel):
|
|
20
|
+
name: str
|
|
21
|
+
mimetype: str
|
|
22
|
+
content: bytes
|
|
23
|
+
|
|
24
|
+
def to_multipart_format(self, key: str = "files") -> Tuple:
|
|
25
|
+
return (key, (self.name, self.content, self.mimetype))
|
|
@@ -13,7 +13,7 @@ gui_requirements = get_requirements("./clerk/gui_automation")
|
|
|
13
13
|
|
|
14
14
|
setup(
|
|
15
15
|
name="clerk-sdk",
|
|
16
|
-
version="0.3.
|
|
16
|
+
version="0.3.6",
|
|
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
|