unique_sdk 0.9.28__tar.gz → 0.9.31__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.

Potentially problematic release.


This version of unique_sdk might be problematic. Click here for more details.

Files changed (37) hide show
  1. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/CHANGELOG.md +9 -0
  2. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/PKG-INFO +99 -1
  3. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/README.md +89 -0
  4. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/pyproject.toml +1 -1
  5. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/__init__.py +1 -1
  6. unique_sdk-0.9.31/unique_sdk/api_resources/_folder.py +270 -0
  7. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/LICENSE +0 -0
  8. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_api_requestor.py +0 -0
  9. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_api_resource.py +0 -0
  10. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_api_version.py +0 -0
  11. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_error.py +0 -0
  12. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_http_client.py +0 -0
  13. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_list_object.py +0 -0
  14. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_object_classes.py +0 -0
  15. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_request_options.py +0 -0
  16. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_unique_object.py +0 -0
  17. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_unique_ql.py +0 -0
  18. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_unique_response.py +0 -0
  19. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_util.py +0 -0
  20. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_version.py +0 -0
  21. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/_webhook.py +0 -0
  22. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/__init__.py +0 -0
  23. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_acronyms.py +0 -0
  24. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_chat_completion.py +0 -0
  25. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_content.py +0 -0
  26. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_embedding.py +0 -0
  27. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_event.py +0 -0
  28. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_integrated.py +0 -0
  29. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_message.py +0 -0
  30. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_message_assessment.py +0 -0
  31. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_search.py +0 -0
  32. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_search_string.py +0 -0
  33. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  34. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/utils/chat_history.py +0 -0
  35. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/utils/file_io.py +0 -0
  36. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/utils/sources.py +0 -0
  37. {unique_sdk-0.9.28 → unique_sdk-0.9.31}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.31] - 2025-05-21
9
+ - Add function to update folder access (add or remove).
10
+
11
+ ## [0.9.30] - 2025-05-21
12
+ - Add function to update folder ingestion config.
13
+
14
+ ## [0.9.29] - 2025-05-20
15
+ - Add function to create folder paths if they do not exist.
16
+
8
17
  ## [0.9.28] - 2025-05-20
9
18
  - Add function to search content info. This also allows filtering content info by metadata info.
