unique_sdk 0.9.31__py3-none-any.whl → 0.9.33__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.
- unique_sdk/api_resources/_content.py +63 -1
- unique_sdk/api_resources/_folder.py +57 -0
- unique_sdk/utils/file_io.py +2 -2
- {unique_sdk-0.9.31.dist-info → unique_sdk-0.9.33.dist-info}/METADATA +65 -1
- {unique_sdk-0.9.31.dist-info → unique_sdk-0.9.33.dist-info}/RECORD +7 -7
- {unique_sdk-0.9.31.dist-info → unique_sdk-0.9.33.dist-info}/LICENSE +0 -0
- {unique_sdk-0.9.31.dist-info → unique_sdk-0.9.33.dist-info}/WHEEL +0 -0
|
@@ -106,7 +106,7 @@ class Content(APIResource["Content"]):
|
|
|
106
106
|
ownerId: str
|
|
107
107
|
byteSize: Optional[int]
|
|
108
108
|
ingestionConfig: "Content.IngestionConfig"
|
|
109
|
-
metadata: dict[str,
|
|
109
|
+
metadata: dict[str, Any] | None = None
|
|
110
110
|
|
|
111
111
|
class UpsertParams(RequestOptions):
|
|
112
112
|
input: "Content.Input"
|
|
@@ -155,6 +155,32 @@ class Content(APIResource["Content"]):
|
|
|
155
155
|
chunks: List[Chunk]
|
|
156
156
|
metadata: Optional[Dict[str, Any]]
|
|
157
157
|
|
|
158
|
+
class MagicTableSheetTableColumn(TypedDict):
|
|
159
|
+
columnId: str
|
|
160
|
+
columnName: str
|
|
161
|
+
content: str
|
|
162
|
+
|
|
163
|
+
class MagicTableSheetTable(TypedDict):
|
|
164
|
+
rowId: str
|
|
165
|
+
columns: List["Content.MagicTableSheetTableColumn"]
|
|
166
|
+
|
|
167
|
+
class MagicTableSheetIngestionConfiguration(TypedDict):
|
|
168
|
+
columnIdsInMetadata: List[str]
|
|
169
|
+
columnIdsInChunkText: List[str]
|
|
170
|
+
|
|
171
|
+
class MagicTableSheetIngestParams(TypedDict):
|
|
172
|
+
data: List["Content.MagicTableSheetTable"]
|
|
173
|
+
ingestionConfiguration: "Content.MagicTableSheetIngestionConfiguration"
|
|
174
|
+
metadata: Dict[str, Optional[str]]
|
|
175
|
+
scopeId: str
|
|
176
|
+
|
|
177
|
+
class MagicTableSheetRowIdToContentId(TypedDict):
|
|
178
|
+
rowId: str
|
|
179
|
+
contentId: str
|
|
180
|
+
|
|
181
|
+
class MagicTableSheetResponse(TypedDict):
|
|
182
|
+
rowIdsToContentIds: List["Content.MagicTableSheetRowIdToContentId"]
|
|
183
|
+
|
|
158
184
|
@classmethod
|
|
159
185
|
def search(
|
|
160
186
|
cls,
|
|
@@ -268,3 +294,39 @@ class Content(APIResource["Content"]):
|
|
|
268
294
|
params=params,
|
|
269
295
|
),
|
|
270
296
|
)
|
|
297
|
+
|
|
298
|
+
@classmethod
|
|
299
|
+
def ingest_magic_table_sheets(
|
|
300
|
+
cls,
|
|
301
|
+
user_id: str,
|
|
302
|
+
company_id: str,
|
|
303
|
+
**params: Unpack["Content.MagicTableSheetIngestParams"]
|
|
304
|
+
) -> "Content.MagicTableSheetResponse":
|
|
305
|
+
return cast(
|
|
306
|
+
Content.MagicTableSheetResponse,
|
|
307
|
+
cls._static_request(
|
|
308
|
+
"post",
|
|
309
|
+
"/content/magic-table-sheets",
|
|
310
|
+
user_id,
|
|
311
|
+
company_id=company_id,
|
|
312
|
+
params=params,
|
|
313
|
+
),
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
@classmethod
|
|
317
|
+
async def ingest_magic_table_sheets_async(
|
|
318
|
+
cls,
|
|
319
|
+
user_id: str,
|
|
320
|
+
company_id: str,
|
|
321
|
+
**params: Unpack["Content.MagicTableSheetIngestParams"]
|
|
322
|
+
) -> "Content.MagicTableSheetResponse":
|
|
323
|
+
return cast(
|
|
324
|
+
Content.MagicTableSheetResponse,
|
|
325
|
+
await cls._static_request_async(
|
|
326
|
+
"post",
|
|
327
|
+
"/content/magic-table-sheets",
|
|
328
|
+
user_id,
|
|
329
|
+
company_id=company_id,
|
|
330
|
+
params=params,
|
|
331
|
+
),
|
|
332
|
+
)
|
|
@@ -78,6 +78,19 @@ class Folder(APIResource["Folder"]):
|
|
|
78
78
|
class CreateParams(RequestOptions):
|
|
79
79
|
paths: List[str]
|
|
80
80
|
|
|
81
|
+
class FolderInfo(TypedDict):
|
|
82
|
+
"""
|
|
83
|
+
Represents the information of a folder.
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
id: str
|
|
87
|
+
name: str
|
|
88
|
+
ingestionConfig: "Folder.IngestionConfig"
|
|
89
|
+
createdAt: str | None
|
|
90
|
+
updatedAt: str | None
|
|
91
|
+
parentId: str | None
|
|
92
|
+
externalId: str | None
|
|
93
|
+
|
|
81
94
|
id: str
|
|
82
95
|
name: str
|
|
83
96
|
scopeAccess: List[ScopeAccess]
|
|
@@ -107,6 +120,50 @@ class Folder(APIResource["Folder"]):
|
|
|
107
120
|
scopeAccesses: List["Folder.ScopeAccess"]
|
|
108
121
|
applyToSubScopes: bool
|
|
109
122
|
|
|
123
|
+
class GetParams(RequestOptions):
|
|
124
|
+
"""
|
|
125
|
+
Parameters for getting a folder by its ID or path.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
scopeId: str | None = None
|
|
129
|
+
folderPath: str | None = None
|
|
130
|
+
|
|
131
|
+
@classmethod
|
|
132
|
+
def get_info(
|
|
133
|
+
cls, user_id: str, company_id: str, **params: Unpack["Folder.GetParams"]
|
|
134
|
+
) -> "Folder.FolderInfo":
|
|
135
|
+
"""
|
|
136
|
+
Get a folder by its ID or path.
|
|
137
|
+
"""
|
|
138
|
+
return cast(
|
|
139
|
+
"Folder.FolderInfo",
|
|
140
|
+
cls._static_request(
|
|
141
|
+
"get",
|
|
142
|
+
"/folder/info",
|
|
143
|
+
user_id,
|
|
144
|
+
company_id,
|
|
145
|
+
params=params,
|
|
146
|
+
),
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
@classmethod
|
|
150
|
+
async def get_info_async(
|
|
151
|
+
cls, user_id: str, company_id: str, **params: Unpack["Folder.GetParams"]
|
|
152
|
+
) -> "Folder.FolderInfo":
|
|
153
|
+
"""
|
|
154
|
+
Async get a folder by its ID or path.
|
|
155
|
+
"""
|
|
156
|
+
return cast(
|
|
157
|
+
"Folder.FolderInfo",
|
|
158
|
+
await cls._static_request_async(
|
|
159
|
+
"get",
|
|
160
|
+
"/folder/info",
|
|
161
|
+
user_id,
|
|
162
|
+
company_id,
|
|
163
|
+
params=params,
|
|
164
|
+
),
|
|
165
|
+
)
|
|
166
|
+
|
|
110
167
|
@classmethod
|
|
111
168
|
def create_paths(
|
|
112
169
|
cls, user_id: str, company_id: str, **params: Unpack["Folder.CreateParams"]
|
unique_sdk/utils/file_io.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import tempfile
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from typing import Optional
|
|
4
|
+
from typing import Any, Optional
|
|
5
5
|
|
|
6
6
|
import requests
|
|
7
7
|
|
|
@@ -41,7 +41,7 @@ def upload_file(
|
|
|
41
41
|
scope_or_unique_path=None,
|
|
42
42
|
chat_id=None,
|
|
43
43
|
ingestion_config: Optional[Content.IngestionConfig] = None,
|
|
44
|
-
metadata: dict[str,
|
|
44
|
+
metadata: dict[str, Any] | None = None,
|
|
45
45
|
):
|
|
46
46
|
# check that chatid or scope_or_unique_path is provided
|
|
47
47
|
if not chat_id and not scope_or_unique_path:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.33
|
|
4
4
|
Summary:
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Martin Fadler
|
|
@@ -434,8 +434,66 @@ def upload_file(
|
|
|
434
434
|
|
|
435
435
|
```
|
|
436
436
|
|
|
437
|
+
#### `unique_sdk.Content.ingest_magic_table_sheets`
|
|
438
|
+
|
|
439
|
+
Allows you to ingest a magic table sheet, each row is processed and converted into a content.
|
|
440
|
+
```python
|
|
441
|
+
params = {
|
|
442
|
+
"user_id": user_id,
|
|
443
|
+
"company_id": company_id,
|
|
444
|
+
"data": [
|
|
445
|
+
{
|
|
446
|
+
"rowId": "2",
|
|
447
|
+
"columns": [
|
|
448
|
+
{"columnId": "0", "columnName": "Section", "content": "Other"},
|
|
449
|
+
{"columnId": "1", "columnName": "Question", "content": "What do you know?"},
|
|
450
|
+
{
|
|
451
|
+
"columnId": "2",
|
|
452
|
+
"columnName": "Knowledge Base Answer",
|
|
453
|
+
"content": "Lorem Ipsum is simply dummy texktop publishing software.",
|
|
454
|
+
},
|
|
455
|
+
],
|
|
456
|
+
},
|
|
457
|
+
],
|
|
458
|
+
"ingestionConfiguration": {
|
|
459
|
+
"columnIdsInMetadata": ["1", "2"],
|
|
460
|
+
"columnIdsInChunkText": ["1", "2"],
|
|
461
|
+
},
|
|
462
|
+
"metadata": {
|
|
463
|
+
"libraryName": "foo",
|
|
464
|
+
},
|
|
465
|
+
"scopeId": scope_id,
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
unique_sdk.Content.ingest_magic_table_sheets(**params)
|
|
469
|
+
```
|
|
470
|
+
|
|
437
471
|
### Folder
|
|
438
472
|
|
|
473
|
+
#### `unique_sdk.Folder.get`
|
|
474
|
+
|
|
475
|
+
Get a folder by scope id or by path.
|
|
476
|
+
|
|
477
|
+
By scope id:
|
|
478
|
+
|
|
479
|
+
```python
|
|
480
|
+
unique_sdk.Folder.get_info(
|
|
481
|
+
user_id=user_id,
|
|
482
|
+
company_id=company_id,
|
|
483
|
+
scopeId="scope_w78wfn114va9o22s13r03yq",
|
|
484
|
+
)
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
By path:
|
|
488
|
+
|
|
489
|
+
```python
|
|
490
|
+
unique_sdk.Folder.get_info(
|
|
491
|
+
user_id=user_id,
|
|
492
|
+
company_id=company_id,
|
|
493
|
+
folderPath="/Company/Atlas/Due Dilligence/Arch,
|
|
494
|
+
)
|
|
495
|
+
```
|
|
496
|
+
|
|
439
497
|
#### `unique_sdk.Folder.create_paths`
|
|
440
498
|
|
|
441
499
|
Create each folder in the provided list of paths if it does not already exist.
|
|
@@ -1112,6 +1170,12 @@ All notable changes to this project will be documented in this file.
|
|
|
1112
1170
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
1113
1171
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
1114
1172
|
|
|
1173
|
+
## [0.9.33] - 2025-06-11
|
|
1174
|
+
- Add function to get a folder by id or by path.
|
|
1175
|
+
|
|
1176
|
+
## [0.9.32] - 2025-06-11
|
|
1177
|
+
- Add function to ingest magic table sheets.
|
|
1178
|
+
|
|
1115
1179
|
## [0.9.31] - 2025-05-21
|
|
1116
1180
|
- Add function to update folder access (add or remove).
|
|
1117
1181
|
|
|
@@ -16,10 +16,10 @@ unique_sdk/_webhook.py,sha256=GYxbUibQN_W4XlNTHaMIksT9FQJk4LJmlKcxOu3jqiU,2855
|
|
|
16
16
|
unique_sdk/api_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
unique_sdk/api_resources/_acronyms.py,sha256=GIU1XH1flGWQYcpsFqTYwg4ioIGxVmb15tux84nmhEg,891
|
|
18
18
|
unique_sdk/api_resources/_chat_completion.py,sha256=hAPPHxoljcoHeTboxoJkcXgpqA2hNBu6a6vamdxag58,2000
|
|
19
|
-
unique_sdk/api_resources/_content.py,sha256=
|
|
19
|
+
unique_sdk/api_resources/_content.py,sha256=BLv4qXdazSYy_L0Z9ihr0hquE3xFIY32CBpfbOkxSpE,9527
|
|
20
20
|
unique_sdk/api_resources/_embedding.py,sha256=C6qak7cCUBMBINfPhgH8taCJZ9n6w1MUElqDJJ8dG10,1281
|
|
21
21
|
unique_sdk/api_resources/_event.py,sha256=bpWF9vstdoAWbUzr-iiGP713ceP0zPk77GJXiImf9zg,374
|
|
22
|
-
unique_sdk/api_resources/_folder.py,sha256=
|
|
22
|
+
unique_sdk/api_resources/_folder.py,sha256=RYX7gQarTwu3Q-UD8YQdW0DQo3uU3Zwzl_nM-IINYJM,8360
|
|
23
23
|
unique_sdk/api_resources/_integrated.py,sha256=l1vS8kJiSLie61mqDO3KI2MNmYwFydmCIoJpP_tPhSI,2956
|
|
24
24
|
unique_sdk/api_resources/_message.py,sha256=gEDIzg3METZU2k7m69meAuf0IWmZxnYOjbBKPRMwPYE,7688
|
|
25
25
|
unique_sdk/api_resources/_message_assessment.py,sha256=SSfx6eW7zb_GKe8cFJzCqW-t-_eWEXxKP5cnIb0DhIc,2276
|
|
@@ -27,10 +27,10 @@ unique_sdk/api_resources/_search.py,sha256=pAVMXL2AdJNP5JG-7LlaU2Uw1152iUaMZ2YO7
|
|
|
27
27
|
unique_sdk/api_resources/_search_string.py,sha256=4Idw6exgZdA8qksz9WkiA68k1hTU-7yFkgT_OLU_GkE,1662
|
|
28
28
|
unique_sdk/api_resources/_short_term_memory.py,sha256=vPRN-Y0WPx74E6y-A3LocGc0TxJdzT-xGL66WzZwKRg,2820
|
|
29
29
|
unique_sdk/utils/chat_history.py,sha256=5UqL9hF1O9pV7skbNOlEibF5rHdYsmG3m5-YEPUowOs,3037
|
|
30
|
-
unique_sdk/utils/file_io.py,sha256=
|
|
30
|
+
unique_sdk/utils/file_io.py,sha256=YY8B7VJcTLOPmCXByiOfNerXGlAtjCC5EVNmAbQJ3dQ,4306
|
|
31
31
|
unique_sdk/utils/sources.py,sha256=wfboE-neMKa0Wuq9QzfAEFMkNLrIrmm0v-QF33sLo6k,4952
|
|
32
32
|
unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
|
|
33
|
-
unique_sdk-0.9.
|
|
34
|
-
unique_sdk-0.9.
|
|
35
|
-
unique_sdk-0.9.
|
|
36
|
-
unique_sdk-0.9.
|
|
33
|
+
unique_sdk-0.9.33.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
|
|
34
|
+
unique_sdk-0.9.33.dist-info/METADATA,sha256=V5_YPqBgfe0HcpWQokIZMmiK2WbHJtmoWvvH8TzGkks,37133
|
|
35
|
+
unique_sdk-0.9.33.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
36
|
+
unique_sdk-0.9.33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|