unique_sdk 0.9.28__tar.gz → 0.9.32__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.
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/CHANGELOG.md +12 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/PKG-INFO +136 -1
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/README.md +123 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/pyproject.toml +1 -1
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/__init__.py +1 -1
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_content.py +63 -1
- unique_sdk-0.9.32/unique_sdk/api_resources/_folder.py +270 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/utils/file_io.py +2 -2
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/LICENSE +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_api_requestor.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_api_resource.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_api_version.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_error.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_http_client.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_list_object.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_object_classes.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_request_options.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_unique_object.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_unique_ql.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_unique_response.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_util.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_version.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/_webhook.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/__init__.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_acronyms.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_chat_completion.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_embedding.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_event.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_integrated.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_message.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_message_assessment.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_search.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_search_string.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/api_resources/_short_term_memory.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/utils/chat_history.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/utils/sources.py +0 -0
- {unique_sdk-0.9.28 → unique_sdk-0.9.32}/unique_sdk/utils/token.py +0 -0
|
@@ -5,6 +5,18 @@ 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.32] - 2025-06-11
|
|
9
|
+
- Add function to ingest magic table sheets.
|
|
10
|
+
|
|
11
|
+
## [0.9.31] - 2025-05-21
|
|
12
|
+
- Add function to update folder access (add or remove).
|
|
13
|
+
|
|
14
|
+
## [0.9.30] - 2025-05-21
|
|
15
|
+
- Add function to update folder ingestion config.
|
|
16
|
+
|
|
17
|
+
## [0.9.29] - 2025-05-20
|
|
18
|
+
- Add function to create folder paths if they do not exist.
|
|
19
|
+
|
|
8
20
|
## [0.9.28] - 2025-05-20
|
|
9
21
|
- Add function to search content info. This also allows filtering content info by metadata info.
|
|
10
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.32
|
|
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,126 @@ def upload_file(
|
|
|
431
434
|
|
|
432
435
|
```
|
|
433
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
|
+
|
|
471
|
+
### Folder
|
|
472
|
+
|
|
473
|
+
#### `unique_sdk.Folder.create_paths`
|
|
474
|
+
|
|
475
|
+
Create each folder in the provided list of paths if it does not already exist.
|
|
476
|
+
|
|
477
|
+
```python
|
|
478
|
+
unique_sdk.Folder.create_paths(
|
|
479
|
+
user_id=user_id,
|
|
480
|
+
company_id=company_id,
|
|
481
|
+
paths=["/unique/path1", "/unique/path2"],
|
|
482
|
+
)
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### `unique_sdk.Folder.update_ingestion_config`
|
|
486
|
+
|
|
487
|
+
Allows you to update the ingestion config of a folder and whether to apply to the subscopes or not: `
|
|
488
|
+
|
|
489
|
+
- `ingestionConfig`
|
|
490
|
+
- `applyToSubScopes`
|
|
491
|
+
|
|
492
|
+
Example of updating the ingestion config of a folder and its subfolders.
|
|
493
|
+
|
|
494
|
+
```python
|
|
495
|
+
unique_sdk.Folder.update_ingestion_config(
|
|
496
|
+
user_id=user_id,
|
|
497
|
+
company_id=company_id,
|
|
498
|
+
scope_id=scope_id,
|
|
499
|
+
ingestionConfig={
|
|
500
|
+
"chunkStrategy": "default",
|
|
501
|
+
"uniqueIngestionMode": "standard",
|
|
502
|
+
},
|
|
503
|
+
applyToSubScopes=True
|
|
504
|
+
)
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
#### `unique_sdk.Folder.add_access`
|
|
508
|
+
|
|
509
|
+
Allows you to add access to a folder and apply to the subfolders or not: `
|
|
510
|
+
|
|
511
|
+
- `scopeAccesses`
|
|
512
|
+
- `applyToSubScopes`
|
|
513
|
+
|
|
514
|
+
Example of adding access to a folder and its subfolders.
|
|
515
|
+
|
|
516
|
+
```python
|
|
517
|
+
unique_sdk.Folder.add_access(
|
|
518
|
+
user_id=user_id,
|
|
519
|
+
company_id=company_id,
|
|
520
|
+
scope_id=scope_id,
|
|
521
|
+
scopeAccesses=[
|
|
522
|
+
{
|
|
523
|
+
"entityId": "group_id",
|
|
524
|
+
"type": "WRITE",
|
|
525
|
+
"entityType": "GROUP",
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
applyToSubScopes=True,
|
|
529
|
+
)
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
#### `unique_sdk.Folder.remove_access`
|
|
533
|
+
|
|
534
|
+
Allows you to delete access from a folder and apply to the subfolders or not: `
|
|
535
|
+
|
|
536
|
+
- `scopeAccesses`
|
|
537
|
+
- `applyToSubScopes`
|
|
538
|
+
|
|
539
|
+
Example of deleting the access from a folder and its subfolders.
|
|
540
|
+
|
|
541
|
+
```python
|
|
542
|
+
unique_sdk.Folder.remove_access(
|
|
543
|
+
user_id=user_id,
|
|
544
|
+
company_id=company_id,
|
|
545
|
+
scope_id=scope_id,
|
|
546
|
+
scopeAccesses=[
|
|
547
|
+
{
|
|
548
|
+
"entityId": "group_id",
|
|
549
|
+
"type": "WRITE",
|
|
550
|
+
"entityType": "GROUP",
|
|
551
|
+
}
|
|
552
|
+
],
|
|
553
|
+
applyToSubScopes=True,
|
|
554
|
+
)
|
|
555
|
+
```
|
|
556
|
+
|
|
434
557
|
### Message
|
|
435
558
|
|
|
436
559
|
#### `unique_sdk.Message.list`
|
|
@@ -1023,6 +1146,18 @@ All notable changes to this project will be documented in this file.
|
|
|
1023
1146
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
1024
1147
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
1025
1148
|
|
|
1149
|
+
## [0.9.32] - 2025-06-11
|
|
1150
|
+
- Add function to ingest magic table sheets.
|
|
1151
|
+
|
|
1152
|
+
## [0.9.31] - 2025-05-21
|
|
1153
|
+
- Add function to update folder access (add or remove).
|
|
1154
|
+
|
|
1155
|
+
## [0.9.30] - 2025-05-21
|
|
1156
|
+
- Add function to update folder ingestion config.
|
|
1157
|
+
|
|
1158
|
+
## [0.9.29] - 2025-05-20
|
|
1159
|
+
- Add function to create folder paths if they do not exist.
|
|
1160
|
+
|
|
1026
1161
|
## [0.9.28] - 2025-05-20
|
|
1027
1162
|
- Add function to search content info. This also allows filtering content info by metadata info.
|
|
1028
1163
|
|
|
@@ -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,126 @@ def upload_file(
|
|
|
415
418
|
|
|
416
419
|
```
|
|
417
420
|
|
|
421
|
+
#### `unique_sdk.Content.ingest_magic_table_sheets`
|
|
422
|
+
|
|
423
|
+
Allows you to ingest a magic table sheet, each row is processed and converted into a content.
|
|
424
|
+
```python
|
|
425
|
+
params = {
|
|
426
|
+
"user_id": user_id,
|
|
427
|
+
"company_id": company_id,
|
|
428
|
+
"data": [
|
|
429
|
+
{
|
|
430
|
+
"rowId": "2",
|
|
431
|
+
"columns": [
|
|
432
|
+
{"columnId": "0", "columnName": "Section", "content": "Other"},
|
|
433
|
+
{"columnId": "1", "columnName": "Question", "content": "What do you know?"},
|
|
434
|
+
{
|
|
435
|
+
"columnId": "2",
|
|
436
|
+
"columnName": "Knowledge Base Answer",
|
|
437
|
+
"content": "Lorem Ipsum is simply dummy texktop publishing software.",
|
|
438
|
+
},
|
|
439
|
+
],
|
|
440
|
+
},
|
|
441
|
+
],
|
|
442
|
+
"ingestionConfiguration": {
|
|
443
|
+
"columnIdsInMetadata": ["1", "2"],
|
|
444
|
+
"columnIdsInChunkText": ["1", "2"],
|
|
445
|
+
},
|
|
446
|
+
"metadata": {
|
|
447
|
+
"libraryName": "foo",
|
|
448
|
+
},
|
|
449
|
+
"scopeId": scope_id,
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
unique_sdk.Content.ingest_magic_table_sheets(**params)
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### Folder
|
|
456
|
+
|
|
457
|
+
#### `unique_sdk.Folder.create_paths`
|
|
458
|
+
|
|
459
|
+
Create each folder in the provided list of paths if it does not already exist.
|
|
460
|
+
|
|
461
|
+
```python
|
|
462
|
+
unique_sdk.Folder.create_paths(
|
|
463
|
+
user_id=user_id,
|
|
464
|
+
company_id=company_id,
|
|
465
|
+
paths=["/unique/path1", "/unique/path2"],
|
|
466
|
+
)
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
#### `unique_sdk.Folder.update_ingestion_config`
|
|
470
|
+
|
|
471
|
+
Allows you to update the ingestion config of a folder and whether to apply to the subscopes or not: `
|
|
472
|
+
|
|
473
|
+
- `ingestionConfig`
|
|
474
|
+
- `applyToSubScopes`
|
|
475
|
+
|
|
476
|
+
Example of updating the ingestion config of a folder and its subfolders.
|
|
477
|
+
|
|
478
|
+
```python
|
|
479
|
+
unique_sdk.Folder.update_ingestion_config(
|
|
480
|
+
user_id=user_id,
|
|
481
|
+
company_id=company_id,
|
|
482
|
+
scope_id=scope_id,
|
|
483
|
+
ingestionConfig={
|
|
484
|
+
"chunkStrategy": "default",
|
|
485
|
+
"uniqueIngestionMode": "standard",
|
|
486
|
+
},
|
|
487
|
+
applyToSubScopes=True
|
|
488
|
+
)
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
#### `unique_sdk.Folder.add_access`
|
|
492
|
+
|
|
493
|
+
Allows you to add access to a folder and apply to the subfolders or not: `
|
|
494
|
+
|
|
495
|
+
- `scopeAccesses`
|
|
496
|
+
- `applyToSubScopes`
|
|
497
|
+
|
|
498
|
+
Example of adding access to a folder and its subfolders.
|
|
499
|
+
|
|
500
|
+
```python
|
|
501
|
+
unique_sdk.Folder.add_access(
|
|
502
|
+
user_id=user_id,
|
|
503
|
+
company_id=company_id,
|
|
504
|
+
scope_id=scope_id,
|
|
505
|
+
scopeAccesses=[
|
|
506
|
+
{
|
|
507
|
+
"entityId": "group_id",
|
|
508
|
+
"type": "WRITE",
|
|
509
|
+
"entityType": "GROUP",
|
|
510
|
+
}
|
|
511
|
+
],
|
|
512
|
+
applyToSubScopes=True,
|
|
513
|
+
)
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
#### `unique_sdk.Folder.remove_access`
|
|
517
|
+
|
|
518
|
+
Allows you to delete access from a folder and apply to the subfolders or not: `
|
|
519
|
+
|
|
520
|
+
- `scopeAccesses`
|
|
521
|
+
- `applyToSubScopes`
|
|
522
|
+
|
|
523
|
+
Example of deleting the access from a folder and its subfolders.
|
|
524
|
+
|
|
525
|
+
```python
|
|
526
|
+
unique_sdk.Folder.remove_access(
|
|
527
|
+
user_id=user_id,
|
|
528
|
+
company_id=company_id,
|
|
529
|
+
scope_id=scope_id,
|
|
530
|
+
scopeAccesses=[
|
|
531
|
+
{
|
|
532
|
+
"entityId": "group_id",
|
|
533
|
+
"type": "WRITE",
|
|
534
|
+
"entityType": "GROUP",
|
|
535
|
+
}
|
|
536
|
+
],
|
|
537
|
+
applyToSubScopes=True,
|
|
538
|
+
)
|
|
539
|
+
```
|
|
540
|
+
|
|
418
541
|
### Message
|
|
419
542
|
|
|
420
543
|
#### `unique_sdk.Message.list`
|
|
@@ -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
|
|
@@ -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
|
+
)
|
|
@@ -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
|
+
)
|
|
@@ -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:
|
|
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
|