unique_sdk 0.9.26__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.
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/CHANGELOG.md +15 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/PKG-INFO +179 -1
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/README.md +162 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/pyproject.toml +3 -1
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/__init__.py +1 -1
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_content.py +71 -0
- unique_sdk-0.9.31/unique_sdk/api_resources/_folder.py +270 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/utils/file_io.py +5 -1
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/LICENSE +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_api_requestor.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_api_resource.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_api_version.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_error.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_http_client.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_list_object.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_object_classes.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_request_options.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_unique_object.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_unique_ql.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_unique_response.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_util.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_version.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/_webhook.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/__init__.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_acronyms.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_chat_completion.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_embedding.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_event.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_integrated.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_message.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_message_assessment.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_search.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_search_string.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/api_resources/_short_term_memory.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/utils/chat_history.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/utils/sources.py +0 -0
- {unique_sdk-0.9.26 → unique_sdk-0.9.31}/unique_sdk/utils/token.py +0 -0
|
@@ -5,6 +5,21 @@ 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
|
+
|
|
17
|
+
## [0.9.28] - 2025-05-20
|
|
18
|
+
- Add function to search content info. This also allows filtering content info by metadata info.
|
|
19
|
+
|
|
20
|
+
## [0.9.27] - 2025-05-14
|
|
21
|
+
- Add the possibility to specify metadata when creating or updating a Content.
|
|
22
|
+
|
|
8
23
|
## [0.9.26] - 2025-05-13
|
|
9
24
|
- Add the possibility to specify ingestionConfig when creating or updating a Content.
|
|
10
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.31
|
|
4
4
|
Summary:
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Martin Fadler
|
|
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
13
14
|
Requires-Dist: typing-extensions (>=4.9.0,<5.0.0)
|
|
14
15
|
Description-Content-Type: text/markdown
|
|
15
16
|
|
|
@@ -27,6 +28,7 @@ The Unique Python SDK provides access to the public API of Unique FinanceGPT. It
|
|
|
27
28
|
4. [Webhook Triggers](#webhook-triggers)
|
|
28
29
|
5. [Available API Resources](#available-api-resources)
|
|
29
30
|
- [Content](#content)
|
|
31
|
+
- [Folder](#folder)
|
|
30
32
|
- [Message](#message)
|
|
31
33
|
- [Chat Completion](#chat-completion)
|
|
32
34
|
- [Embeddings](#embeddings)
|
|
@@ -35,6 +37,7 @@ The Unique Python SDK provides access to the public API of Unique FinanceGPT. It
|
|
|
35
37
|
- [Search String](#search-string)
|
|
36
38
|
- [Short Term Memory](#short-term-memory)
|
|
37
39
|
- [Message Assessment](#message-assessment)
|
|
40
|
+
- [Folder](#folder)
|
|
38
41
|
6. [UniqueQL](#uniqueql)
|
|
39
42
|
- [Query Structure](#uniqueql-query-structure)
|
|
40
43
|
- [Metadata Filtering](#metadata-filtering)
|
|
@@ -243,6 +246,7 @@ unique_sdk.Message.modify(
|
|
|
243
246
|
- [Chat Completion](#chat-completion)
|
|
244
247
|
- [Search](#search)
|
|
245
248
|
- [Search String](#search-string)
|
|
249
|
+
- [Folder](#folder)
|
|
246
250
|
|
|
247
251
|
Most of the API services provide an asynchronous version of the method. The async methods are suffixed with `_async`.
|
|
248
252
|
|
|
@@ -282,6 +286,73 @@ unique_sdk.Content.search(
|
|
|
282
286
|
)
|
|
283
287
|
```
|
|
284
288
|
|
|
289
|
+
#### `unique_sdk.Content.get_info`
|
|
290
|
+
|
|
291
|
+
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:
|
|
292
|
+
|
|
293
|
+
```python
|
|
294
|
+
metadataFilter: {
|
|
295
|
+
"or": [
|
|
296
|
+
{
|
|
297
|
+
"and": [
|
|
298
|
+
{
|
|
299
|
+
"operator": "contains",
|
|
300
|
+
"path": [
|
|
301
|
+
"folderIdPath"
|
|
302
|
+
],
|
|
303
|
+
"value": "uniquepathid://test_id"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"operator": "contains",
|
|
307
|
+
"path": [
|
|
308
|
+
"title"
|
|
309
|
+
],
|
|
310
|
+
"value": "ai"
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
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:`
|
|
319
|
+
|
|
320
|
+
- `skip`
|
|
321
|
+
- `take`
|
|
322
|
+
|
|
323
|
+
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 `tile` metadata.
|
|
324
|
+
|
|
325
|
+
```python
|
|
326
|
+
content_info_result = unique_sdk.Content.get_info(
|
|
327
|
+
user_id=user_id,
|
|
328
|
+
company_id=company_id,
|
|
329
|
+
metadataFilter={
|
|
330
|
+
"or": [
|
|
331
|
+
{
|
|
332
|
+
"and": [
|
|
333
|
+
{
|
|
334
|
+
"operator": "contains",
|
|
335
|
+
"path": [
|
|
336
|
+
"folderIdPath"
|
|
337
|
+
],
|
|
338
|
+
"value": "uniquepathid://scope_abcdibgznc4bkdcx120zm5d"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"operator": "contains",
|
|
342
|
+
"path": [
|
|
343
|
+
"title"
|
|
344
|
+
],
|
|
345
|
+
"value": "ai"
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
},
|
|
351
|
+
skip=0,
|
|
352
|
+
take=3,
|
|
353
|
+
)
|
|
354
|
+
```
|
|
355
|
+
|
|
285
356
|
#### `unique_sdk.Content.upsert`
|
|
286
357
|
|
|
287
358
|
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.
|
|
@@ -302,6 +373,9 @@ createdContent = upload_file(
|
|
|
302
373
|
"chunkStrategy": "default",
|
|
303
374
|
"uniqueIngestionMode": "standard",
|
|
304
375
|
},
|
|
376
|
+
metadata={
|
|
377
|
+
"folderIdPath": "uniquepathid://scope_id"
|
|
378
|
+
}
|
|
305
379
|
)
|
|
306
380
|
|
|
307
381
|
def upload_file(
|
|
@@ -312,6 +386,7 @@ def upload_file(
|
|
|
312
386
|
mimeType,
|
|
313
387
|
scope_or_unique_path,
|
|
314
388
|
ingestion_config=None,
|
|
389
|
+
metadata=None,
|
|
315
390
|
):
|
|
316
391
|
size = os.path.getsize(path_to_file)
|
|
317
392
|
createdContent = unique_sdk.Content.upsert(
|
|
@@ -322,6 +397,7 @@ def upload_file(
|
|
|
322
397
|
"title": displayed_filename,
|
|
323
398
|
"mimeType": mimeType,
|
|
324
399
|
"ingestionConfig": ingestionConfig,
|
|
400
|
+
"metadata": metadata,
|
|
325
401
|
},
|
|
326
402
|
scopeId=scope_or_unique_path,
|
|
327
403
|
)
|
|
@@ -348,6 +424,7 @@ def upload_file(
|
|
|
348
424
|
"mimeType": mimeType,
|
|
349
425
|
"byteSize": size,
|
|
350
426
|
"ingestionConfig": ingestionConfig,
|
|
427
|
+
"metadata": metadata,
|
|
351
428
|
},
|
|
352
429
|
scopeId=scope_or_unique_path,
|
|
353
430
|
readUrl=createdContent.readUrl,
|
|
@@ -357,6 +434,92 @@ def upload_file(
|
|
|
357
434
|
|
|
358
435
|
```
|
|
359
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
|
+
|
|
360
523
|
### Message
|
|
361
524
|
|
|
362
525
|
#### `unique_sdk.Message.list`
|
|
@@ -949,6 +1112,21 @@ All notable changes to this project will be documented in this file.
|
|
|
949
1112
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
950
1113
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
951
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
|
+
|
|
1124
|
+
## [0.9.28] - 2025-05-20
|
|
1125
|
+
- Add function to search content info. This also allows filtering content info by metadata info.
|
|
1126
|
+
|
|
1127
|
+
## [0.9.27] - 2025-05-14
|
|
1128
|
+
- Add the possibility to specify metadata when creating or updating a Content.
|
|
1129
|
+
|
|
952
1130
|
## [0.9.26] - 2025-05-13
|
|
953
1131
|
- Add the possibility to specify ingestionConfig when creating or updating a Content.
|
|
954
1132
|
|
|
@@ -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
|
|
|
@@ -267,6 +270,73 @@ unique_sdk.Content.search(
|
|
|
267
270
|
)
|
|
268
271
|
```
|
|
269
272
|
|
|
273
|
+
#### `unique_sdk.Content.get_info`
|
|
274
|
+
|
|
275
|
+
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:
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
metadataFilter: {
|
|
279
|
+
"or": [
|
|
280
|
+
{
|
|
281
|
+
"and": [
|
|
282
|
+
{
|
|
283
|
+
"operator": "contains",
|
|
284
|
+
"path": [
|
|
285
|
+
"folderIdPath"
|
|
286
|
+
],
|
|
287
|
+
"value": "uniquepathid://test_id"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"operator": "contains",
|
|
291
|
+
"path": [
|
|
292
|
+
"title"
|
|
293
|
+
],
|
|
294
|
+
"value": "ai"
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
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:`
|
|
303
|
+
|
|
304
|
+
- `skip`
|
|
305
|
+
- `take`
|
|
306
|
+
|
|
307
|
+
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 `tile` metadata.
|
|
308
|
+
|
|
309
|
+
```python
|
|
310
|
+
content_info_result = unique_sdk.Content.get_info(
|
|
311
|
+
user_id=user_id,
|
|
312
|
+
company_id=company_id,
|
|
313
|
+
metadataFilter={
|
|
314
|
+
"or": [
|
|
315
|
+
{
|
|
316
|
+
"and": [
|
|
317
|
+
{
|
|
318
|
+
"operator": "contains",
|
|
319
|
+
"path": [
|
|
320
|
+
"folderIdPath"
|
|
321
|
+
],
|
|
322
|
+
"value": "uniquepathid://scope_abcdibgznc4bkdcx120zm5d"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"operator": "contains",
|
|
326
|
+
"path": [
|
|
327
|
+
"title"
|
|
328
|
+
],
|
|
329
|
+
"value": "ai"
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
skip=0,
|
|
336
|
+
take=3,
|
|
337
|
+
)
|
|
338
|
+
```
|
|
339
|
+
|
|
270
340
|
#### `unique_sdk.Content.upsert`
|
|
271
341
|
|
|
272
342
|
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.
|
|
@@ -287,6 +357,9 @@ createdContent = upload_file(
|
|
|
287
357
|
"chunkStrategy": "default",
|
|
288
358
|
"uniqueIngestionMode": "standard",
|
|
289
359
|
},
|
|
360
|
+
metadata={
|
|
361
|
+
"folderIdPath": "uniquepathid://scope_id"
|
|
362
|
+
}
|
|
290
363
|
)
|
|
291
364
|
|
|
292
365
|
def upload_file(
|
|
@@ -297,6 +370,7 @@ def upload_file(
|
|
|
297
370
|
mimeType,
|
|
298
371
|
scope_or_unique_path,
|
|
299
372
|
ingestion_config=None,
|
|
373
|
+
metadata=None,
|
|
300
374
|
):
|
|
301
375
|
size = os.path.getsize(path_to_file)
|
|
302
376
|
createdContent = unique_sdk.Content.upsert(
|
|
@@ -307,6 +381,7 @@ def upload_file(
|
|
|
307
381
|
"title": displayed_filename,
|
|
308
382
|
"mimeType": mimeType,
|
|
309
383
|
"ingestionConfig": ingestionConfig,
|
|
384
|
+
"metadata": metadata,
|
|
310
385
|
},
|
|
311
386
|
scopeId=scope_or_unique_path,
|
|
312
387
|
)
|
|
@@ -333,6 +408,7 @@ def upload_file(
|
|
|
333
408
|
"mimeType": mimeType,
|
|
334
409
|
"byteSize": size,
|
|
335
410
|
"ingestionConfig": ingestionConfig,
|
|
411
|
+
"metadata": metadata,
|
|
336
412
|
},
|
|
337
413
|
scopeId=scope_or_unique_path,
|
|
338
414
|
readUrl=createdContent.readUrl,
|
|
@@ -342,6 +418,92 @@ def upload_file(
|
|
|
342
418
|
|
|
343
419
|
```
|
|
344
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
|
+
|
|
345
507
|
### Message
|
|
346
508
|
|
|
347
509
|
#### `unique_sdk.Message.list`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "unique_sdk"
|
|
3
|
-
version = "0.9.
|
|
3
|
+
version = "0.9.31"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = [
|
|
6
6
|
"Martin Fadler <martin.fadler@unique.ch>",
|
|
@@ -16,6 +16,7 @@ classifiers = [
|
|
|
16
16
|
[tool.poetry.dependencies]
|
|
17
17
|
python = "^3.11"
|
|
18
18
|
typing-extensions = "^4.9.0"
|
|
19
|
+
requests = "^2.32.3"
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
[tool.poetry.group.dev.dependencies]
|
|
@@ -25,6 +26,7 @@ tox = "^4.11.4"
|
|
|
25
26
|
pyright = "^1.1.341"
|
|
26
27
|
pytest-cov = "^4.1.0"
|
|
27
28
|
pytest-asyncio = "^0.24.0"
|
|
29
|
+
python-dotenv = "^1.1.0"
|
|
28
30
|
|
|
29
31
|
[build-system]
|
|
30
32
|
requires = ["poetry-core"]
|
|
@@ -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
|
|
@@ -65,6 +65,16 @@ class Content(APIResource["Content"]):
|
|
|
65
65
|
where: "Content.ContentWhereInput"
|
|
66
66
|
chatId: NotRequired[str]
|
|
67
67
|
|
|
68
|
+
class ContentInfoParams(TypedDict):
|
|
69
|
+
"""
|
|
70
|
+
Parameters for the content info endpoint.
|
|
71
|
+
This is used to retrieve information about content based on various filters.
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
metadataFilter: dict
|
|
75
|
+
skip: int | None
|
|
76
|
+
take: int | None
|
|
77
|
+
|
|
68
78
|
class CustomApiOptions(TypedDict):
|
|
69
79
|
apiIdentifier: str
|
|
70
80
|
apiPayload: Optional[str]
|
|
@@ -96,6 +106,7 @@ class Content(APIResource["Content"]):
|
|
|
96
106
|
ownerId: str
|
|
97
107
|
byteSize: Optional[int]
|
|
98
108
|
ingestionConfig: "Content.IngestionConfig"
|
|
109
|
+
metadata: dict[str, any] | None = None
|
|
99
110
|
|
|
100
111
|
class UpsertParams(RequestOptions):
|
|
101
112
|
input: "Content.Input"
|
|
@@ -112,6 +123,30 @@ class Content(APIResource["Content"]):
|
|
|
112
123
|
endPage: Optional[int]
|
|
113
124
|
order: Optional[int]
|
|
114
125
|
|
|
126
|
+
class ContentInfo(TypedDict):
|
|
127
|
+
"""
|
|
128
|
+
Partial representation of the content containing only the base information.
|
|
129
|
+
This is used for the content info endpoint.
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
id: str
|
|
133
|
+
key: str
|
|
134
|
+
url: str | None
|
|
135
|
+
title: str | None
|
|
136
|
+
metadata: Dict[str, Any] | None
|
|
137
|
+
mimeType: str
|
|
138
|
+
byteSize: int
|
|
139
|
+
ownerId: str
|
|
140
|
+
createdAt: str
|
|
141
|
+
updatedAt: str
|
|
142
|
+
expiresAt: str | None
|
|
143
|
+
deletedAt: str | None
|
|
144
|
+
expiredAt: str | None
|
|
145
|
+
|
|
146
|
+
class PaginatedContentInfo(TypedDict):
|
|
147
|
+
contentInfo: List["Content.ContentInfo"]
|
|
148
|
+
totalCount: int
|
|
149
|
+
|
|
115
150
|
id: str
|
|
116
151
|
key: str
|
|
117
152
|
url: Optional[str]
|
|
@@ -156,6 +191,42 @@ class Content(APIResource["Content"]):
|
|
|
156
191
|
),
|
|
157
192
|
)
|
|
158
193
|
|
|
194
|
+
@classmethod
|
|
195
|
+
def get_info(
|
|
196
|
+
cls,
|
|
197
|
+
user_id: str,
|
|
198
|
+
company_id: str,
|
|
199
|
+
**params: Unpack["Content.ContentInfoParams"],
|
|
200
|
+
) -> PaginatedContentInfo:
|
|
201
|
+
return cast(
|
|
202
|
+
Content.PaginatedContentInfo,
|
|
203
|
+
cls._static_request(
|
|
204
|
+
"post",
|
|
205
|
+
"/content/info",
|
|
206
|
+
user_id,
|
|
207
|
+
company_id,
|
|
208
|
+
params=params,
|
|
209
|
+
),
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
@classmethod
|
|
213
|
+
async def get_info_async(
|
|
214
|
+
cls,
|
|
215
|
+
user_id: str,
|
|
216
|
+
company_id: str,
|
|
217
|
+
**params: Unpack["Content.ContentInfoParams"],
|
|
218
|
+
) -> PaginatedContentInfo:
|
|
219
|
+
return cast(
|
|
220
|
+
Content.PaginatedContentInfo,
|
|
221
|
+
await cls._static_request_async(
|
|
222
|
+
"post",
|
|
223
|
+
"/content/info",
|
|
224
|
+
user_id,
|
|
225
|
+
company_id,
|
|
226
|
+
params=params,
|
|
227
|
+
),
|
|
228
|
+
)
|
|
229
|
+
|
|
159
230
|
@classmethod
|
|
160
231
|
def upsert(
|
|
161
232
|
cls,
|
|
@@ -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
|
+
)
|
|
@@ -41,6 +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, any] | None = None,
|
|
44
45
|
):
|
|
45
46
|
# check that chatid or scope_or_unique_path is provided
|
|
46
47
|
if not chat_id and not scope_or_unique_path:
|
|
@@ -54,7 +55,8 @@ def upload_file(
|
|
|
54
55
|
"key": displayed_filename,
|
|
55
56
|
"title": displayed_filename,
|
|
56
57
|
"mimeType": mime_type,
|
|
57
|
-
"ingestionConfig": ingestion_config,
|
|
58
|
+
"ingestionConfig": ingestion_config,
|
|
59
|
+
"metadata": metadata,
|
|
58
60
|
},
|
|
59
61
|
scopeId=scope_or_unique_path,
|
|
60
62
|
chatId=chat_id,
|
|
@@ -83,6 +85,7 @@ def upload_file(
|
|
|
83
85
|
"mimeType": mime_type,
|
|
84
86
|
"byteSize": size,
|
|
85
87
|
"ingestionConfig": ingestion_config,
|
|
88
|
+
"metadata": metadata,
|
|
86
89
|
},
|
|
87
90
|
fileUrl=createdContent.readUrl,
|
|
88
91
|
chatId=chat_id,
|
|
@@ -97,6 +100,7 @@ def upload_file(
|
|
|
97
100
|
"mimeType": mime_type,
|
|
98
101
|
"byteSize": size,
|
|
99
102
|
"ingestionConfig": ingestion_config,
|
|
103
|
+
"metadata": metadata,
|
|
100
104
|
},
|
|
101
105
|
fileUrl=createdContent.readUrl,
|
|
102
106
|
scopeId=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
|