unique_sdk 0.10.24__py3-none-any.whl → 0.10.26__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 +96 -27
- unique_sdk/api_resources/_folder.py +29 -42
- unique_sdk/api_resources/_message_execution.py +6 -6
- unique_sdk/api_resources/_message_log.py +9 -9
- unique_sdk/api_resources/_space.py +16 -5
- unique_sdk/utils/chat_in_space.py +3 -3
- unique_sdk/utils/file_io.py +5 -1
- {unique_sdk-0.10.24.dist-info → unique_sdk-0.10.26.dist-info}/METADATA +49 -6
- {unique_sdk-0.10.24.dist-info → unique_sdk-0.10.26.dist-info}/RECORD +11 -11
- {unique_sdk-0.10.24.dist-info → unique_sdk-0.10.26.dist-info}/LICENSE +0 -0
- {unique_sdk-0.10.24.dist-info → unique_sdk-0.10.26.dist-info}/WHEEL +0 -0
|
@@ -12,6 +12,7 @@ from typing import (
|
|
|
12
12
|
|
|
13
13
|
from typing_extensions import NotRequired, Unpack
|
|
14
14
|
|
|
15
|
+
import unique_sdk
|
|
15
16
|
from unique_sdk._api_resource import APIResource
|
|
16
17
|
from unique_sdk._request_options import RequestOptions
|
|
17
18
|
|
|
@@ -72,7 +73,7 @@ class Content(APIResource["Content"]):
|
|
|
72
73
|
|
|
73
74
|
class SearchParams(RequestOptions):
|
|
74
75
|
where: "Content.ContentWhereInput"
|
|
75
|
-
chatId: NotRequired[str]
|
|
76
|
+
chatId: NotRequired[str | None]
|
|
76
77
|
includeFailedContent: NotRequired[bool]
|
|
77
78
|
|
|
78
79
|
class ContentInfoParams(TypedDict):
|
|
@@ -81,10 +82,10 @@ class Content(APIResource["Content"]):
|
|
|
81
82
|
This is used to retrieve information about content based on various filters.
|
|
82
83
|
"""
|
|
83
84
|
|
|
84
|
-
metadataFilter: dict
|
|
85
|
-
skip: NotRequired[int]
|
|
86
|
-
take: NotRequired[int]
|
|
87
|
-
filePath: NotRequired[str]
|
|
85
|
+
metadataFilter: NotRequired[dict[str, Any] | None]
|
|
86
|
+
skip: NotRequired[int | None]
|
|
87
|
+
take: NotRequired[int | None]
|
|
88
|
+
filePath: NotRequired[str | None]
|
|
88
89
|
|
|
89
90
|
class CustomApiOptions(TypedDict):
|
|
90
91
|
apiIdentifier: str
|
|
@@ -113,23 +114,25 @@ class Content(APIResource["Content"]):
|
|
|
113
114
|
key: str
|
|
114
115
|
title: Optional[str]
|
|
115
116
|
mimeType: str
|
|
116
|
-
ownerType: str
|
|
117
|
-
ownerId: str
|
|
118
|
-
byteSize:
|
|
119
|
-
ingestionConfig: "Content.IngestionConfig"
|
|
120
|
-
metadata: dict[str, Any] | None
|
|
117
|
+
ownerType: NotRequired[str | None]
|
|
118
|
+
ownerId: NotRequired[str | None]
|
|
119
|
+
byteSize: NotRequired[int | None]
|
|
120
|
+
ingestionConfig: NotRequired["Content.IngestionConfig | None"]
|
|
121
|
+
metadata: NotRequired[dict[str, Any] | None]
|
|
121
122
|
|
|
122
123
|
class UpsertParams(RequestOptions):
|
|
123
124
|
input: "Content.Input"
|
|
124
|
-
scopeId:
|
|
125
|
-
chatId:
|
|
126
|
-
sourceOwnerType: str
|
|
127
|
-
storeInternally: bool
|
|
128
|
-
fileUrl:
|
|
125
|
+
scopeId: NotRequired[str | None]
|
|
126
|
+
chatId: NotRequired[str | None]
|
|
127
|
+
sourceOwnerType: NotRequired[str | None]
|
|
128
|
+
storeInternally: NotRequired[bool | None]
|
|
129
|
+
fileUrl: NotRequired[str | None]
|
|
129
130
|
|
|
130
131
|
class UpdateParams(RequestOptions):
|
|
131
132
|
contentId: NotRequired[str]
|
|
133
|
+
filePath: NotRequired[str]
|
|
132
134
|
ownerId: NotRequired[str]
|
|
135
|
+
parentFolderPath: NotRequired[str]
|
|
133
136
|
title: NotRequired[str]
|
|
134
137
|
metadata: NotRequired[dict[str, str | None]]
|
|
135
138
|
|
|
@@ -161,11 +164,16 @@ class Content(APIResource["Content"]):
|
|
|
161
164
|
expiredAt: str | None
|
|
162
165
|
|
|
163
166
|
class PaginatedContentInfo(TypedDict):
|
|
167
|
+
contentInfo: List["Content.ContentInfo"]
|
|
168
|
+
totalCount: int
|
|
169
|
+
|
|
170
|
+
class PaginatedContentInfos(TypedDict):
|
|
164
171
|
contentInfos: List["Content.ContentInfo"]
|
|
165
172
|
totalCount: int
|
|
166
173
|
|
|
167
174
|
class DeleteParams(RequestOptions):
|
|
168
175
|
contentId: NotRequired[str]
|
|
176
|
+
filePath: NotRequired[str]
|
|
169
177
|
chatId: NotRequired[str]
|
|
170
178
|
|
|
171
179
|
class DeleteResponse(TypedDict):
|
|
@@ -178,6 +186,8 @@ class Content(APIResource["Content"]):
|
|
|
178
186
|
updatedAt: str
|
|
179
187
|
chunks: List[Chunk]
|
|
180
188
|
metadata: Optional[Dict[str, Any]]
|
|
189
|
+
writeUrl: str
|
|
190
|
+
readUrl: str
|
|
181
191
|
|
|
182
192
|
class MagicTableSheetTableColumn(TypedDict):
|
|
183
193
|
columnId: str
|
|
@@ -284,9 +294,9 @@ class Content(APIResource["Content"]):
|
|
|
284
294
|
user_id: str,
|
|
285
295
|
company_id: str,
|
|
286
296
|
**params: Unpack["Content.ContentInfoParams"],
|
|
287
|
-
) -> "Content.
|
|
297
|
+
) -> "Content.PaginatedContentInfos":
|
|
288
298
|
return cast(
|
|
289
|
-
Content.
|
|
299
|
+
Content.PaginatedContentInfos,
|
|
290
300
|
cls._static_request(
|
|
291
301
|
"post",
|
|
292
302
|
"/content/infos",
|
|
@@ -302,9 +312,9 @@ class Content(APIResource["Content"]):
|
|
|
302
312
|
user_id: str,
|
|
303
313
|
company_id: str,
|
|
304
314
|
**params: Unpack["Content.ContentInfoParams"],
|
|
305
|
-
) -> "Content.
|
|
315
|
+
) -> "Content.PaginatedContentInfos":
|
|
306
316
|
return cast(
|
|
307
|
-
Content.
|
|
317
|
+
Content.PaginatedContentInfos,
|
|
308
318
|
await cls._static_request_async(
|
|
309
319
|
"post",
|
|
310
320
|
"/content/infos",
|
|
@@ -403,11 +413,29 @@ class Content(APIResource["Content"]):
|
|
|
403
413
|
company_id: str,
|
|
404
414
|
**params: Unpack["Content.UpdateParams"],
|
|
405
415
|
) -> "Content.ContentInfo":
|
|
416
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
417
|
+
user_id=user_id,
|
|
418
|
+
company_id=company_id,
|
|
419
|
+
content_id=params.get("contentId"),
|
|
420
|
+
file_path=params.get("filePath"),
|
|
421
|
+
)
|
|
422
|
+
owner_id = unique_sdk.Folder.resolve_scope_id_from_folder_path(
|
|
423
|
+
user_id,
|
|
424
|
+
company_id,
|
|
425
|
+
params.get("ownerId"),
|
|
426
|
+
params.get("parentFolderPath"),
|
|
427
|
+
)
|
|
428
|
+
params.pop("contentId", None)
|
|
429
|
+
params.pop("filePath", None)
|
|
430
|
+
params.pop("parentFolderPath", None)
|
|
431
|
+
if owner_id is not None:
|
|
432
|
+
params["ownerId"] = owner_id
|
|
433
|
+
|
|
406
434
|
return cast(
|
|
407
435
|
"Content.ContentInfo",
|
|
408
436
|
cls._static_request(
|
|
409
437
|
"patch",
|
|
410
|
-
f"/content/{
|
|
438
|
+
f"/content/{content_id}",
|
|
411
439
|
user_id,
|
|
412
440
|
company_id,
|
|
413
441
|
params=params,
|
|
@@ -421,11 +449,29 @@ class Content(APIResource["Content"]):
|
|
|
421
449
|
company_id: str,
|
|
422
450
|
**params: Unpack["Content.UpdateParams"],
|
|
423
451
|
) -> "Content.ContentInfo":
|
|
452
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
453
|
+
user_id,
|
|
454
|
+
company_id,
|
|
455
|
+
params.get("contentId"),
|
|
456
|
+
params.get("filePath"),
|
|
457
|
+
)
|
|
458
|
+
owner_id = unique_sdk.Folder.resolve_scope_id_from_folder_path(
|
|
459
|
+
user_id,
|
|
460
|
+
company_id,
|
|
461
|
+
params.get("ownerId"),
|
|
462
|
+
params.get("parentFolderPath"),
|
|
463
|
+
)
|
|
464
|
+
params.pop("contentId", None)
|
|
465
|
+
params.pop("filePath", None)
|
|
466
|
+
params.pop("parentFolderPath", None)
|
|
467
|
+
if owner_id is not None:
|
|
468
|
+
params["ownerId"] = owner_id
|
|
469
|
+
|
|
424
470
|
return cast(
|
|
425
471
|
"Content.ContentInfo",
|
|
426
472
|
await cls._static_request_async(
|
|
427
473
|
"patch",
|
|
428
|
-
f"/content/{
|
|
474
|
+
f"/content/{content_id}",
|
|
429
475
|
user_id,
|
|
430
476
|
company_id,
|
|
431
477
|
params=params,
|
|
@@ -437,17 +483,25 @@ class Content(APIResource["Content"]):
|
|
|
437
483
|
cls,
|
|
438
484
|
user_id: str,
|
|
439
485
|
company_id: str,
|
|
440
|
-
**params: "Content.DeleteParams",
|
|
486
|
+
**params: Unpack["Content.DeleteParams"],
|
|
441
487
|
) -> "Content.DeleteResponse":
|
|
442
488
|
"""
|
|
443
489
|
Deletes a content by its id or file path.
|
|
444
490
|
"""
|
|
491
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
492
|
+
user_id,
|
|
493
|
+
company_id,
|
|
494
|
+
params.get("contentId"),
|
|
495
|
+
params.get("filePath"),
|
|
496
|
+
)
|
|
497
|
+
params.pop("contentId", None)
|
|
498
|
+
params.pop("filePath", None)
|
|
445
499
|
|
|
446
500
|
return cast(
|
|
447
501
|
"Content.DeleteResponse",
|
|
448
502
|
cls._static_request(
|
|
449
503
|
"delete",
|
|
450
|
-
f"/content/{
|
|
504
|
+
f"/content/{content_id}",
|
|
451
505
|
user_id,
|
|
452
506
|
company_id,
|
|
453
507
|
params=params,
|
|
@@ -459,17 +513,25 @@ class Content(APIResource["Content"]):
|
|
|
459
513
|
cls,
|
|
460
514
|
user_id: str,
|
|
461
515
|
company_id: str,
|
|
462
|
-
**params: "Content.DeleteParams",
|
|
516
|
+
**params: Unpack["Content.DeleteParams"],
|
|
463
517
|
) -> "Content.DeleteResponse":
|
|
464
518
|
"""
|
|
465
519
|
Async deletes a content by its id or file path.
|
|
466
520
|
"""
|
|
521
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
522
|
+
user_id,
|
|
523
|
+
company_id,
|
|
524
|
+
params.get("contentId"),
|
|
525
|
+
params.get("filePath"),
|
|
526
|
+
)
|
|
527
|
+
params.pop("contentId", None)
|
|
528
|
+
params.pop("filePath", None)
|
|
467
529
|
|
|
468
530
|
return cast(
|
|
469
531
|
"Content.DeleteResponse",
|
|
470
532
|
await cls._static_request_async(
|
|
471
533
|
"delete",
|
|
472
|
-
f"/content/{
|
|
534
|
+
f"/content/{content_id}",
|
|
473
535
|
user_id,
|
|
474
536
|
company_id,
|
|
475
537
|
params=params,
|
|
@@ -483,10 +545,14 @@ class Content(APIResource["Content"]):
|
|
|
483
545
|
company_id: str,
|
|
484
546
|
content_id: str | None = None,
|
|
485
547
|
file_path: str | None = None,
|
|
486
|
-
) -> str:
|
|
548
|
+
) -> str | None:
|
|
487
549
|
"""
|
|
488
550
|
Returns the contentId to use: if content_id is provided, returns it;
|
|
489
551
|
if not, but file_path is provided, resolves and returns the id for that file path.
|
|
552
|
+
|
|
553
|
+
Returns:
|
|
554
|
+
str: The resolved content ID.
|
|
555
|
+
None: Failed to resolve a content ID (e.g., file_path not found or not provided).
|
|
490
556
|
"""
|
|
491
557
|
if content_id:
|
|
492
558
|
return content_id
|
|
@@ -496,9 +562,12 @@ class Content(APIResource["Content"]):
|
|
|
496
562
|
company_id=company_id,
|
|
497
563
|
filePath=file_path,
|
|
498
564
|
)
|
|
565
|
+
content_infos = file_info.get("contentInfo")
|
|
499
566
|
resolved_id = (
|
|
500
|
-
|
|
567
|
+
content_infos[0].get("id")
|
|
501
568
|
if file_info.get("totalCount", 0) > 0
|
|
569
|
+
and content_infos is not None
|
|
570
|
+
and len(content_infos) > 0
|
|
502
571
|
else None
|
|
503
572
|
)
|
|
504
573
|
if not resolved_id:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
1
|
from typing import (
|
|
3
2
|
ClassVar,
|
|
4
3
|
List,
|
|
@@ -23,26 +22,10 @@ class Folder(APIResource["Folder"]):
|
|
|
23
22
|
Represents the access level of a scope.
|
|
24
23
|
"""
|
|
25
24
|
|
|
26
|
-
class ScopeAccessType(Enum):
|
|
27
|
-
"""
|
|
28
|
-
Enum for scope access levels.
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
READ = "READ"
|
|
32
|
-
WRITE = "WRITE"
|
|
33
|
-
|
|
34
|
-
class ScopeAccessEntityType(Enum):
|
|
35
|
-
"""
|
|
36
|
-
Enum for scope access entity types.
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
USER = "USER"
|
|
40
|
-
GROUP = "GROUP"
|
|
41
|
-
|
|
42
25
|
entityId: str
|
|
43
|
-
type:
|
|
44
|
-
entityType:
|
|
45
|
-
createdAt: str
|
|
26
|
+
type: Literal["READ", "WRITE"]
|
|
27
|
+
entityType: Literal["USER", "GROUP"]
|
|
28
|
+
createdAt: NotRequired[str]
|
|
46
29
|
|
|
47
30
|
class Children(TypedDict):
|
|
48
31
|
"""
|
|
@@ -61,19 +44,19 @@ class Folder(APIResource["Folder"]):
|
|
|
61
44
|
languageModel: str | None
|
|
62
45
|
|
|
63
46
|
class IngestionConfig(TypedDict):
|
|
64
|
-
chunkMaxTokens: int | None
|
|
65
|
-
chunkMaxTokensOnePager: int | None
|
|
66
|
-
chunkMinTokens: int | None
|
|
67
|
-
chunkStrategy: str | None
|
|
68
|
-
customApiOptions: List["Folder.CustomApiOptions"] | None
|
|
69
|
-
documentMinTokens: int | None
|
|
70
|
-
excelReadMode: str | None
|
|
71
|
-
jpgReadMode: str | None
|
|
72
|
-
pdfReadMode: str | None
|
|
73
|
-
pptReadMode: str | None
|
|
47
|
+
chunkMaxTokens: NotRequired[int | None]
|
|
48
|
+
chunkMaxTokensOnePager: NotRequired[int | None]
|
|
49
|
+
chunkMinTokens: NotRequired[int | None]
|
|
50
|
+
chunkStrategy: NotRequired[str | None]
|
|
51
|
+
customApiOptions: NotRequired[List["Folder.CustomApiOptions"] | None]
|
|
52
|
+
documentMinTokens: NotRequired[int | None]
|
|
53
|
+
excelReadMode: NotRequired[str | None]
|
|
54
|
+
jpgReadMode: NotRequired[str | None]
|
|
55
|
+
pdfReadMode: NotRequired[str | None]
|
|
56
|
+
pptReadMode: NotRequired[str | None]
|
|
74
57
|
uniqueIngestionMode: str
|
|
75
|
-
vttConfig:
|
|
76
|
-
wordReadMode: str | None
|
|
58
|
+
vttConfig: NotRequired["Folder.VttConfig | None"]
|
|
59
|
+
wordReadMode: NotRequired[str | None]
|
|
77
60
|
|
|
78
61
|
class CreatedFolder(TypedDict):
|
|
79
62
|
id: str
|
|
@@ -110,8 +93,8 @@ class Folder(APIResource["Folder"]):
|
|
|
110
93
|
Parameters for updating folder ingestion config.
|
|
111
94
|
"""
|
|
112
95
|
|
|
113
|
-
scopeId: str | None
|
|
114
|
-
folderPath: str | None
|
|
96
|
+
scopeId: NotRequired[str | None]
|
|
97
|
+
folderPath: NotRequired[str | None]
|
|
115
98
|
ingestionConfig: "Folder.IngestionConfig"
|
|
116
99
|
applyToSubScopes: bool
|
|
117
100
|
|
|
@@ -120,8 +103,8 @@ class Folder(APIResource["Folder"]):
|
|
|
120
103
|
Parameters for adding access to a folder.
|
|
121
104
|
"""
|
|
122
105
|
|
|
123
|
-
scopeId: str | None
|
|
124
|
-
folderPath: str | None
|
|
106
|
+
scopeId: NotRequired[str | None]
|
|
107
|
+
folderPath: NotRequired[str | None]
|
|
125
108
|
scopeAccesses: List["Folder.ScopeAccess"]
|
|
126
109
|
applyToSubScopes: bool
|
|
127
110
|
|
|
@@ -130,8 +113,8 @@ class Folder(APIResource["Folder"]):
|
|
|
130
113
|
Parameters for removing access from a folder.
|
|
131
114
|
"""
|
|
132
115
|
|
|
133
|
-
scopeId: str | None
|
|
134
|
-
folderPath: str | None
|
|
116
|
+
scopeId: NotRequired[str | None]
|
|
117
|
+
folderPath: NotRequired[str | None]
|
|
135
118
|
scopeAccesses: List["Folder.ScopeAccess"]
|
|
136
119
|
applyToSubScopes: bool
|
|
137
120
|
|
|
@@ -149,8 +132,8 @@ class Folder(APIResource["Folder"]):
|
|
|
149
132
|
Parameters for getting a folder by its Id or path.
|
|
150
133
|
"""
|
|
151
134
|
|
|
152
|
-
scopeId: str
|
|
153
|
-
folderPath: str
|
|
135
|
+
scopeId: NotRequired[str]
|
|
136
|
+
folderPath: NotRequired[str]
|
|
154
137
|
|
|
155
138
|
class UpdateParams(RequestOptions):
|
|
156
139
|
"""
|
|
@@ -267,7 +250,7 @@ class Folder(APIResource["Folder"]):
|
|
|
267
250
|
cls, user_id: str, company_id: str, **params: Unpack["Folder.CreateParams"]
|
|
268
251
|
) -> "Folder.CreateFolderStructureResponse":
|
|
269
252
|
return cast(
|
|
270
|
-
"Folder",
|
|
253
|
+
"Folder.CreateFolderStructureResponse",
|
|
271
254
|
cls._static_request(
|
|
272
255
|
"post",
|
|
273
256
|
cls.RESOURCE_URL,
|
|
@@ -282,7 +265,7 @@ class Folder(APIResource["Folder"]):
|
|
|
282
265
|
cls, user_id: str, company_id: str, **params: Unpack["Folder.CreateParams"]
|
|
283
266
|
) -> "Folder.CreateFolderStructureResponse":
|
|
284
267
|
return cast(
|
|
285
|
-
"Folder",
|
|
268
|
+
"Folder.CreateFolderStructureResponse",
|
|
286
269
|
await cls._static_request_async(
|
|
287
270
|
"post",
|
|
288
271
|
cls.RESOURCE_URL,
|
|
@@ -562,6 +545,10 @@ class Folder(APIResource["Folder"]):
|
|
|
562
545
|
"""
|
|
563
546
|
Returns the scopeId to use: if scope_id is provided, returns it;
|
|
564
547
|
if not, but folder_path is provided, resolves and returns the id for that folder path.
|
|
548
|
+
|
|
549
|
+
Returns:
|
|
550
|
+
str: The resolved folder ID.
|
|
551
|
+
None: Failed to resolve a folder ID (e.g., folder_path not found or not provided).
|
|
565
552
|
"""
|
|
566
553
|
if scope_id:
|
|
567
554
|
return scope_id
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Literal, Unpack, cast
|
|
1
|
+
from typing import ClassVar, Literal, NotRequired, Unpack, cast
|
|
2
2
|
|
|
3
3
|
from unique_sdk._api_resource import APIResource
|
|
4
4
|
from unique_sdk._request_options import RequestOptions
|
|
@@ -15,9 +15,9 @@ class MessageExecution(APIResource["MessageExecution"]):
|
|
|
15
15
|
|
|
16
16
|
messageId: str
|
|
17
17
|
chatId: str
|
|
18
|
-
type: Literal["DEEP_RESEARCH"]
|
|
19
|
-
secondsRemaining: int | None
|
|
20
|
-
percentageCompleted: int | None
|
|
18
|
+
type: Literal["DEEP_RESEARCH"]
|
|
19
|
+
secondsRemaining: NotRequired[int | None]
|
|
20
|
+
percentageCompleted: NotRequired[int | None]
|
|
21
21
|
|
|
22
22
|
class GetMessageExecutionParams(RequestOptions):
|
|
23
23
|
"""
|
|
@@ -33,8 +33,8 @@ class MessageExecution(APIResource["MessageExecution"]):
|
|
|
33
33
|
|
|
34
34
|
messageId: str
|
|
35
35
|
status: Literal["COMPLETED", "FAILED"]
|
|
36
|
-
secondsRemaining: int | None
|
|
37
|
-
percentageCompleted: int | None
|
|
36
|
+
secondsRemaining: NotRequired[int | None]
|
|
37
|
+
percentageCompleted: NotRequired[int | None]
|
|
38
38
|
|
|
39
39
|
messageExecutionId: str | None
|
|
40
40
|
messageId: str | None
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Literal, TypedDict, Unpack, cast
|
|
1
|
+
from typing import ClassVar, Literal, NotRequired, TypedDict, Unpack, cast
|
|
2
2
|
|
|
3
3
|
from unique_sdk._api_resource import APIResource
|
|
4
4
|
from unique_sdk._request_options import RequestOptions
|
|
@@ -25,21 +25,21 @@ class MessageLog(APIResource["MessageLog"]):
|
|
|
25
25
|
text: str
|
|
26
26
|
status: Literal["RUNNING", "COMPLETED", "FAILED"]
|
|
27
27
|
order: int
|
|
28
|
-
details: dict | None
|
|
29
|
-
uncitedReferences: dict | None
|
|
30
|
-
references: list["MessageLog.Reference"] | None
|
|
28
|
+
details: NotRequired[dict | None]
|
|
29
|
+
uncitedReferences: NotRequired[dict | None]
|
|
30
|
+
references: NotRequired[list["MessageLog.Reference"] | None]
|
|
31
31
|
|
|
32
32
|
class UpdateMessageLogParams(RequestOptions):
|
|
33
33
|
"""
|
|
34
34
|
Parameters for updating a message log.
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
|
-
text: str | None
|
|
38
|
-
status: Literal["RUNNING", "COMPLETED", "FAILED"] | None
|
|
37
|
+
text: NotRequired[str | None]
|
|
38
|
+
status: NotRequired[Literal["RUNNING", "COMPLETED", "FAILED"] | None]
|
|
39
39
|
order: int
|
|
40
|
-
details: dict | None
|
|
41
|
-
uncitedReferences: dict | None
|
|
42
|
-
references: list["MessageLog.Reference"] | None
|
|
40
|
+
details: NotRequired[dict | None]
|
|
41
|
+
uncitedReferences: NotRequired[dict | None]
|
|
42
|
+
references: NotRequired[list["MessageLog.Reference"] | None]
|
|
43
43
|
|
|
44
44
|
messageLogId: str | None
|
|
45
45
|
messageId: str | None
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
from typing import
|
|
1
|
+
from typing import (
|
|
2
|
+
Any,
|
|
3
|
+
ClassVar,
|
|
4
|
+
Dict,
|
|
5
|
+
List,
|
|
6
|
+
Literal,
|
|
7
|
+
NotRequired,
|
|
8
|
+
Optional,
|
|
9
|
+
TypedDict,
|
|
10
|
+
Unpack,
|
|
11
|
+
cast,
|
|
12
|
+
)
|
|
2
13
|
|
|
3
14
|
from unique_sdk._api_resource import APIResource
|
|
4
15
|
from unique_sdk._request_options import RequestOptions
|
|
@@ -12,11 +23,11 @@ class Space(APIResource["Space"]):
|
|
|
12
23
|
Parameters for querying the assistant for a message.
|
|
13
24
|
"""
|
|
14
25
|
|
|
15
|
-
chatId: str | None
|
|
26
|
+
chatId: NotRequired[str | None]
|
|
16
27
|
assistantId: str
|
|
17
|
-
text: str | None
|
|
18
|
-
toolChoices: List[str]
|
|
19
|
-
scopeRules: dict | None
|
|
28
|
+
text: NotRequired[str | None]
|
|
29
|
+
toolChoices: NotRequired[List[str] | None]
|
|
30
|
+
scopeRules: NotRequired[dict | None]
|
|
20
31
|
|
|
21
32
|
class Reference(TypedDict):
|
|
22
33
|
"""
|
|
@@ -12,9 +12,9 @@ async def send_message_and_wait_for_completion(
|
|
|
12
12
|
company_id: str,
|
|
13
13
|
assistant_id: str,
|
|
14
14
|
text: str,
|
|
15
|
-
tool_choices: List[str] = None,
|
|
15
|
+
tool_choices: List[str] | None = None,
|
|
16
16
|
scope_rules: dict | None = None,
|
|
17
|
-
chat_id: str = None,
|
|
17
|
+
chat_id: str | None = None,
|
|
18
18
|
poll_interval: float = 1.0,
|
|
19
19
|
max_wait: float = 60.0,
|
|
20
20
|
stop_condition: Literal["stoppedStreamingAt", "completedAt"] = "stoppedStreamingAt",
|
|
@@ -152,7 +152,7 @@ async def wait_for_ingestion_completion(
|
|
|
152
152
|
user_id: str,
|
|
153
153
|
company_id: str,
|
|
154
154
|
content_id: str,
|
|
155
|
-
chat_id: str = None,
|
|
155
|
+
chat_id: str | None = None,
|
|
156
156
|
poll_interval: float = 1.0,
|
|
157
157
|
max_wait: float = 60.0,
|
|
158
158
|
):
|
unique_sdk/utils/file_io.py
CHANGED
|
@@ -110,7 +110,11 @@ def upload_file(
|
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
def download_content(
|
|
113
|
-
companyId: str,
|
|
113
|
+
companyId: str,
|
|
114
|
+
userId: str,
|
|
115
|
+
content_id: str,
|
|
116
|
+
filename: str,
|
|
117
|
+
chat_id: str | None = None,
|
|
114
118
|
):
|
|
115
119
|
# Ensure the URL is a valid string
|
|
116
120
|
if not isinstance(content_id, str):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_sdk
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.26
|
|
4
4
|
Summary:
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Martin Fadler
|
|
@@ -558,21 +558,34 @@ Allows you to ingest a magic table sheet, each row is processed and converted in
|
|
|
558
558
|
|
|
559
559
|
#### `unique_sdk.Content.update` (Compatible with release >.36)
|
|
560
560
|
|
|
561
|
-
Allows you to update a file specified by its `contentId`.
|
|
561
|
+
Allows you to update a file specified by its `contentId` or by its `filePath`.
|
|
562
562
|
|
|
563
|
-
- `contentId` the id of the file to be updated
|
|
563
|
+
- `contentId` optional if `filePath` is provided, the id of the file to be updated
|
|
564
|
+
- `filePath` optional if `contentId` is provided, the absolute path of the file to be updated
|
|
564
565
|
|
|
565
566
|
Currently, the following updates are supported:
|
|
566
567
|
|
|
567
568
|
Title update:
|
|
568
569
|
- `title` optional, allows updating the title of the file
|
|
569
570
|
|
|
570
|
-
Move the file to a different folder.
|
|
571
|
-
- `ownerId` optional, allows moving the file to a different folder. Represents the new folder for the file and it should be the id of a folder e.g.: `scope_dhjfieurfloakmdle`.
|
|
571
|
+
Move the file to a different folder. This can be done by specifying either the `ownerId` or the `parentFolderPath`.
|
|
572
|
+
- `ownerId` optional, allows moving the file to a different folder. Represents the new folder for the file and it should be the id of a folder e.g.: `scope_dhjfieurfloakmdle`.
|
|
573
|
+
- `parentFolderPath` optional, allows moving the file to a different folder. Represents the path new folder for the file.
|
|
572
574
|
|
|
573
575
|
Metadata update:
|
|
574
576
|
- `metadata` optional, allows updating the metadata of the file. Default metadata can not be ovrriden. (Available with release >.40)
|
|
575
577
|
|
|
578
|
+
Example of updating the title of a file specified by its path.
|
|
579
|
+
|
|
580
|
+
```python
|
|
581
|
+
unique_sdk.Content.update(
|
|
582
|
+
user_id=user_id,
|
|
583
|
+
company_id=company_id,
|
|
584
|
+
filePath="/Company/finance/january.xls",
|
|
585
|
+
title="Revision Deck"
|
|
586
|
+
)
|
|
587
|
+
```
|
|
588
|
+
|
|
576
589
|
Example of moving a file specified by its content id.
|
|
577
590
|
|
|
578
591
|
```python
|
|
@@ -599,12 +612,25 @@ unique_sdk.Content.update(
|
|
|
599
612
|
)
|
|
600
613
|
```
|
|
601
614
|
|
|
615
|
+
Example of moving a file to a folder specified by its path.
|
|
616
|
+
|
|
617
|
+
```python
|
|
618
|
+
unique_sdk.Content.update(
|
|
619
|
+
user_id=user_id,
|
|
620
|
+
company_id=company_id,
|
|
621
|
+
contentId="cont_ok2343q5owbce80w78hudawu5",
|
|
622
|
+
ownerId="scope_e68yz5asho7glfh7c7d041el",
|
|
623
|
+
parentFolderPath="/Company/Revisions"
|
|
624
|
+
)
|
|
625
|
+
```
|
|
626
|
+
|
|
602
627
|
#### `unique_sdk.Content.delete` (Compatible with release >.36)
|
|
603
628
|
|
|
604
629
|
Allows you to delete a file by its `contentId`. If the file is part of a chat, the `chatId` also needs do be set.
|
|
605
630
|
|
|
606
|
-
- `contentId` the id of the file to be deleted
|
|
631
|
+
- `contentId` optional if `filePath` is provided, the id of the file to be deleted
|
|
607
632
|
- `chatId` optional, the id of the chat where the file is. Only needed if the file is part of a chat
|
|
633
|
+
- `filePath` optional if `contentId` is provided, the absolute path of the file to be deleted
|
|
608
634
|
|
|
609
635
|
Example of deleting a file from a chat.
|
|
610
636
|
|
|
@@ -617,6 +643,17 @@ unique_sdk.Content.delete(
|
|
|
617
643
|
)
|
|
618
644
|
```
|
|
619
645
|
|
|
646
|
+
Example of deleting a file by its path.
|
|
647
|
+
|
|
648
|
+
```python
|
|
649
|
+
unique_sdk.Content.delete(
|
|
650
|
+
user_id=user_id,
|
|
651
|
+
company_id=company_id,
|
|
652
|
+
filePath="/Company/finance/january.xls",
|
|
653
|
+
)
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
|
|
620
657
|
### Message
|
|
621
658
|
|
|
622
659
|
#### `unique_sdk.Message.list`
|
|
@@ -1625,6 +1662,12 @@ All notable changes to this project will be documented in this file.
|
|
|
1625
1662
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
1626
1663
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
1627
1664
|
|
|
1665
|
+
## [0.10.26] - 2025-09-22
|
|
1666
|
+
- Improve typing.
|
|
1667
|
+
|
|
1668
|
+
## [0.10.25] - 2025-09-18
|
|
1669
|
+
- Add support for udpate and delete files by file or folder path.
|
|
1670
|
+
|
|
1628
1671
|
## [0.10.24] - 2025-09-17
|
|
1629
1672
|
- Add function to update a folder.
|
|
1630
1673
|
|
|
@@ -17,26 +17,26 @@ unique_sdk/api_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
17
17
|
unique_sdk/api_resources/_acronyms.py,sha256=GIU1XH1flGWQYcpsFqTYwg4ioIGxVmb15tux84nmhEg,891
|
|
18
18
|
unique_sdk/api_resources/_agentic_table.py,sha256=8-_f7t-m_iiiOj2835iESoxz91YRxl4-tkxpzQbgdcI,9958
|
|
19
19
|
unique_sdk/api_resources/_chat_completion.py,sha256=ILCAffxkbkfh2iV9L4KKnfe80gZmT9pWfkNmf3mq68U,2172
|
|
20
|
-
unique_sdk/api_resources/_content.py,sha256=
|
|
20
|
+
unique_sdk/api_resources/_content.py,sha256=XKIm5F6MnFGa0B8aTc4okFfBtAJAqtUmKB8-1tXLmrM,16651
|
|
21
21
|
unique_sdk/api_resources/_embedding.py,sha256=C6qak7cCUBMBINfPhgH8taCJZ9n6w1MUElqDJJ8dG10,1281
|
|
22
22
|
unique_sdk/api_resources/_event.py,sha256=bpWF9vstdoAWbUzr-iiGP713ceP0zPk77GJXiImf9zg,374
|
|
23
|
-
unique_sdk/api_resources/_folder.py,sha256=
|
|
23
|
+
unique_sdk/api_resources/_folder.py,sha256=mEKN3llhgi2Zyg-aVyz_LUU55V5ZGOKhgKytlyxBVF8,15679
|
|
24
24
|
unique_sdk/api_resources/_integrated.py,sha256=O8e673z-RB7FRFMQYn_YEuHijebr5W7KJxkUnymbBZk,6164
|
|
25
25
|
unique_sdk/api_resources/_mcp.py,sha256=zKh0dyn0QnkKk57N2zlGVN_GQoxEp5T2CS38vVm6jQY,3341
|
|
26
26
|
unique_sdk/api_resources/_message.py,sha256=gEDIzg3METZU2k7m69meAuf0IWmZxnYOjbBKPRMwPYE,7688
|
|
27
27
|
unique_sdk/api_resources/_message_assessment.py,sha256=SSfx6eW7zb_GKe8cFJzCqW-t-_eWEXxKP5cnIb0DhIc,2276
|
|
28
|
-
unique_sdk/api_resources/_message_execution.py,sha256=
|
|
29
|
-
unique_sdk/api_resources/_message_log.py,sha256=
|
|
28
|
+
unique_sdk/api_resources/_message_execution.py,sha256=qQH9NS8sdWLr55Yzc8pvPpYdfpewtSh6fy2alJjEoZk,4444
|
|
29
|
+
unique_sdk/api_resources/_message_log.py,sha256=gV8hhzR_fgS28Ofpir6BjzuSyH6hXZgm8Pt3u0Onv2M,3658
|
|
30
30
|
unique_sdk/api_resources/_search.py,sha256=GQItZKoGNOVZfkLLltBmsRZYBIreRKU0lGW8Kgpj1_Q,1959
|
|
31
31
|
unique_sdk/api_resources/_search_string.py,sha256=4Idw6exgZdA8qksz9WkiA68k1hTU-7yFkgT_OLU_GkE,1662
|
|
32
32
|
unique_sdk/api_resources/_short_term_memory.py,sha256=vPRN-Y0WPx74E6y-A3LocGc0TxJdzT-xGL66WzZwKRg,2820
|
|
33
|
-
unique_sdk/api_resources/_space.py,sha256=
|
|
33
|
+
unique_sdk/api_resources/_space.py,sha256=Z84k8blttHS5OjHIahZdddTL-HvYZGBolfCANwETaDE,4994
|
|
34
34
|
unique_sdk/utils/chat_history.py,sha256=5UqL9hF1O9pV7skbNOlEibF5rHdYsmG3m5-YEPUowOs,3037
|
|
35
|
-
unique_sdk/utils/chat_in_space.py,sha256=
|
|
36
|
-
unique_sdk/utils/file_io.py,sha256=
|
|
35
|
+
unique_sdk/utils/chat_in_space.py,sha256=CsrGGDRR-OUDjqKi4fjH2MGPcWta2pVpRnLUHvgT5vw,5970
|
|
36
|
+
unique_sdk/utils/file_io.py,sha256=sJS-dJLjogG65mLukDO9pGDpKVTP4LhIgiZASnCvjNI,4330
|
|
37
37
|
unique_sdk/utils/sources.py,sha256=DoxxhMLcLhmDfNarjXa41H4JD2GSSDywr71hiC-4pYc,4952
|
|
38
38
|
unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
|
|
39
|
-
unique_sdk-0.10.
|
|
40
|
-
unique_sdk-0.10.
|
|
41
|
-
unique_sdk-0.10.
|
|
42
|
-
unique_sdk-0.10.
|
|
39
|
+
unique_sdk-0.10.26.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
|
|
40
|
+
unique_sdk-0.10.26.dist-info/METADATA,sha256=Fn0Q9GliTYJrJHoBtYZ15ELJRrKUUFEl_S0P4qikuZQ,57656
|
|
41
|
+
unique_sdk-0.10.26.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
42
|
+
unique_sdk-0.10.26.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|