unique_sdk 0.10.31__tar.gz → 0.10.36__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.
Files changed (43) hide show
  1. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/CHANGELOG.md +15 -0
  2. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/PKG-INFO +261 -19
  3. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/README.md +245 -18
  4. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/pyproject.toml +2 -1
  5. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_folder.py +8 -4
  6. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_message.py +56 -0
  7. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_message_execution.py +13 -10
  8. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_message_log.py +9 -7
  9. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_space.py +1 -1
  10. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/LICENSE +0 -0
  11. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/__init__.py +0 -0
  12. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_api_requestor.py +0 -0
  13. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_api_resource.py +0 -0
  14. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_api_version.py +0 -0
  15. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_error.py +0 -0
  16. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_http_client.py +0 -0
  17. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_list_object.py +0 -0
  18. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_object_classes.py +0 -0
  19. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_request_options.py +0 -0
  20. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_unique_object.py +0 -0
  21. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_unique_ql.py +0 -0
  22. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_unique_response.py +0 -0
  23. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_util.py +0 -0
  24. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_version.py +0 -0
  25. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/_webhook.py +0 -0
  26. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/__init__.py +0 -0
  27. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_acronyms.py +0 -0
  28. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_agentic_table.py +0 -0
  29. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_chat_completion.py +0 -0
  30. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_content.py +0 -0
  31. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_embedding.py +0 -0
  32. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_event.py +0 -0
  33. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_integrated.py +0 -0
  34. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_mcp.py +0 -0
  35. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_message_assessment.py +0 -0
  36. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_search.py +0 -0
  37. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_search_string.py +0 -0
  38. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  39. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/utils/chat_history.py +0 -0
  40. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/utils/chat_in_space.py +0 -0
  41. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/utils/file_io.py +0 -0
  42. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/unique_sdk/utils/sources.py +0 -0
  43. {unique_sdk-0.10.31 → unique_sdk-0.10.36}/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.10.36] - 2025-11-04
9
+ - Introduce local integration tests for Folder API Resource
10
+
11
+ ## [0.10.35] - 2025-11-04
12
+ - Inmprove folder get infos types.
13
+
14
+ ## [0.10.34] - 2025-10-29
15
+ - Add documentation for agentic table.
16
+
17
+ ## [0.10.33] - 2025-10-27
18
+ - Improve messagelog and message execution types.
19
+
20
+ ## [0.10.32] - 2025-10-14
21
+ - Add function to stream to chat frontend.
22
+
8
23
  ## [0.10.31] - 2025-10-13
9
24
  - Add readme for message log and execution.