10
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.9.28
3
+ Version: 0.9.31
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -28,6 +28,7 @@ The Unique Python SDK provides access to the public API of Unique FinanceGPT. It
28
28
  4. [Webhook Triggers](#webhook-triggers)
29
29
  5. [Available API Resources](#available-api-resources)
30
30
  - [Content](#content)
31
+ - [Folder](#folder)
31
32
  - [Message](#message)
32
33
  - [Chat Completion](#chat-completion)
33
34
  - [Embeddings](#embeddings)
@@ -36,6 +37,7 @@ The Unique Python SDK provides access to the public API of Unique FinanceGPT. It
36
37
  - [Search String](#search-string)
37
38
  - [Short Term Memory](#short-term-memory)
38
39
  - [Message Assessment](#message-assessment)
40
+ - [Folder](#folder)
39
41
  6. [UniqueQL](#uniqueql)
40
42
  - [Query Structure](#uniqueql-query-structure)
41
43
  - [Metadata Filtering](#metadata-filtering)
@@ -244,6 +246,7 @@ unique_sdk.Message.modify(
244
246
  - [Chat Completion](#chat-completion)
245
247
  - [Search](#search)
246
248
  - [Search String](#search-string)
249
+ - [Folder](#folder)
247
250
 
248
251
  Most of the API services provide an asynchronous version of the method. The async methods are suffixed with `_async`.
249
252
 
@@ -431,6 +434,92 @@ def upload_file(
431
434
 
432
435
  ```
433
436
 
437
+ ### Folder
438
+
439
+ #### `unique_sdk.Folder.create_paths`
440
+
441
+ Create each folder in the provided list of paths if it does not already exist.
442
+
443
+ ```python
444
+ unique_sdk.Folder.create_paths(
445
+ user_id=user_id,
446
+ company_id=company_id,
447
+ paths=["/unique/path1", "/unique/path2"],
448
+ )
449
+ ```
450
+
451
+ #### `unique_sdk.Folder.update_ingestion_config`
452
+
453
+ Allows you to update the ingestion config of a folder and whether to apply to the subscopes or not: `
454
+
455
+ - `ingestionConfig`
456
+ - `applyToSubScopes`
457
+
458
+ Example of updating the ingestion config of a folder and its subfolders.
459
+
460
+ ```python
461
+ unique_sdk.Folder.update_ingestion_config(
462
+ user_id=user_id,
463
+ company_id=company_id,
464
+ scope_id=scope_id,
465
+ ingestionConfig={
466
+ "chunkStrategy": "default",
467
+ "uniqueIngestionMode": "standard",
468
+ },
469
+ applyToSubScopes=True
470
+ )
471
+ ```
472
+
473
+ #### `unique_sdk.Folder.add_access`
474
+
475
+ Allows you to add access to a folder and apply to the subfolders or not: `
476
+
477
+ - `scopeAccesses`
478
+ - `applyToSubScopes`
479
+
480
+ Example of adding access to a folder and its subfolders.
481
+
482
+ ```python
483
+ unique_sdk.Folder.add_access(
484
+ user_id=user_id,
485
+ company_id=company_id,
486
+ scope_id=scope_id,
487
+ scopeAccesses=[
488
+ {
489
+ "entityId": "group_id",
490
+ "type": "WRITE",
491
+ "entityType": "GROUP",
492
+ }
493
+ ],
494
+ applyToSubScopes=True,
495
+ )
496
+ ```
497
+
498
+ #### `unique_sdk.Folder.remove_access`
499
+
500
+ Allows you to delete access from a folder and apply to the subfolders or not: `
501
+
502
+ - `scopeAccesses`
503
+ - `applyToSubScopes`
504
+
505
+ Example of deleting the access from a folder and its subfolders.
506
+
507
+ ```python
508
+ unique_sdk.Folder.remove_access(
509
+ user_id=user_id,
510
+ company_id=company_id,
511
+ scope_id=scope_id,
512
+ scopeAccesses=[
513
+ {
514
+ "entityId": "group_id",
515
+ "type": "WRITE",
516
+ "entityType": "GROUP",
517
+ }
518
+ ],
519
+ applyToSubScopes=True,
520
+ )
521
+ ```
522
+
434
523
  ### Message
435
524
 
436
525
  #### `unique_sdk.Message.list`
@@ -1023,6 +1112,15 @@ All notable changes to this project will be documented in this file.
1023
1112
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1024
1113
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1025
1114
 
1115
+ ## [0.9.31] - 2025-05-21
1116
+ - Add function to update folder access (add or remove).
1117
+
1118
+ ## [0.9.30] - 2025-05-21
1119
+ - Add function to update folder ingestion config.
1120
+
1121
+ ## [0.9.29] - 2025-05-20
1122
+ - Add function to create folder paths if they do not exist.
1123
+
1026
1124
  ## [0.9.28] - 2025-05-20
1027
1125
  - Add function to search content info. This also allows filtering content info by metadata info.
1028
1126
 
@@ -12,6 +12,7 @@ The Unique Python SDK provides access to the public API of Unique FinanceGPT. It
12
12
  4. [Webhook Triggers](#webhook-triggers)
13
13
  5. [Available API Resources](#available-api-resources)
14
14
  - [Content](#content)
15
+ - [Folder](#folder)
15
16
  - [Message](#message)
16
17
  - [Chat Completion](#chat-completion)
17
18
  - [Embeddings](#embeddings)
@@ -20,6 +21,7 @@ The Unique Python SDK provides access to the public API of Unique FinanceGPT. It
20
21
  - [Search String](#search-string)
21
22
  - [Short Term Memory](#short-term-memory)
22
23
  - [Message Assessment](#message-assessment)
24
+ - [Folder](#folder)
23
25
  6. [UniqueQL](#uniqueql)
24
26
  - [Query Structure](#uniqueql-query-structure)
25
27
  - [Metadata Filtering](#metadata-filtering)
@@ -228,6 +230,7 @@ unique_sdk.Message.modify(
228
230
  - [Chat Completion](#chat-completion)
229
231
  - [Search](#search)
230
232
  - [Search String](#search-string)
233
+ - [Folder](#folder)
231
234
 
232
235
  Most of the API services provide an asynchronous version of the method. The async methods are suffixed with `_async`.
233
236
 
@@ -415,6 +418,92 @@ def upload_file(
415
418
 
416
419
  ```
417
420
 
421
+ ### Folder
422
+
423
+ #### `unique_sdk.Folder.create_paths`
424
+
425
+ Create each folder in the provided list of paths if it does not already exist.
426
+
427
+ ```python
428
+ unique_sdk.Folder.create_paths(
429
+ user_id=user_id,
430
+ company_id=company_id,
431
+ paths=["/unique/path1", "/unique/path2"],
432
+ )
433
+ ```
434
+
435
+ #### `unique_sdk.Folder.update_ingestion_config`
436
+
437
+ Allows you to update the ingestion config of a folder and whether to apply to the subscopes or not: `
438
+
439
+ - `ingestionConfig`
440
+ - `applyToSubScopes`
441
+
442
+ Example of updating the ingestion config of a folder and its subfolders.
443
+
444
+ ```python
445
+ unique_sdk.Folder.update_ingestion_config(
446
+ user_id=user_id,
447
+ company_id=company_id,
448
+ scope_id=scope_id,
449
+ ingestionConfig={
450
+ "chunkStrategy": "default",
451
+ "uniqueIngestionMode": "standard",
452
+ },
453
+ applyToSubScopes=True
454
+ )
455
+ ```
456
+
457
+ #### `unique_sdk.Folder.add_access`
458
+
459
+ Allows you to add access to a folder and apply to the subfolders or not: `
460
+
461
+ - `scopeAccesses`
462
+ - `applyToSubScopes`
463
+
464
+ Example of adding access to a folder and its subfolders.
465
+
466
+ ```python
467
+ unique_sdk.Folder.add_access(
468
+ user_id=user_id,
469
+ company_id=company_id,
470
+ scope_id=scope_id,
471
+ scopeAccesses=[
472
+ {
473
+ "entityId": "group_id",
474
+ "type": "WRITE",
475
+ "entityType": "GROUP",
476
+ }
477
+ ],
478
+ applyToSubScopes=True,
479
+ )
480
+ ```
481
+
482
+ #### `unique_sdk.Folder.remove_access`
483
+
484
+ Allows you to delete access from a folder and apply to the subfolders or not: `
485
+
486
+ - `scopeAccesses`
487
+ - `applyToSubScopes`
488
+
489
+ Example of deleting the access from a folder and its subfolders.
490
+
491
+ ```python
492
+ unique_sdk.Folder.remove_access(
493
+ user_id=user_id,
494
+ company_id=company_id,
495
+ scope_id=scope_id,
496
+ scopeAccesses=[
497
+ {
498
+ "entityId": "group_id",
499
+ "type": "WRITE",
500
+ "entityType": "GROUP",
501
+ }
502
+ ],
503
+ applyToSubScopes=True,
504
+ )
505
+ ```
506
+
418
507
  ### Message
419
508
 
420
509
  #### `unique_sdk.Message.list`
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.9.28"
3
+ version = "0.9.31"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -80,6 +80,7 @@ from unique_sdk.api_resources._search_string import SearchString as SearchString
80
80
  from unique_sdk.api_resources._short_term_memory import (
81
81
  ShortTermMemory as ShortTermMemory,
82
82
  )
83
+ from unique_sdk.api_resources._folder import Folder as Folder
83
84
  from unique_sdk.api_resources._embedding import Embeddings as Embeddings
84
85
  from unique_sdk.api_resources._acronyms import Acronyms as Acronyms
85
86
  from unique_sdk.api_resources._message_assessment import (
@@ -87,6 +88,5 @@ from unique_sdk.api_resources._message_assessment import (
87
88
  )
88
89
 
89
90
  # Unique QL
90
-
91
91
  from unique_sdk._unique_ql import UQLOperator as UQLOperator
92
92
  from unique_sdk._unique_ql import UQLCombinator as UQLCombinator
@@ -0,0 +1,270 @@
1
+ from enum import Enum
2
+ from typing import ClassVar, List, Literal, Optional, TypedDict, Unpack, cast
3
+
4
+ from unique_sdk._api_resource import APIResource
5
+ from unique_sdk._request_options import RequestOptions
6
+
7
+
8
+ class Folder(APIResource["Folder"]):
9
+ OBJECT_NAME: ClassVar[Literal["folder"]] = "folder"
10
+ RESOURCE_URL = "/folder"
11
+
12
+ class ScopeAccess(TypedDict):
13
+ """
14
+ Represents the access level of a scope.
15
+ """
16
+
17
+ class ScopeAccessType(Enum):
18
+ """
19
+ Enum for scope access levels.
20
+ """
21
+
22
+ READ = "READ"
23
+ WRITE = "WRITE"
24
+
25
+ class ScopeAccessEntityType(Enum):
26
+ """
27
+ Enum for scope access entity types.
28
+ """
29
+
30
+ USER = "USER"
31
+ GROUP = "GROUP"
32
+
33
+ entityId: str
34
+ type: ScopeAccessType
35
+ entityType: ScopeAccessEntityType
36
+ createdAt: str | None = None
37
+
38
+ class Children(TypedDict):
39
+ """
40
+ Represents the children of a folder.
41
+ """
42
+
43
+ id: str
44
+ name: str
45
+
46
+ class CustomApiOptions(TypedDict):
47
+ apiIdentifier: str
48
+ apiPayload: str | None
49
+ customisationType: str
50
+
51
+ class VttConfig(TypedDict):
52
+ languageModel: str | None
53
+
54
+ class IngestionConfig(TypedDict):
55
+ chunkMaxTokens: int | None
56
+ chunkMaxTokensOnePager: int | None
57
+ chunkMinTokens: int | None
58
+ chunkStrategy: str | None
59
+ customApiOptions: List["Folder.CustomApiOptions"] | None
60
+ documentMinTokens: int | None
61
+ excelReadMode: str | None
62
+ jpgReadMode: str | None
63
+ pdfReadMode: str | None
64
+ pptReadMode: str | None
65
+ uniqueIngestionMode: str
66
+ vttConfig: Optional["Folder.VttConfig"]
67
+ wordReadMode: str | None
68
+
69
+ class CreatedFolder(TypedDict):
70
+ id: str
71
+ object: str
72
+ name: str
73
+ parentId: Optional[str]
74
+
75
+ class CreateFolderStructureResponse(TypedDict):
76
+ createdFolders: List["Folder.CreatedFolder"]
77
+
78
+ class CreateParams(RequestOptions):
79
+ paths: List[str]
80
+
81
+ id: str
82
+ name: str
83
+ scopeAccess: List[ScopeAccess]
84
+ children: List[Children]
85
+
86
+ class UpdateIngestionConfigParams(TypedDict):
87
+ """
88
+ Parameters for updating folder ingestion config.
89
+ """
90
+
91
+ ingestionConfig: "Folder.IngestionConfig"
92
+ applyToSubScopes: bool
93
+
94
+ class AddAccessParams(TypedDict):
95
+ """
96
+ Parameters for adding access to a folder.
97
+ """
98
+
99
+ scopeAccesses: List["Folder.ScopeAccess"]
100
+ applyToSubScopes: bool
101
+
102
+ class RemoveAccessParams(TypedDict):
103
+ """
104
+ Parameters for removing access from a folder.
105
+ """
106
+
107
+ scopeAccesses: List["Folder.ScopeAccess"]
108
+ applyToSubScopes: bool
109
+
110
+ @classmethod
111
+ def create_paths(
112
+ cls, user_id: str, company_id: str, **params: Unpack["Folder.CreateParams"]
113
+ ) -> "Folder.CreateFolderStructureResponse":
114
+ return cast(
115
+ "Folder",
116
+ cls._static_request(
117
+ "post",
118
+ cls.RESOURCE_URL,
119
+ user_id,
120
+ company_id=company_id,
121
+ params=params,
122
+ ),
123
+ )
124
+
125
+ @classmethod
126
+ async def create_paths_async(
127
+ cls, user_id: str, company_id: str, **params: Unpack["Folder.CreateParams"]
128
+ ) -> "Folder.CreateFolderStructureResponse":
129
+ return cast(
130
+ "Folder",
131
+ await cls._static_request_async(
132
+ "post",
133
+ cls.RESOURCE_URL,
134
+ user_id,
135
+ company_id=company_id,
136
+ params=params,
137
+ ),
138
+ )
139
+
140
+ @classmethod
141
+ def update_ingestion_config(
142
+ cls,
143
+ user_id: str,
144
+ company_id: str,
145
+ scope_id: str,
146
+ **params: Unpack["Folder.UpdateIngestionConfigParams"],
147
+ ) -> "Folder":
148
+ """
149
+ Update the ingestion config of a folder.
150
+ """
151
+ return cast(
152
+ "Folder",
153
+ cls._static_request(
154
+ "patch",
155
+ f"/folder/{scope_id}/ingestion-config",
156
+ user_id,
157
+ company_id,
158
+ params=params,
159
+ ),
160
+ )
161
+
162
+ @classmethod
163
+ async def update_ingestion_config_async(
164
+ cls,
165
+ user_id: str,
166
+ company_id: str,
167
+ scope_id: str,
168
+ **params: Unpack["Folder.UpdateIngestionConfigParams"],
169
+ ) -> "Folder":
170
+ """
171
+ Async update the ingestion config of a folder.
172
+ """
173
+ return cast(
174
+ "Folder",
175
+ await cls._static_request_async(
176
+ "patch",
177
+ f"/folder/{scope_id}/ingestion-config",
178
+ user_id,
179
+ company_id,
180
+ params=params,
181
+ ),
182
+ )
183
+
184
+ @classmethod
185
+ def add_access(
186
+ cls,
187
+ user_id: str,
188
+ company_id: str,
189
+ scope_id: str,
190
+ **params: Unpack["Folder.AddAccessParams"],
191
+ ) -> "Folder":
192
+ """
193
+ Add access to a folder.
194
+ """
195
+ return cast(
196
+ "Folder",
197
+ cls._static_request(
198
+ "patch",
199
+ f"/folder/{scope_id}/access",
200
+ user_id,
201
+ company_id,
202
+ params=params,
203
+ ),
204
+ )
205
+
206
+ @classmethod
207
+ async def add_access_async(
208
+ cls,
209
+ user_id: str,
210
+ company_id: str,
211
+ scope_id: str,
212
+ **params: Unpack["Folder.AddAccessParams"],
213
+ ) -> "Folder":
214
+ """
215
+ Async add access to a folder.
216
+ """
217
+ return cast(
218
+ "Folder",
219
+ await cls._static_request_async(
220
+ "patch",
221
+ f"/folder/{scope_id}/access",
222
+ user_id,
223
+ company_id,
224
+ params=params,
225
+ ),
226
+ )
227
+
228
+ @classmethod
229
+ def remove_access(
230
+ cls,
231
+ user_id: str,
232
+ company_id: str,
233
+ scope_id: str,
234
+ **params: Unpack["Folder.RemoveAccessParams"],
235
+ ) -> dict:
236
+ """
237
+ Remove access from a folder.
238
+ """
239
+ return cast(
240
+ dict,
241
+ cls._static_request(
242
+ "patch",
243
+ f"/folder/{scope_id}/remove-access",
244
+ user_id,
245
+ company_id,
246
+ params=params,
247
+ ),
248
+ )
249
+
250
+ @classmethod
251
+ async def remove_access_async(
252
+ cls,
253
+ user_id: str,
254
+ company_id: str,
255
+ scope_id: str,
256
+ **params: Unpack["Folder.RemoveAccessParams"],
257
+ ) -> "Folder":
258
+ """
259
+ Async remove access from a folder.
260
+ """
261
+ return cast(
262
+ "Folder",
263
+ await cls._static_request_async(
264
+ "patch",
265
+ f"/folder/{scope_id}/remove-access",
266
+ user_id,
267
+ company_id,
268
+ params=params,
269
+ ),
270
+ )
File without changes