unique_sdk 0.10.4__py3-none-any.whl → 0.10.5__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.
Potentially problematic release.
This version of unique_sdk might be problematic. Click here for more details.
- unique_sdk/api_resources/_content.py +41 -5
- unique_sdk/api_resources/_folder.py +56 -2
- {unique_sdk-0.10.4.dist-info → unique_sdk-0.10.5.dist-info}/METADATA +100 -4
- {unique_sdk-0.10.4.dist-info → unique_sdk-0.10.5.dist-info}/RECORD +6 -6
- {unique_sdk-0.10.4.dist-info → unique_sdk-0.10.5.dist-info}/LICENSE +0 -0
- {unique_sdk-0.10.4.dist-info → unique_sdk-0.10.5.dist-info}/WHEEL +0 -0
|
@@ -73,8 +73,8 @@ class Content(APIResource["Content"]):
|
|
|
73
73
|
"""
|
|
74
74
|
|
|
75
75
|
metadataFilter: dict
|
|
76
|
-
skip: int
|
|
77
|
-
take: int
|
|
76
|
+
skip: NotRequired[int]
|
|
77
|
+
take: NotRequired[int]
|
|
78
78
|
|
|
79
79
|
class CustomApiOptions(TypedDict):
|
|
80
80
|
apiIdentifier: str
|
|
@@ -145,7 +145,7 @@ class Content(APIResource["Content"]):
|
|
|
145
145
|
expiredAt: str | None
|
|
146
146
|
|
|
147
147
|
class PaginatedContentInfo(TypedDict):
|
|
148
|
-
|
|
148
|
+
contentInfos: List["Content.ContentInfo"]
|
|
149
149
|
totalCount: int
|
|
150
150
|
|
|
151
151
|
id: str
|
|
@@ -230,7 +230,7 @@ class Content(APIResource["Content"]):
|
|
|
230
230
|
Content.PaginatedContentInfo,
|
|
231
231
|
cls._static_request(
|
|
232
232
|
"post",
|
|
233
|
-
"/content/
|
|
233
|
+
"/content/infos",
|
|
234
234
|
user_id,
|
|
235
235
|
company_id,
|
|
236
236
|
params=params,
|
|
@@ -248,7 +248,43 @@ class Content(APIResource["Content"]):
|
|
|
248
248
|
Content.PaginatedContentInfo,
|
|
249
249
|
await cls._static_request_async(
|
|
250
250
|
"post",
|
|
251
|
-
"/content/
|
|
251
|
+
"/content/infos",
|
|
252
|
+
user_id,
|
|
253
|
+
company_id,
|
|
254
|
+
params=params,
|
|
255
|
+
),
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
@classmethod
|
|
259
|
+
def get_infos(
|
|
260
|
+
cls,
|
|
261
|
+
user_id: str,
|
|
262
|
+
company_id: str,
|
|
263
|
+
**params: Unpack["Content.ContentInfoParams"],
|
|
264
|
+
) -> "Content.PaginatedContentInfo":
|
|
265
|
+
return cast(
|
|
266
|
+
Content.PaginatedContentInfo,
|
|
267
|
+
cls._static_request(
|
|
268
|
+
"post",
|
|
269
|
+
"/content/infos",
|
|
270
|
+
user_id,
|
|
271
|
+
company_id,
|
|
272
|
+
params=params,
|
|
273
|
+
),
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
@classmethod
|
|
277
|
+
async def get_infos_async(
|
|
278
|
+
cls,
|
|
279
|
+
user_id: str,
|
|
280
|
+
company_id: str,
|
|
281
|
+
**params: Unpack["Content.ContentInfoParams"],
|
|
282
|
+
) -> "Content.PaginatedContentInfo":
|
|
283
|
+
return cast(
|
|
284
|
+
Content.PaginatedContentInfo,
|
|
285
|
+
await cls._static_request_async(
|
|
286
|
+
"post",
|
|
287
|
+
"/content/infos",
|
|
252
288
|
user_id,
|
|
253
289
|
company_id,
|
|
254
290
|
params=params,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import (
|
|
3
|
+
ClassVar,
|
|
4
|
+
List,
|
|
5
|
+
Literal,
|
|
6
|
+
NotRequired,
|
|
7
|
+
Optional,
|
|
8
|
+
TypedDict,
|
|
9
|
+
Unpack,
|
|
10
|
+
cast,
|
|
11
|
+
)
|
|
3
12
|
|
|
4
13
|
from unique_sdk._api_resource import APIResource
|
|
5
14
|
from unique_sdk._request_options import RequestOptions
|
|
@@ -128,12 +137,21 @@ class Folder(APIResource["Folder"]):
|
|
|
128
137
|
|
|
129
138
|
class GetParams(RequestOptions):
|
|
130
139
|
"""
|
|
131
|
-
Parameters for getting a folder by its
|
|
140
|
+
Parameters for getting a folder by its Id or path.
|
|
132
141
|
"""
|
|
133
142
|
|
|
134
143
|
scopeId: str | None = None
|
|
135
144
|
folderPath: str | None = None
|
|
136
145
|
|
|
146
|
+
class GetInfosParams(RequestOptions):
|
|
147
|
+
"""
|
|
148
|
+
Parameters for getting multiple paginated folders by their parent Id.
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
parentId: NotRequired[str]
|
|
152
|
+
take: NotRequired[int]
|
|
153
|
+
skip: NotRequired[int]
|
|
154
|
+
|
|
137
155
|
@classmethod
|
|
138
156
|
def get_info(
|
|
139
157
|
cls, user_id: str, company_id: str, **params: Unpack["Folder.GetParams"]
|
|
@@ -170,6 +188,42 @@ class Folder(APIResource["Folder"]):
|
|
|
170
188
|
),
|
|
171
189
|
)
|
|
172
190
|
|
|
191
|
+
@classmethod
|
|
192
|
+
def get_infos(
|
|
193
|
+
cls, user_id: str, company_id: str, **params: Unpack["Folder.GetInfosParams"]
|
|
194
|
+
) -> "List[Folder.FolderInfo]":
|
|
195
|
+
"""
|
|
196
|
+
Get paginated folders based on parentId. If the parentId is not defined, the root folders will be returned.
|
|
197
|
+
"""
|
|
198
|
+
return cast(
|
|
199
|
+
"List[Folder.FolderInfo]",
|
|
200
|
+
cls._static_request(
|
|
201
|
+
"get",
|
|
202
|
+
"/folder/infos",
|
|
203
|
+
user_id,
|
|
204
|
+
company_id,
|
|
205
|
+
params=params,
|
|
206
|
+
),
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
@classmethod
|
|
210
|
+
async def get_infos_async(
|
|
211
|
+
cls, user_id: str, company_id: str, **params: Unpack["Folder.GetInfosParams"]
|
|
212
|
+
) -> "List[Folder.FolderInfo]":
|
|
213
|
+
"""
|
|
214
|
+
Async get paginated folders based on parentId. If the parentId is not defined, the root folders will be returned.
|
|
215
|
+
"""
|
|
216
|
+
return cast(
|
|
217
|
+
"List[Folder.FolderInfo]",
|
|
218
|
+
await cls._static_request_async(
|
|
219
|
+
"get",
|
|
220
|
+
"/folder/infos",
|
|
221
|
+
user_id,
|
|
222
|
+
company_id,
|
|
223
|
+
params=params,
|
|
224
|
+
),
|
|
225
|
+
)
|
|
226
|
+
|
|
173
227
|
@classmethod
|
|
174
228
|
def create_paths(
|
|
175
229
|
cls, user_id: str, company_id: str, **params: Unpack["Folder.CreateParams"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_sdk
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.5
|
|
4
4
|
Summary:
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Martin Fadler
|
|
@@ -294,7 +294,7 @@ unique_sdk.Content.search(
|
|
|
294
294
|
|
|
295
295
|
#### `unique_sdk.Content.get_info`
|
|
296
296
|
|
|
297
|
-
Allows you to get content info. To filter the results you can define a metadata filter in UniqueQL language. Find out more about it in the UniqueQL section. An example of a metadata filter defined with UniqueQL is the following:
|
|
297
|
+
[Deprecated, use `unique_sdk.Content.get_infos` instead.] Allows you to get content info. To filter the results you can define a metadata filter in UniqueQL language. Find out more about it in the UniqueQL section. An example of a metadata filter defined with UniqueQL is the following:
|
|
298
298
|
|
|
299
299
|
```python
|
|
300
300
|
metadataFilter: {
|
|
@@ -326,7 +326,7 @@ Pagination is also enabled for this functionality, and the default number of ret
|
|
|
326
326
|
- `skip`
|
|
327
327
|
- `take`
|
|
328
328
|
|
|
329
|
-
Here is an example of retrieving the first 3 content infos that contain the value `uniquepathid://scope_abcdibgznc4bkdcx120zm5d` in the `folderIdPath` metadata and the value `ai` for the `
|
|
329
|
+
Here is an example of retrieving the first 3 content infos that contain the value `uniquepathid://scope_abcdibgznc4bkdcx120zm5d` in the `folderIdPath` metadata and the value `ai` for the `title` metadata.
|
|
330
330
|
|
|
331
331
|
```python
|
|
332
332
|
content_info_result = unique_sdk.Content.get_info(
|
|
@@ -359,6 +359,85 @@ content_info_result = unique_sdk.Content.get_info(
|
|
|
359
359
|
)
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
+
#### `unique_sdk.Content.get_infos`
|
|
363
|
+
|
|
364
|
+
Allows you to get content infos. To filter the results you can define a either metadata filter in UniqueQL language or specify a parentId. If both are defined, the function will throw an error.
|
|
365
|
+
|
|
366
|
+
I f you want to learn more about UniqueQL, you can find out more about it in the [UniqueQL](#uniqueql) section. An example of a metadata filter defined with UniqueQL is the following:
|
|
367
|
+
|
|
368
|
+
```python
|
|
369
|
+
metadataFilter: {
|
|
370
|
+
"or": [
|
|
371
|
+
{
|
|
372
|
+
"and": [
|
|
373
|
+
{
|
|
374
|
+
"operator": "contains",
|
|
375
|
+
"path": [
|
|
376
|
+
"folderIdPath"
|
|
377
|
+
],
|
|
378
|
+
"value": "uniquepathid://test_id"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"operator": "contains",
|
|
382
|
+
"path": [
|
|
383
|
+
"title"
|
|
384
|
+
],
|
|
385
|
+
"value": "ai"
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
},
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Pagination is also enabled for this functionality, and the default number of returned results is 50 with no entries skipped. Use the following paramteres to get the desired page:`
|
|
394
|
+
|
|
395
|
+
- `skip`
|
|
396
|
+
- `take`
|
|
397
|
+
|
|
398
|
+
Here is an example of retrieving the first 3 content infos that contain the value `uniquepathid://scope_abcdibgznc4bkdcx120zm5d` in the `folderIdPath` metadata and the value `ai` for the `title` metadata.
|
|
399
|
+
|
|
400
|
+
```python
|
|
401
|
+
content_info_result = unique_sdk.Content.get_infos(
|
|
402
|
+
user_id=user_id,
|
|
403
|
+
company_id=company_id,
|
|
404
|
+
metadataFilter={
|
|
405
|
+
"or": [
|
|
406
|
+
{
|
|
407
|
+
"and": [
|
|
408
|
+
{
|
|
409
|
+
"operator": "contains",
|
|
410
|
+
"path": [
|
|
411
|
+
"folderIdPath"
|
|
412
|
+
],
|
|
413
|
+
"value": "uniquepathid://scope_abcdibgznc4bkdcx120zm5d"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"operator": "contains",
|
|
417
|
+
"path": [
|
|
418
|
+
"title"
|
|
419
|
+
],
|
|
420
|
+
"value": "ai"
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
]
|
|
425
|
+
},
|
|
426
|
+
skip=0,
|
|
427
|
+
take=3,
|
|
428
|
+
)
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Here is an example of retrieving the contents based on a parentId.
|
|
432
|
+
|
|
433
|
+
```python
|
|
434
|
+
content_info_result = unique_sdk.Content.get_infos(
|
|
435
|
+
user_id=user_id,
|
|
436
|
+
company_id=company_id,
|
|
437
|
+
parentId="scope_ahefgj389srjbfejkkk98u"
|
|
438
|
+
)
|
|
439
|
+
```
|
|
440
|
+
|
|
362
441
|
#### `unique_sdk.Content.upsert`
|
|
363
442
|
|
|
364
443
|
Enables upload of a new Content into the Knowledge base of unique into a specific scope with `scopeId` or a specific `chatId`. One of the two must be set.
|
|
@@ -820,7 +899,7 @@ assessment = unique_sdk.MessageAssessment.modify(
|
|
|
820
899
|
|
|
821
900
|
### Folder
|
|
822
901
|
|
|
823
|
-
#### `unique_sdk.Folder.
|
|
902
|
+
#### `unique_sdk.Folder.get_info`
|
|
824
903
|
|
|
825
904
|
Get a folder by scope id or by path.
|
|
826
905
|
|
|
@@ -844,6 +923,20 @@ unique_sdk.Folder.get_info(
|
|
|
844
923
|
)
|
|
845
924
|
```
|
|
846
925
|
|
|
926
|
+
#### `unique_sdl.Folder.get_infos`
|
|
927
|
+
|
|
928
|
+
Get paginated folders info based on parentId. If the parentId is not defined, the root folders will be returned.
|
|
929
|
+
|
|
930
|
+
```python
|
|
931
|
+
unique_sdk.Folder.get_infos(
|
|
932
|
+
user_id=user_id,
|
|
933
|
+
company_id=company_id,
|
|
934
|
+
take=10, #optional
|
|
935
|
+
skip=5, #optional
|
|
936
|
+
parentId="scope_s18seqpnltf35niydg77xgyp" #optional
|
|
937
|
+
)
|
|
938
|
+
```
|
|
939
|
+
|
|
847
940
|
#### `unique_sdk.Folder.create_paths`
|
|
848
941
|
|
|
849
942
|
Create each folder in the provided list of paths if it does not already exist.
|
|
@@ -1371,6 +1464,9 @@ All notable changes to this project will be documented in this file.
|
|
|
1371
1464
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
1372
1465
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
1373
1466
|
|
|
1467
|
+
## [0.10.5] - 2025-08-06
|
|
1468
|
+
- Get paginated files and folders info.
|
|
1469
|
+
|
|
1374
1470
|
## [0.10.4] - 2025-08-05
|
|
1375
1471
|
- Add support for reasoning API with streaming within a chat.
|
|
1376
1472
|
|
|
@@ -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=ILCAffxkbkfh2iV9L4KKnfe80gZmT9pWfkNmf3mq68U,2172
|
|
19
|
-
unique_sdk/api_resources/_content.py,sha256=
|
|
19
|
+
unique_sdk/api_resources/_content.py,sha256=Z7fyydfUzN56htj8_PXBBATyjX58tlVekvyUnj5yAHo,10505
|
|
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=rDO3rHNddvVWBhM4gaut9WN1A_hASJHiFiAS6a8MszU,9772
|
|
23
23
|
unique_sdk/api_resources/_integrated.py,sha256=z_DrftwjgVCi10QQqRYnG5_-95kD7Kfjogbb-dmnJuA,5854
|
|
24
24
|
unique_sdk/api_resources/_mcp.py,sha256=jBHf89LrjdYKoMeKJHyzKWih870VvXvGIl7hpf8dGIU,3353
|
|
25
25
|
unique_sdk/api_resources/_message.py,sha256=gEDIzg3METZU2k7m69meAuf0IWmZxnYOjbBKPRMwPYE,7688
|
|
@@ -33,7 +33,7 @@ unique_sdk/utils/chat_in_space.py,sha256=nYmgQYhIxqQex_6zjdCfNuGnjoU14WkxUN6_zmS
|
|
|
33
33
|
unique_sdk/utils/file_io.py,sha256=YY8B7VJcTLOPmCXByiOfNerXGlAtjCC5EVNmAbQJ3dQ,4306
|
|
34
34
|
unique_sdk/utils/sources.py,sha256=wfboE-neMKa0Wuq9QzfAEFMkNLrIrmm0v-QF33sLo6k,4952
|
|
35
35
|
unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
|
|
36
|
-
unique_sdk-0.10.
|
|
37
|
-
unique_sdk-0.10.
|
|
38
|
-
unique_sdk-0.10.
|
|
39
|
-
unique_sdk-0.10.
|
|
36
|
+
unique_sdk-0.10.5.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
|
|
37
|
+
unique_sdk-0.10.5.dist-info/METADATA,sha256=1bVLFeyqncNXAgxnnbY9P-oShXFuzED4cWPPwEadTNo,49000
|
|
38
|
+
unique_sdk-0.10.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
39
|
+
unique_sdk-0.10.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|