10
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.31
3
+ Version: 0.10.36
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -42,6 +42,7 @@ The Unique Python SDK provides access to the public API of Unique AI. It also en
42
42
  - [Message Assessment](#message-assessment)
43
43
  - [Folder](#folder)
44
44
  - [Space](#space)
45
+ - [Agentic Table](#agentic-table)
45
46
  6. [UniqueQL](#uniqueql)
46
47
  - [Query Structure](#uniqueql-query-structure)
47
48
  - [Metadata Filtering](#metadata-filtering)
@@ -259,6 +260,7 @@ unique_sdk.Message.modify(
259
260
  - [Message Assessment](#message-assessment)
260
261
  - [Folder](#folder)
261
262
  - [Space](#space)
263
+ - [Agentic Table](#agentic-table)
262
264
 
263
265
  Most of the API services provide an asynchronous version of the method. The async methods are suffixed with `_async`.
264
266
 
@@ -700,6 +702,26 @@ message = unique_sdk.Message.create(
700
702
  )
701
703
  ```
702
704
 
705
+ #### `unique_sdk.Message.create_event`
706
+
707
+ Create a new message event in a chat. Updating the text of a message in the chat UI is possible by creating a message update event. This function can be used for custom streaming to the chat. (Compatible with release >.42)
708
+
709
+ The event only changes the text in the UI, it *does not* update the database.
710
+
711
+ ```python
712
+ message = unique_sdk.Message.create_event(
713
+ user_id=user_id,
714
+ company_id=company_id,
715
+ messageId="msg_l4ushn85yqbewpf6tllh2cl7",
716
+ chatId="chat_kc8p3kgkn7393qhgmv5js5nt",
717
+ text="Hello.", #optional
718
+ originalText="Hello.", #optional
719
+ references=[], #optional
720
+ gptRequest={} #optional
721
+ debugInfo={ "hello": "test" }, #optional
722
+ )
723
+ ```
724
+
703
725
  #### `unique_sdk.Message.modify`
704
726
 
705
727
  Modify an existing chat message.
@@ -825,7 +847,7 @@ unique_sdk.Integrated.responses_stream(
825
847
 
826
848
  #### `unique_sdk.MessageLog.create`
827
849
 
828
- Create a message log for a provided `messageId`.
850
+ Function to update the steps section of a message in the chat UI. This is possible by creating a message log record during a message execution.
829
851
 
830
852
  ```python
831
853
  msg_log = unique_sdk.MessageLog.create(
@@ -834,10 +856,10 @@ msg_log = unique_sdk.MessageLog.create(
834
856
  messageId="msg_a0jgnt1jrqv1d3uzr450waxw",
835
857
  text="Create message log text",
836
858
  order=1,
837
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
838
- details=None, # optional, details dictionary
839
- uncitedReferences=None, # optional, references dictionary
840
- references=None, # optional, list of references
859
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
860
+ details={}, # optional, details dictionary
861
+ uncitedReferences={}, # optional, references dictionary
862
+ references=[], # optional, list of references
841
863
  )
842
864
  ```
843
865
 
@@ -850,12 +872,12 @@ msg_log = unique_sdk.MessageLog.update(
850
872
  user_id=user_id,
851
873
  company_id=company_id,
852
874
  message_log_id="message_log_fd7z7gjljo1z2wu5g6l9q7r9",
853
- text="Update a message log text", # optional
854
- order=1, # optional
855
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
856
- details=None, # optional, details dictionary
857
- uncitedReferences=None, # optional, references dictionary
858
- references=None,
875
+ text="Update a message log text", # optional
876
+ order=1, # optional
877
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
878
+ details={}, # optional, details dictionary
879
+ uncitedReferences={}, # optional, references dictionary
880
+ references=[], # optional, list of references
859
881
  )
860
882
  ```
861
883
 
@@ -870,10 +892,7 @@ msg_execution = unique_sdk.MessageExecution.create(
870
892
  user_id=user_id,
871
893
  company_id=company_id,
872
894
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
873
- chatId="chat_nx21havszl1skchd7544oykh",
874
- type="DEEP_RESEARCH"
875
- secondsRemaining=None # optional, number defining the seconds remaining
876
- percentageCompleted=None # optional, number defining the percentage completed
895
+ type="DEEP_RESEARCH",
877
896
  )
878
897
  ```
879
898
 
@@ -898,9 +917,9 @@ msg_execution = unique_sdk.MessageExecution.update(
898
917
  user_id=user_id,
899
918
  company_id=company_id,
900
919
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
901
- status="COMPLETED", # one of: COMPLETED, FAILED
902
- secondsRemaining=55 # optional, number defining the seconds remaining
903
- percentageCompleted=10 # optional, number defining the percentage completed
920
+ status="COMPLETED", # optional, one of: COMPLETED, FAILED - not specifying the status will have no effect over the status
921
+ secondsRemaining=55, # optional, number defining the seconds remaining
922
+ percentageCompleted=10, # optional, number defining the percentage completed
904
923
  )
905
924
  ```
906
925
 
@@ -1352,6 +1371,214 @@ unique_sdk.Space.delete_chat(
1352
1371
  )
1353
1372
  ```
1354
1373
 
1374
+ ### Agentic Table
1375
+
1376
+ The Agentic Table (Magic Table) API provides functionality for managing interactive tables with AI-powered cells, activity tracking, and metadata management.
1377
+
1378
+ #### `unique_sdk.AgenticTable.set_cell`
1379
+
1380
+ Set the content of a specific cell in the magic table. This method allows you to update cell text and optionally add log entries to track changes.
1381
+
1382
+ ```python
1383
+ cell = await unique_sdk.AgenticTable.set_cell(
1384
+ user_id=user_id,
1385
+ company_id=company_id,
1386
+ tableId="sheet_abc123",
1387
+ rowOrder=0,
1388
+ columnOrder=1,
1389
+ text="Updated cell content",
1390
+ logEntries=[ # optional
1391
+ {
1392
+ "text": "Cell updated by automation",
1393
+ "createdAt": "2024-01-01T00:00:00.000Z",
1394
+ "actorType": "SYSTEM", # One of: "USER", "SYSTEM", "ASSISTANT", "TOOL"
1395
+ "messageId": "msg_123", # optional
1396
+ "details": [ # optional
1397
+ {
1398
+ "text": "Processing completed",
1399
+ "messageId": "msg_456" # optional
1400
+ }
1401
+ ]
1402
+ }
1403
+ ]
1404
+ )
1405
+ ```
1406
+
1407
+ #### `unique_sdk.AgenticTable.get_cell`
1408
+
1409
+ Retrieve the content and metadata of a specific cell.
1410
+
1411
+ ```python
1412
+ cell = await unique_sdk.AgenticTable.get_cell(
1413
+ user_id=user_id,
1414
+ company_id=company_id,
1415
+ tableId="sheet_abc123",
1416
+ rowOrder=0,
1417
+ columnOrder=1,
1418
+ )
1419
+ ```
1420
+
1421
+ #### `unique_sdk.AgenticTable.set_multiple_cells`
1422
+
1423
+ Bulk update multiple cells in a single operation for better performance.
1424
+
1425
+ ```python
1426
+ result = await unique_sdk.AgenticTable.set_multiple_cells(
1427
+ user_id=user_id,
1428
+ company_id=company_id,
1429
+ tableId="sheet_abc123",
1430
+ cells=[
1431
+ {
1432
+ "rowOrder": 0,
1433
+ "columnOrder": 0,
1434
+ "text": "Cell A1"
1435
+ },
1436
+ {
1437
+ "rowOrder": 0,
1438
+ "columnOrder": 1,
1439
+ "text": "Cell B1"
1440
+ },
1441
+ {
1442
+ "rowOrder": 1,
1443
+ "columnOrder": 0,
1444
+ "text": "Cell A2"
1445
+ }
1446
+ ]
1447
+ )
1448
+ ```
1449
+
1450
+ #### `unique_sdk.AgenticTable.get_sheet_data`
1451
+
1452
+ Retrieve comprehensive data about a magic table sheet, including cells, log history, and metadata.
1453
+
1454
+ ```python
1455
+ sheet = await unique_sdk.AgenticTable.get_sheet_data(
1456
+ user_id=user_id,
1457
+ company_id=company_id,
1458
+ tableId="sheet_abc123",
1459
+ includeCells=True, # optional
1460
+ includeLogHistory=True, # optional
1461
+ includeRowCount=True, # optional
1462
+ includeCellMetaData=True, # optional
1463
+ startRow=0, # optional: specify row range
1464
+ endRow=10 # optional: specify row range
1465
+ )
1466
+ ```
1467
+
1468
+ #### `unique_sdk.AgenticTable.get_sheet_state`
1469
+
1470
+ Get the current state of a magic table sheet.
1471
+
1472
+ ```python
1473
+ state = await unique_sdk.AgenticTable.get_sheet_state(
1474
+ user_id=user_id,
1475
+ company_id=company_id,
1476
+ tableId="sheet_abc123"
1477
+ )
1478
+ # Returns: "PROCESSING", "IDLE", or "STOPPED_BY_USER"
1479
+ ```
1480
+
1481
+ #### `unique_sdk.AgenticTable.update_sheet_state`
1482
+
1483
+ Update the name or state of a magic table sheet.
1484
+
1485
+ ```python
1486
+ result = await unique_sdk.AgenticTable.update_sheet_state(
1487
+ user_id=user_id,
1488
+ company_id=company_id,
1489
+ tableId="sheet_abc123",
1490
+ name="Updated Sheet Name", # optional
1491
+ state="IDLE" # optional, one of: "PROCESSING", "IDLE", "STOPPED_BY_USER"
1492
+ )
1493
+ ```
1494
+
1495
+ #### `unique_sdk.AgenticTable.set_activity`
1496
+
1497
+ Set the status of an activity on the magic table sheet. This is useful for tracking long-running operations.
1498
+
1499
+ ```python
1500
+ result = await unique_sdk.AgenticTable.set_activity(
1501
+ user_id=user_id,
1502
+ company_id=company_id,
1503
+ tableId="sheet_abc123",
1504
+ activity="UpdateCell",
1505
+ # activity: one of "DeleteRow", "DeleteColumn", "UpdateCell", "AddQuestionText",
1506
+ # "AddMetaData", "GenerateArtifact", "SheetCompleted", "LibrarySheetRowVerified"
1507
+ status="IN_PROGRESS",
1508
+ # status: one of "IN_PROGRESS", "COMPLETED", "FAILED"
1509
+ text="Updating cells with AI-generated content"
1510
+ )
1511
+ ```
1512
+
1513
+ #### `unique_sdk.AgenticTable.set_artifact`
1514
+
1515
+ Attach an artifact (such as a generated document) to the magic table sheet.
1516
+
1517
+ ```python
1518
+ result = await unique_sdk.AgenticTable.set_artifact(
1519
+ user_id=user_id,
1520
+ company_id=company_id,
1521
+ tableId="sheet_abc123",
1522
+ name="Generated Report",
1523
+ contentId="cont_xyz789",
1524
+ mimeType="application/pdf",
1525
+ artifactType="FULL_REPORT" # One of: "QUESTIONS", "FULL_REPORT"
1526
+ )
1527
+ ```
1528
+
1529
+ #### `unique_sdk.AgenticTable.set_column_metadata`
1530
+
1531
+ Configure metadata for a specific column, including width, filters, and cell renderers.
1532
+
1533
+ ```python
1534
+ result = await unique_sdk.AgenticTable.set_column_metadata(
1535
+ user_id=user_id,
1536
+ company_id=company_id,
1537
+ tableId="sheet_abc123",
1538
+ columnOrder=2,
1539
+ columnWidth=200, # optional
1540
+ filter="ValueMatchFilter", # optional
1541
+ # filter: one of "ValueMatchFilter", "PartialMatchFilter", "ReferenceFilter",
1542
+ # "HallucinationFilter", "ReviewStatusFilter", "AssigneeFilter"
1543
+ cellRenderer="CheckboxLockCellRenderer", # optional
1544
+ # cellRenderer: one of "CheckboxLockCellRenderer", "CollaboratorDropdown",
1545
+ # "ReviewStatusDropdown", "CustomCellRenderer", "SelectableCellRenderer"
1546
+ editable=True # optional
1547
+ )
1548
+ ```
1549
+
1550
+ #### `unique_sdk.AgenticTable.set_cell_metadata`
1551
+
1552
+ Set metadata for a specific cell, including selection status and agreement status.
1553
+
1554
+ ```python
1555
+ result = await unique_sdk.AgenticTable.set_cell_metadata(
1556
+ user_id=user_id,
1557
+ company_id=company_id,
1558
+ tableId="sheet_abc123",
1559
+ rowOrder=0,
1560
+ columnOrder=1,
1561
+ selected=True, # optional
1562
+ selectionMethod="MANUAL", # optional, one of: "DEFAULT", "MANUAL"
1563
+ agreementStatus="MATCH" # optional, one of: "MATCH", "NO_MATCH"
1564
+ )
1565
+ ```
1566
+
1567
+ #### `unique_sdk.AgenticTable.bulk_update_status`
1568
+
1569
+ Update the verification status of multiple rows at once.
1570
+
1571
+ ```python
1572
+ result = await unique_sdk.AgenticTable.bulk_update_status(
1573
+ user_id=user_id,
1574
+ company_id=company_id,
1575
+ tableId="sheet_abc123",
1576
+ rowOrders=[0, 1, 2, 3, 4],
1577
+ status="VERIFIED"
1578
+ # status: one of "NEED_REVIEW", "READY_FOR_VERIFICATION", "VERIFIED"
1579
+ )
1580
+ ```
1581
+
1355
1582
  ## UniqueQL
1356
1583
 
1357
1584
  [UniqueQL](https://unique-ch.atlassian.net/wiki/x/coAXHQ) is an advanced query language designed to enhance search capabilities within various search modes such as Vector, Full-Text Search (FTS), and Combined. This query language enables users to perform detailed searches by filtering through metadata attributes like filenames, URLs, dates, and more. UniqueQL is versatile and can be translated into different query formats for various database systems, including PostgreSQL and Qdrant.
@@ -1749,6 +1976,21 @@ All notable changes to this project will be documented in this file.
1749
1976
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1750
1977
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1751
1978
 
1979
+ ## [0.10.36] - 2025-11-04
1980
+ - Introduce local integration tests for Folder API Resource
1981
+
1982
+ ## [0.10.35] - 2025-11-04
1983
+ - Inmprove folder get infos types.
1984
+
1985
+ ## [0.10.34] - 2025-10-29
1986
+ - Add documentation for agentic table.
1987
+
1988
+ ## [0.10.33] - 2025-10-27
1989
+ - Improve messagelog and message execution types.
1990
+
1991
+ ## [0.10.32] - 2025-10-14
1992
+ - Add function to stream to chat frontend.
1993
+
1752
1994
  ## [0.10.31] - 2025-10-13
1753
1995
  - Add readme for message log and execution.
1754
1996
 
@@ -24,6 +24,7 @@ The Unique Python SDK provides access to the public API of Unique AI. It also en
24
24
  - [Message Assessment](#message-assessment)
25
25
  - [Folder](#folder)
26
26
  - [Space](#space)
27
+ - [Agentic Table](#agentic-table)
27
28
  6. [UniqueQL](#uniqueql)
28
29
  - [Query Structure](#uniqueql-query-structure)
29
30
  - [Metadata Filtering](#metadata-filtering)
@@ -241,6 +242,7 @@ unique_sdk.Message.modify(
241
242
  - [Message Assessment](#message-assessment)
242
243
  - [Folder](#folder)
243
244
  - [Space](#space)
245
+ - [Agentic Table](#agentic-table)
244
246
 
245
247
  Most of the API services provide an asynchronous version of the method. The async methods are suffixed with `_async`.
246
248
 
@@ -682,6 +684,26 @@ message = unique_sdk.Message.create(
682
684
  )
683
685
  ```
684
686
 
687
+ #### `unique_sdk.Message.create_event`
688
+
689
+ Create a new message event in a chat. Updating the text of a message in the chat UI is possible by creating a message update event. This function can be used for custom streaming to the chat. (Compatible with release >.42)
690
+
691
+ The event only changes the text in the UI, it *does not* update the database.
692
+
693
+ ```python
694
+ message = unique_sdk.Message.create_event(
695
+ user_id=user_id,
696
+ company_id=company_id,
697
+ messageId="msg_l4ushn85yqbewpf6tllh2cl7",
698
+ chatId="chat_kc8p3kgkn7393qhgmv5js5nt",
699
+ text="Hello.", #optional
700
+ originalText="Hello.", #optional
701
+ references=[], #optional
702
+ gptRequest={} #optional
703
+ debugInfo={ "hello": "test" }, #optional
704
+ )
705
+ ```
706
+
685
707
  #### `unique_sdk.Message.modify`
686
708
 
687
709
  Modify an existing chat message.
@@ -807,7 +829,7 @@ unique_sdk.Integrated.responses_stream(
807
829
 
808
830
  #### `unique_sdk.MessageLog.create`
809
831
 
810
- Create a message log for a provided `messageId`.
832
+ Function to update the steps section of a message in the chat UI. This is possible by creating a message log record during a message execution.
811
833
 
812
834
  ```python
813
835
  msg_log = unique_sdk.MessageLog.create(
@@ -816,10 +838,10 @@ msg_log = unique_sdk.MessageLog.create(
816
838
  messageId="msg_a0jgnt1jrqv1d3uzr450waxw",
817
839
  text="Create message log text",
818
840
  order=1,
819
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
820
- details=None, # optional, details dictionary
821
- uncitedReferences=None, # optional, references dictionary
822
- references=None, # optional, list of references
841
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
842
+ details={}, # optional, details dictionary
843
+ uncitedReferences={}, # optional, references dictionary
844
+ references=[], # optional, list of references
823
845
  )
824
846
  ```
825
847
 
@@ -832,12 +854,12 @@ msg_log = unique_sdk.MessageLog.update(
832
854
  user_id=user_id,
833
855
  company_id=company_id,
834
856
  message_log_id="message_log_fd7z7gjljo1z2wu5g6l9q7r9",
835
- text="Update a message log text", # optional
836
- order=1, # optional
837
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
838
- details=None, # optional, details dictionary
839
- uncitedReferences=None, # optional, references dictionary
840
- references=None,
857
+ text="Update a message log text", # optional
858
+ order=1, # optional
859
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
860
+ details={}, # optional, details dictionary
861
+ uncitedReferences={}, # optional, references dictionary
862
+ references=[], # optional, list of references
841
863
  )
842
864
  ```
843
865
 
@@ -852,10 +874,7 @@ msg_execution = unique_sdk.MessageExecution.create(
852
874
  user_id=user_id,
853
875
  company_id=company_id,
854
876
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
855
- chatId="chat_nx21havszl1skchd7544oykh",
856
- type="DEEP_RESEARCH"
857
- secondsRemaining=None # optional, number defining the seconds remaining
858
- percentageCompleted=None # optional, number defining the percentage completed
877
+ type="DEEP_RESEARCH",
859
878
  )
860
879
  ```
861
880
 
@@ -880,9 +899,9 @@ msg_execution = unique_sdk.MessageExecution.update(
880
899
  user_id=user_id,
881
900
  company_id=company_id,
882
901
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
883
- status="COMPLETED", # one of: COMPLETED, FAILED
884
- secondsRemaining=55 # optional, number defining the seconds remaining
885
- percentageCompleted=10 # optional, number defining the percentage completed
902
+ status="COMPLETED", # optional, one of: COMPLETED, FAILED - not specifying the status will have no effect over the status
903
+ secondsRemaining=55, # optional, number defining the seconds remaining
904
+ percentageCompleted=10, # optional, number defining the percentage completed
886
905
  )
887
906
  ```
888
907
 
@@ -1334,6 +1353,214 @@ unique_sdk.Space.delete_chat(
1334
1353
  )
1335
1354
  ```
1336
1355
 
1356
+ ### Agentic Table
1357
+
1358
+ The Agentic Table (Magic Table) API provides functionality for managing interactive tables with AI-powered cells, activity tracking, and metadata management.
1359
+
1360
+ #### `unique_sdk.AgenticTable.set_cell`
1361
+
1362
+ Set the content of a specific cell in the magic table. This method allows you to update cell text and optionally add log entries to track changes.
1363
+
1364
+ ```python
1365
+ cell = await unique_sdk.AgenticTable.set_cell(
1366
+ user_id=user_id,
1367
+ company_id=company_id,
1368
+ tableId="sheet_abc123",
1369
+ rowOrder=0,
1370
+ columnOrder=1,
1371
+ text="Updated cell content",
1372
+ logEntries=[ # optional
1373
+ {
1374
+ "text": "Cell updated by automation",
1375
+ "createdAt": "2024-01-01T00:00:00.000Z",
1376
+ "actorType": "SYSTEM", # One of: "USER", "SYSTEM", "ASSISTANT", "TOOL"
1377
+ "messageId": "msg_123", # optional
1378
+ "details": [ # optional
1379
+ {
1380
+ "text": "Processing completed",
1381
+ "messageId": "msg_456" # optional
1382
+ }
1383
+ ]
1384
+ }
1385
+ ]
1386
+ )
1387
+ ```
1388
+
1389
+ #### `unique_sdk.AgenticTable.get_cell`
1390
+
1391
+ Retrieve the content and metadata of a specific cell.
1392
+
1393
+ ```python
1394
+ cell = await unique_sdk.AgenticTable.get_cell(
1395
+ user_id=user_id,
1396
+ company_id=company_id,
1397
+ tableId="sheet_abc123",
1398
+ rowOrder=0,
1399
+ columnOrder=1,
1400
+ )
1401
+ ```
1402
+
1403
+ #### `unique_sdk.AgenticTable.set_multiple_cells`
1404
+
1405
+ Bulk update multiple cells in a single operation for better performance.
1406
+
1407
+ ```python
1408
+ result = await unique_sdk.AgenticTable.set_multiple_cells(
1409
+ user_id=user_id,
1410
+ company_id=company_id,
1411
+ tableId="sheet_abc123",
1412
+ cells=[
1413
+ {
1414
+ "rowOrder": 0,
1415
+ "columnOrder": 0,
1416
+ "text": "Cell A1"
1417
+ },
1418
+ {
1419
+ "rowOrder": 0,
1420
+ "columnOrder": 1,
1421
+ "text": "Cell B1"
1422
+ },
1423
+ {
1424
+ "rowOrder": 1,
1425
+ "columnOrder": 0,
1426
+ "text": "Cell A2"
1427
+ }
1428
+ ]
1429
+ )
1430
+ ```
1431
+
1432
+ #### `unique_sdk.AgenticTable.get_sheet_data`
1433
+
1434
+ Retrieve comprehensive data about a magic table sheet, including cells, log history, and metadata.
1435
+
1436
+ ```python
1437
+ sheet = await unique_sdk.AgenticTable.get_sheet_data(
1438
+ user_id=user_id,
1439
+ company_id=company_id,
1440
+ tableId="sheet_abc123",
1441
+ includeCells=True, # optional
1442
+ includeLogHistory=True, # optional
1443
+ includeRowCount=True, # optional
1444
+ includeCellMetaData=True, # optional
1445
+ startRow=0, # optional: specify row range
1446
+ endRow=10 # optional: specify row range
1447
+ )
1448
+ ```
1449
+
1450
+ #### `unique_sdk.AgenticTable.get_sheet_state`
1451
+
1452
+ Get the current state of a magic table sheet.
1453
+
1454
+ ```python
1455
+ state = await unique_sdk.AgenticTable.get_sheet_state(
1456
+ user_id=user_id,
1457
+ company_id=company_id,
1458
+ tableId="sheet_abc123"
1459
+ )
1460
+ # Returns: "PROCESSING", "IDLE", or "STOPPED_BY_USER"
1461
+ ```
1462
+
1463
+ #### `unique_sdk.AgenticTable.update_sheet_state`
1464
+
1465
+ Update the name or state of a magic table sheet.
1466
+
1467
+ ```python
1468
+ result = await unique_sdk.AgenticTable.update_sheet_state(
1469
+ user_id=user_id,
1470
+ company_id=company_id,
1471
+ tableId="sheet_abc123",
1472
+ name="Updated Sheet Name", # optional
1473
+ state="IDLE" # optional, one of: "PROCESSING", "IDLE", "STOPPED_BY_USER"
1474
+ )
1475
+ ```
1476
+
1477
+ #### `unique_sdk.AgenticTable.set_activity`
1478
+
1479
+ Set the status of an activity on the magic table sheet. This is useful for tracking long-running operations.
1480
+
1481
+ ```python
1482
+ result = await unique_sdk.AgenticTable.set_activity(
1483
+ user_id=user_id,
1484
+ company_id=company_id,
1485
+ tableId="sheet_abc123",
1486
+ activity="UpdateCell",
1487
+ # activity: one of "DeleteRow", "DeleteColumn", "UpdateCell", "AddQuestionText",
1488
+ # "AddMetaData", "GenerateArtifact", "SheetCompleted", "LibrarySheetRowVerified"
1489
+ status="IN_PROGRESS",
1490
+ # status: one of "IN_PROGRESS", "COMPLETED", "FAILED"
1491
+ text="Updating cells with AI-generated content"
1492
+ )
1493
+ ```
1494
+
1495
+ #### `unique_sdk.AgenticTable.set_artifact`
1496
+
1497
+ Attach an artifact (such as a generated document) to the magic table sheet.
1498
+
1499
+ ```python
1500
+ result = await unique_sdk.AgenticTable.set_artifact(
1501
+ user_id=user_id,
1502
+ company_id=company_id,
1503
+ tableId="sheet_abc123",
1504
+ name="Generated Report",
1505
+ contentId="cont_xyz789",
1506
+ mimeType="application/pdf",
1507
+ artifactType="FULL_REPORT" # One of: "QUESTIONS", "FULL_REPORT"
1508
+ )
1509
+ ```
1510
+
1511
+ #### `unique_sdk.AgenticTable.set_column_metadata`
1512
+
1513
+ Configure metadata for a specific column, including width, filters, and cell renderers.
1514
+
1515
+ ```python
1516
+ result = await unique_sdk.AgenticTable.set_column_metadata(
1517
+ user_id=user_id,
1518
+ company_id=company_id,
1519
+ tableId="sheet_abc123",
1520
+ columnOrder=2,
1521
+ columnWidth=200, # optional
1522
+ filter="ValueMatchFilter", # optional
1523
+ # filter: one of "ValueMatchFilter", "PartialMatchFilter", "ReferenceFilter",
1524
+ # "HallucinationFilter", "ReviewStatusFilter", "AssigneeFilter"
1525
+ cellRenderer="CheckboxLockCellRenderer", # optional
1526
+ # cellRenderer: one of "CheckboxLockCellRenderer", "CollaboratorDropdown",
1527
+ # "ReviewStatusDropdown", "CustomCellRenderer", "SelectableCellRenderer"
1528
+ editable=True # optional
1529
+ )
1530
+ ```
1531
+
1532
+ #### `unique_sdk.AgenticTable.set_cell_metadata`
1533
+
1534
+ Set metadata for a specific cell, including selection status and agreement status.
1535
+
1536
+ ```python
1537
+ result = await unique_sdk.AgenticTable.set_cell_metadata(
1538
+ user_id=user_id,
1539
+ company_id=company_id,
1540
+ tableId="sheet_abc123",
1541
+ rowOrder=0,
1542
+ columnOrder=1,
1543
+ selected=True, # optional
1544
+ selectionMethod="MANUAL", # optional, one of: "DEFAULT", "MANUAL"
1545
+ agreementStatus="MATCH" # optional, one of: "MATCH", "NO_MATCH"
1546
+ )
1547
+ ```
1548
+
1549
+ #### `unique_sdk.AgenticTable.bulk_update_status`
1550
+
1551
+ Update the verification status of multiple rows at once.
1552
+
1553
+ ```python
1554
+ result = await unique_sdk.AgenticTable.bulk_update_status(
1555
+ user_id=user_id,
1556
+ company_id=company_id,
1557
+ tableId="sheet_abc123",
1558
+ rowOrders=[0, 1, 2, 3, 4],
1559
+ status="VERIFIED"
1560
+ # status: one of "NEED_REVIEW", "READY_FOR_VERIFICATION", "VERIFIED"
1561
+ )
1562
+ ```
1563
+
1337
1564
  ## UniqueQL
1338
1565
 
1339
1566
  [UniqueQL](https://unique-ch.atlassian.net/wiki/x/coAXHQ) is an advanced query language designed to enhance search capabilities within various search modes such as Vector, Full-Text Search (FTS), and Combined. This query language enables users to perform detailed searches by filtering through metadata attributes like filenames, URLs, dates, and more. UniqueQL is versatile and can be translated into different query formats for various database systems, including PostgreSQL and Qdrant.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.10.31"
3
+ version = "0.10.36"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -28,6 +28,7 @@ pyright = "^1.1.341"
28
28
  pytest-cov = "^4.1.0"
29
29
  pytest-asyncio = "^0.24.0"
30
30
  python-dotenv = "^1.1.0"
31
+ httpx = "^0.28.1"
31
32
 
32
33
  [tool.poetry.extras]
33
34
  openai = ["openai"]
@@ -83,6 +83,10 @@ class Folder(APIResource["Folder"]):
83
83
  parentId: str | None
84
84
  externalId: str | None
85
85
 
86
+ class FolderInfos(TypedDict):
87
+ folderInfos: List["Folder.FolderInfo"]
88
+ totalCount: int
89
+
86
90
  id: str
87
91
  name: str
88
92
  scopeAccess: List[ScopeAccess]
@@ -212,12 +216,12 @@ class Folder(APIResource["Folder"]):
212
216
  @classmethod
213
217
  def get_infos(
214
218
  cls, user_id: str, company_id: str, **params: Unpack["Folder.GetInfosParams"]
215
- ) -> "List[Folder.FolderInfo]":
219
+ ) -> "Folder.FolderInfos":
216
220
  """
217
221
  Get paginated folders based on parentId. If the parentId is not defined, the root folders will be returned.
218
222
  """
219
223
  return cast(
220
- "List[Folder.FolderInfo]",
224
+ "Folder.FolderInfos",
221
225
  cls._static_request(
222
226
  "get",
223
227
  "/folder/infos",
@@ -230,12 +234,12 @@ class Folder(APIResource["Folder"]):
230
234
  @classmethod
231
235
  async def get_infos_async(
232
236
  cls, user_id: str, company_id: str, **params: Unpack["Folder.GetInfosParams"]
233
- ) -> "List[Folder.FolderInfo]":
237
+ ) -> "Folder.FolderInfos":
234
238
  """
235
239
  Async get paginated folders based on parentId. If the parentId is not defined, the root folders will be returned.
236
240
  """
237
241
  return cast(
238
- "List[Folder.FolderInfo]",
242
+ "Folder.FolderInfos",
239
243
  await cls._static_request_async(
240
244
  "get",
241
245
  "/folder/infos",
@@ -59,6 +59,16 @@ class Message(APIResource["Message"]):
59
59
  class RetrieveParams(RequestOptions):
60
60
  chatId: str
61
61
 
62
+ class CreateEventParams(RequestOptions):
63
+ messageId: str
64
+ chatId: str
65
+ originalText: NotRequired[str | None]
66
+ text: NotRequired[str | None]
67
+ references: NotRequired[List["Message.Reference"] | None]
68
+ gptRequest: NotRequired[Dict[str, Any] | None]
69
+ debugInfo: NotRequired[Dict[str, Any] | None]
70
+ completedAt: NotRequired[datetime | None]
71
+
62
72
  chatId: str
63
73
  text: Optional[str]
64
74
  role: Literal["SYSTEM", "USER", "ASSISTANT"]
@@ -303,3 +313,49 @@ class Message(APIResource["Message"]):
303
313
  company_id,
304
314
  params=params,
305
315
  )
316
+
317
+ @classmethod
318
+ def create_event(
319
+ cls,
320
+ user_id: str,
321
+ company_id: str,
322
+ **params: Unpack["Message.CreateEventParams"],
323
+ ) -> "Message":
324
+ """
325
+ Creates a new message event object.
326
+ """
327
+ message_id = params.get("messageId")
328
+ params.pop("messageId", None)
329
+ return cast(
330
+ "Message",
331
+ cls._static_request(
332
+ "post",
333
+ f"{cls.class_url()}/{message_id}/event",
334
+ user_id,
335
+ company_id,
336
+ params,
337
+ ),
338
+ )
339
+
340
+ @classmethod
341
+ async def create_event_async(
342
+ cls,
343
+ user_id: str,
344
+ company_id: str,
345
+ **params: Unpack["Message.CreateEventParams"],
346
+ ) -> "Message":
347
+ """
348
+ Creates a new message event object.
349
+ """
350
+ message_id = params.get("messageId")
351
+ params.pop("messageId", None)
352
+ return cast(
353
+ "Message",
354
+ await cls._static_request_async(
355
+ "post",
356
+ f"{cls.class_url()}/{message_id}/event",
357
+ user_id,
358
+ company_id,
359
+ params,
360
+ ),
361
+ )
@@ -8,16 +8,18 @@ class MessageExecution(APIResource["MessageExecution"]):
8
8
  OBJECT_NAME: ClassVar[Literal["message_execution"]] = "message_execution"
9
9
  RESOURCE_URL = "/message-execution"
10
10
 
11
+ TypeLiteral = Literal["DEEP_RESEARCH"]
12
+ StatusLiteral = Literal["PENDING", "RUNNING", "COMPLETED", "FAILED"]
13
+ # Only COMPLETED and FAILED statuses are allowed for update
14
+ UpdateStatusLiteral = Literal["COMPLETED", "FAILED"]
15
+
11
16
  class CreateMessageExecutionParams(RequestOptions):
12
17
  """
13
18
  Parameters for creating a message execution.
14
19
  """
15
20
 
16
21
  messageId: str
17
- chatId: str
18
- type: Literal["DEEP_RESEARCH"]
19
- secondsRemaining: NotRequired[int | None]
20
- percentageCompleted: NotRequired[int | None]
22
+ type: "MessageExecution.TypeLiteral"
21
23
 
22
24
  class GetMessageExecutionParams(RequestOptions):
23
25
  """
@@ -32,18 +34,19 @@ class MessageExecution(APIResource["MessageExecution"]):
32
34
  """
33
35
 
34
36
  messageId: str
35
- status: Literal["COMPLETED", "FAILED"]
37
+ status: NotRequired["MessageExecution.UpdateStatusLiteral | None"]
36
38
  secondsRemaining: NotRequired[int | None]
37
39
  percentageCompleted: NotRequired[int | None]
38
40
 
39
- messageExecutionId: str | None
40
- messageId: str | None
41
- status: Literal["PENDING", "RUNNING", "COMPLETED", "FAILED"]
42
- type: Literal["DEEP_RESEARCH"] = "DEEP_RESEARCH"
41
+ id: str
42
+ messageId: str
43
+ status: "MessageExecution.StatusLiteral"
44
+ type: "MessageExecution.TypeLiteral"
43
45
  secondsRemaining: int | None
44
46
  percentageCompleted: int | None
47
+ positionInQueue: int | None
45
48
  createdAt: str
46
- updatedAt: str | None
49
+ updatedAt: str
47
50
 
48
51
  @classmethod
49
52
  def create(
@@ -8,6 +8,8 @@ class MessageLog(APIResource["MessageLog"]):
8
8
  OBJECT_NAME: ClassVar[Literal["message_log"]] = "message_log"
9
9
  RESOURCE_URL = "/message-log"
10
10
 
11
+ StatusLiteral = Literal["RUNNING", "COMPLETED", "FAILED"]
12
+
11
13
  class Reference(TypedDict):
12
14
  name: str
13
15
  url: str | None
@@ -23,7 +25,7 @@ class MessageLog(APIResource["MessageLog"]):
23
25
 
24
26
  messageId: str
25
27
  text: str
26
- status: Literal["RUNNING", "COMPLETED", "FAILED"]
28
+ status: "MessageLog.StatusLiteral"
27
29
  order: int
28
30
  details: NotRequired[dict | None]
29
31
  uncitedReferences: NotRequired[dict | None]
@@ -35,21 +37,21 @@ class MessageLog(APIResource["MessageLog"]):
35
37
  """
36
38
 
37
39
  text: NotRequired[str | None]
38
- status: NotRequired[Literal["RUNNING", "COMPLETED", "FAILED"] | None]
40
+ status: NotRequired["MessageLog.StatusLiteral | None"]
39
41
  order: NotRequired[int | None]
40
42
  details: NotRequired[dict | None]
41
43
  uncitedReferences: NotRequired[dict | None]
42
44
  references: NotRequired[list["MessageLog.Reference"] | None]
43
45
 
44
- messageLogId: str | None
45
- messageId: str | None
46
- status: Literal["RUNNING", "COMPLETED", "FAILED"]
47
- text: str | None
46
+ id: str
47
+ messageId: str
48
+ status: "MessageLog.StatusLiteral"
49
+ text: str
48
50
  details: dict
49
51
  uncitedReferences: dict
50
52
  order: int
51
53
  createdAt: str
52
- updatedAt: str | None
54
+ updatedAt: str
53
55
 
54
56
  @classmethod
55
57
  def create(
@@ -69,7 +69,7 @@ class Space(APIResource["Space"]):
69
69
  chatId: str
70
70
  text: str | None
71
71
  originalText: str | None
72
- role: Literal["system", "user", "assistant"]
72
+ role: Literal["SYSTEM", "USER", "ASSISTANT"]
73
73
  debugInfo: Optional[Dict[str, Any]]
74
74
  completedAt: str | None
75
75
  createdAt: str | None
File without changes