unique_sdk 0.9.31__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.

Potentially problematic release.


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

Files changed (37) hide show
  1. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/CHANGELOG.md +3 -0
  2. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/PKG-INFO +38 -1
  3. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/README.md +34 -0
  4. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/pyproject.toml +1 -1
  5. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_content.py +63 -1
  6. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/utils/file_io.py +2 -2
  7. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/LICENSE +0 -0
  8. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/__init__.py +0 -0
  9. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_api_requestor.py +0 -0
  10. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_api_resource.py +0 -0
  11. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_api_version.py +0 -0
  12. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_error.py +0 -0
  13. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_http_client.py +0 -0
  14. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_list_object.py +0 -0
  15. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_object_classes.py +0 -0
  16. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_request_options.py +0 -0
  17. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_unique_object.py +0 -0
  18. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_unique_ql.py +0 -0
  19. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_unique_response.py +0 -0
  20. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_util.py +0 -0
  21. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_version.py +0 -0
  22. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/_webhook.py +0 -0
  23. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/__init__.py +0 -0
  24. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_acronyms.py +0 -0
  25. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_chat_completion.py +0 -0
  26. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_embedding.py +0 -0
  27. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_event.py +0 -0
  28. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_folder.py +0 -0
  29. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_integrated.py +0 -0
  30. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_message.py +0 -0
  31. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_message_assessment.py +0 -0
  32. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_search.py +0 -0
  33. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_search_string.py +0 -0
  34. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  35. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/utils/chat_history.py +0 -0
  36. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/utils/sources.py +0 -0
  37. {unique_sdk-0.9.31 → unique_sdk-0.9.32}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,9 @@ 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
+
8
11
  ## [0.9.31] - 2025-05-21
9
12
  - Add function to update folder access (add or remove).
10
13
 
@@ -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
 
@@ -418,6 +418,40 @@ def upload_file(
418
418
 
419
419
  ```
420
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
+
421
455
  ### Folder
422
456
 
423
457
  #### `unique_sdk.Folder.create_paths`
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.9.31"
3
+ version = "0.9.32"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -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:
File without changes