unique_sdk 0.9.31__py3-none-any.whl → 0.9.32__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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, any] | None = None
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
+ )
@@ -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, any] | None = None,
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.9.31
3
+ Version: 0.9.32
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -434,6 +434,40 @@ def upload_file(
434
434
 
435
435
  ```
436
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
+
437
471
  ### Folder
438
472
 
439
473
  #### `unique_sdk.Folder.create_paths`
@@ -1112,6 +1146,9 @@ All notable changes to this project will be documented in this file.
1112
1146
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1113
1147
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1114
1148
 
1149
+ ## [0.9.32] - 2025-06-11
1150
+ - Add function to ingest magic table sheets.
1151
+
1115
1152
  ## [0.9.31] - 2025-05-21
1116
1153
  - Add function to update folder access (add or remove).
1117
1154
 
@@ -16,7 +16,7 @@ unique_sdk/_webhook.py,sha256=GYxbUibQN_W4XlNTHaMIksT9FQJk4LJmlKcxOu3jqiU,2855
16
16
  unique_sdk/api_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  unique_sdk/api_resources/_acronyms.py,sha256=GIU1XH1flGWQYcpsFqTYwg4ioIGxVmb15tux84nmhEg,891
18
18
  unique_sdk/api_resources/_chat_completion.py,sha256=hAPPHxoljcoHeTboxoJkcXgpqA2hNBu6a6vamdxag58,2000
19
- unique_sdk/api_resources/_content.py,sha256=GWCiJMjbiNQFvo8RZ9cnCnTbWMo4NiUxLx-WgTzssc4,7589
19
+ unique_sdk/api_resources/_content.py,sha256=BLv4qXdazSYy_L0Z9ihr0hquE3xFIY32CBpfbOkxSpE,9527
20
20
  unique_sdk/api_resources/_embedding.py,sha256=C6qak7cCUBMBINfPhgH8taCJZ9n6w1MUElqDJJ8dG10,1281
21
21
  unique_sdk/api_resources/_event.py,sha256=bpWF9vstdoAWbUzr-iiGP713ceP0zPk77GJXiImf9zg,374
22
22
  unique_sdk/api_resources/_folder.py,sha256=E-v4JAixhtYsOZXbEOTO8gyykPzPr62MraoPPy01vn8,6900
@@ -27,10 +27,10 @@ unique_sdk/api_resources/_search.py,sha256=pAVMXL2AdJNP5JG-7LlaU2Uw1152iUaMZ2YO7
27
27
  unique_sdk/api_resources/_search_string.py,sha256=4Idw6exgZdA8qksz9WkiA68k1hTU-7yFkgT_OLU_GkE,1662
28
28
  unique_sdk/api_resources/_short_term_memory.py,sha256=vPRN-Y0WPx74E6y-A3LocGc0TxJdzT-xGL66WzZwKRg,2820
29
29
  unique_sdk/utils/chat_history.py,sha256=5UqL9hF1O9pV7skbNOlEibF5rHdYsmG3m5-YEPUowOs,3037
30
- unique_sdk/utils/file_io.py,sha256=jR1sj1SxOvqmCoLfYkevgTktcTZId0ORoqYjmwVoyJw,4301
30
+ unique_sdk/utils/file_io.py,sha256=YY8B7VJcTLOPmCXByiOfNerXGlAtjCC5EVNmAbQJ3dQ,4306
31
31
  unique_sdk/utils/sources.py,sha256=wfboE-neMKa0Wuq9QzfAEFMkNLrIrmm0v-QF33sLo6k,4952
32
32
  unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
33
- unique_sdk-0.9.31.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
34
- unique_sdk-0.9.31.dist-info/METADATA,sha256=v0jkEyJg5EwdcPDFfkyjKuAKBDEpiaMDJ6jkmrQ2j2g,35598
35
- unique_sdk-0.9.31.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
- unique_sdk-0.9.31.dist-info/RECORD,,
33
+ unique_sdk-0.9.32.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
34
+ unique_sdk-0.9.32.dist-info/METADATA,sha256=Wrj-GZIv--qHQYw3KeN7g4gW0VQWypWm3ljOqxOD84M,36689
35
+ unique_sdk-0.9.32.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ unique_sdk-0.9.32.dist-info/RECORD,,