unique_sdk 0.9.33__tar.gz → 0.9.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.

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.33 → unique_sdk-0.9.36}/CHANGELOG.md +9 -0
  2. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/PKG-INFO +77 -8
  3. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/README.md +67 -7
  4. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/pyproject.toml +1 -1
  5. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_chat_completion.py +10 -2
  6. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_folder.py +12 -12
  7. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/LICENSE +0 -0
  8. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/__init__.py +0 -0
  9. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_api_requestor.py +0 -0
  10. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_api_resource.py +0 -0
  11. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_api_version.py +0 -0
  12. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_error.py +0 -0
  13. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_http_client.py +0 -0
  14. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_list_object.py +0 -0
  15. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_object_classes.py +0 -0
  16. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_request_options.py +0 -0
  17. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_unique_object.py +0 -0
  18. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_unique_ql.py +0 -0
  19. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_unique_response.py +0 -0
  20. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_util.py +0 -0
  21. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_version.py +0 -0
  22. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/_webhook.py +0 -0
  23. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/__init__.py +0 -0
  24. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_acronyms.py +0 -0
  25. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_content.py +0 -0
  26. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_embedding.py +0 -0
  27. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_event.py +0 -0
  28. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_integrated.py +0 -0
  29. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_message.py +0 -0
  30. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_message_assessment.py +0 -0
  31. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_search.py +0 -0
  32. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_search_string.py +0 -0
  33. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  34. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/utils/chat_history.py +0 -0
  35. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/utils/file_io.py +0 -0
  36. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/utils/sources.py +0 -0
  37. {unique_sdk-0.9.33 → unique_sdk-0.9.36}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,15 @@ 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.36] - 2025-06-23
9
+ - Allow passing a user id when creating chat completions. This is optional and it does not impact the current behaviour.
10
+
11
+ ## [0.9.35] - 2025-06-18
12
+ - Allow scope access updates (add/remove) on folder based on scope id or path.
13
+
14
+ ## [0.9.34] - 2025-06-17
15
+ - Allow ingestion config updates on folder based on scope id or path.
16
+
8
17
  ## [0.9.33] - 2025-06-11
9
18
  - Add function to get a folder by id or by path.
10
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.9.33
3
+ Version: 0.9.36
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -508,18 +508,35 @@ unique_sdk.Folder.create_paths(
508
508
 
509
509
  #### `unique_sdk.Folder.update_ingestion_config`
510
510
 
511
- Allows you to update the ingestion config of a folder and whether to apply to the subscopes or not: `
511
+ Allows you to update the ingestion config of a folder and choose whether to apply to the subscopes or not: `
512
512
 
513
513
  - `ingestionConfig`
514
514
  - `applyToSubScopes`
515
515
 
516
- Example of updating the ingestion config of a folder and its subfolders.
516
+ The update can be done by referencing the folder by id or by path. If none of them are provided. the API will return an error. If both of them are provided, the scope id will take precedence.
517
+
518
+ Example of updating the ingestion config of a folder and its subfolders using the id.
519
+
520
+ ```python
521
+ unique_sdk.Folder.update_ingestion_config(
522
+ user_id=user_id,
523
+ company_id=company_id,
524
+ scopeId="scope_qbnkde820dbmuw2900,
525
+ ingestionConfig={
526
+ "chunkStrategy": "default",
527
+ "uniqueIngestionMode": "standard",
528
+ },
529
+ applyToSubScopes=True
530
+ )
531
+ ```
532
+
533
+ Example of updating the ingestion config of a folder and its subfolders using the path.
517
534
 
518
535
  ```python
519
536
  unique_sdk.Folder.update_ingestion_config(
520
537
  user_id=user_id,
521
538
  company_id=company_id,
522
- scope_id=scope_id,
539
+ folderPath="/Company/folder1/folder2",
523
540
  ingestionConfig={
524
541
  "chunkStrategy": "default",
525
542
  "uniqueIngestionMode": "standard",
@@ -535,13 +552,33 @@ Allows you to add access to a folder and apply to the subfolders or not: `
535
552
  - `scopeAccesses`
536
553
  - `applyToSubScopes`
537
554
 
538
- Example of adding access to a folder and its subfolders.
555
+ The update can be done by referencing the folder by id or by path. If none of them are provided. the API will return an error. If both of them are provided, the scope id will take precedence.
556
+
557
+ Example of adding access to a folder and its subfolders using the id.
539
558
 
540
559
  ```python
541
560
  unique_sdk.Folder.add_access(
542
561
  user_id=user_id,
543
562
  company_id=company_id,
544
- scope_id=scope_id,
563
+ scopeId="scope_231e4kjn4foffww34",
564
+ scopeAccesses=[
565
+ {
566
+ "entityId": "group_id",
567
+ "type": "WRITE",
568
+ "entityType": "GROUP",
569
+ }
570
+ ],
571
+ applyToSubScopes=True,
572
+ )
573
+ ```
574
+
575
+ Example of adding access to a folder and its subfolders using the folder path.
576
+
577
+ ```python
578
+ unique_sdk.Folder.add_access(
579
+ user_id=user_id,
580
+ company_id=company_id,
581
+ folderPath="/Company/folder1/folder2"
545
582
  scopeAccesses=[
546
583
  {
547
584
  "entityId": "group_id",
@@ -560,13 +597,35 @@ Allows you to delete access from a folder and apply to the subfolders or not: `
560
597
  - `scopeAccesses`
561
598
  - `applyToSubScopes`
562
599
 
563
- Example of deleting the access from a folder and its subfolders.
600
+ The update can be done by referencing the folder by id or by path. If none of them are provided. the API will return an error. If both of them are provided, the scope id will take precedence.
601
+
602
+
603
+ Example of deleting the access from a folder and its subfolders using the id.
604
+
605
+ ```python
606
+ unique_sdk.Folder.remove_access(
607
+ user_id=user_id,
608
+ company_id=company_id,
609
+ scopeId="scope_dwekjnf3330woioppm,
610
+ scopeAccesses=[
611
+ {
612
+ "entityId": "group_id",
613
+ "type": "WRITE",
614
+ "entityType": "GROUP",
615
+ }
616
+ ],
617
+ applyToSubScopes=True,
618
+ )
619
+ ```
620
+
621
+
622
+ Example of deleting the access from a folder and its subfolders using the path.
564
623
 
565
624
  ```python
566
625
  unique_sdk.Folder.remove_access(
567
626
  user_id=user_id,
568
627
  company_id=company_id,
569
- scope_id=scope_id,
628
+ folderPath="/Company/folder1/folder2"
570
629
  scopeAccesses=[
571
630
  {
572
631
  "entityId": "group_id",
@@ -717,6 +776,7 @@ Send a prompt to an AI model supported by Unique FinanceGPT and receive a result
717
776
  ```python
718
777
  chat_completion = unique_sdk.ChatCompletion.create(
719
778
  company_id=company_id,
779
+ user_id=user_id
720
780
  model="AZURE_GPT_35_TURBO",
721
781
  messages=[
722
782
  {"role": "system", "content": "You are a helpful assistant."},
@@ -1170,6 +1230,15 @@ All notable changes to this project will be documented in this file.
1170
1230
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1171
1231
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1172
1232
 
1233
+ ## [0.9.36] - 2025-06-23
1234
+ - Allow passing a user id when creating chat completions. This is optional and it does not impact the current behaviour.
1235
+
1236
+ ## [0.9.35] - 2025-06-18
1237
+ - Allow scope access updates (add/remove) on folder based on scope id or path.
1238
+
1239
+ ## [0.9.34] - 2025-06-17
1240
+ - Allow ingestion config updates on folder based on scope id or path.
1241
+
1173
1242
  ## [0.9.33] - 2025-06-11
1174
1243
  - Add function to get a folder by id or by path.
1175
1244
 
@@ -492,18 +492,35 @@ unique_sdk.Folder.create_paths(
492
492
 
493
493
  #### `unique_sdk.Folder.update_ingestion_config`
494
494
 
495
- Allows you to update the ingestion config of a folder and whether to apply to the subscopes or not: `
495
+ Allows you to update the ingestion config of a folder and choose whether to apply to the subscopes or not: `
496
496
 
497
497
  - `ingestionConfig`
498
498
  - `applyToSubScopes`
499
499
 
500
- Example of updating the ingestion config of a folder and its subfolders.
500
+ The update can be done by referencing the folder by id or by path. If none of them are provided. the API will return an error. If both of them are provided, the scope id will take precedence.
501
+
502
+ Example of updating the ingestion config of a folder and its subfolders using the id.
501
503
 
502
504
  ```python
503
505
  unique_sdk.Folder.update_ingestion_config(
504
506
  user_id=user_id,
505
507
  company_id=company_id,
506
- scope_id=scope_id,
508
+ scopeId="scope_qbnkde820dbmuw2900,
509
+ ingestionConfig={
510
+ "chunkStrategy": "default",
511
+ "uniqueIngestionMode": "standard",
512
+ },
513
+ applyToSubScopes=True
514
+ )
515
+ ```
516
+
517
+ Example of updating the ingestion config of a folder and its subfolders using the path.
518
+
519
+ ```python
520
+ unique_sdk.Folder.update_ingestion_config(
521
+ user_id=user_id,
522
+ company_id=company_id,
523
+ folderPath="/Company/folder1/folder2",
507
524
  ingestionConfig={
508
525
  "chunkStrategy": "default",
509
526
  "uniqueIngestionMode": "standard",
@@ -519,13 +536,33 @@ Allows you to add access to a folder and apply to the subfolders or not: `
519
536
  - `scopeAccesses`
520
537
  - `applyToSubScopes`
521
538
 
522
- Example of adding access to a folder and its subfolders.
539
+ The update can be done by referencing the folder by id or by path. If none of them are provided. the API will return an error. If both of them are provided, the scope id will take precedence.
540
+
541
+ Example of adding access to a folder and its subfolders using the id.
542
+
543
+ ```python
544
+ unique_sdk.Folder.add_access(
545
+ user_id=user_id,
546
+ company_id=company_id,
547
+ scopeId="scope_231e4kjn4foffww34",
548
+ scopeAccesses=[
549
+ {
550
+ "entityId": "group_id",
551
+ "type": "WRITE",
552
+ "entityType": "GROUP",
553
+ }
554
+ ],
555
+ applyToSubScopes=True,
556
+ )
557
+ ```
558
+
559
+ Example of adding access to a folder and its subfolders using the folder path.
523
560
 
524
561
  ```python
525
562
  unique_sdk.Folder.add_access(
526
563
  user_id=user_id,
527
564
  company_id=company_id,
528
- scope_id=scope_id,
565
+ folderPath="/Company/folder1/folder2"
529
566
  scopeAccesses=[
530
567
  {
531
568
  "entityId": "group_id",
@@ -544,13 +581,35 @@ Allows you to delete access from a folder and apply to the subfolders or not: `
544
581
  - `scopeAccesses`
545
582
  - `applyToSubScopes`
546
583
 
547
- Example of deleting the access from a folder and its subfolders.
584
+ The update can be done by referencing the folder by id or by path. If none of them are provided. the API will return an error. If both of them are provided, the scope id will take precedence.
585
+
586
+
587
+ Example of deleting the access from a folder and its subfolders using the id.
588
+
589
+ ```python
590
+ unique_sdk.Folder.remove_access(
591
+ user_id=user_id,
592
+ company_id=company_id,
593
+ scopeId="scope_dwekjnf3330woioppm,
594
+ scopeAccesses=[
595
+ {
596
+ "entityId": "group_id",
597
+ "type": "WRITE",
598
+ "entityType": "GROUP",
599
+ }
600
+ ],
601
+ applyToSubScopes=True,
602
+ )
603
+ ```
604
+
605
+
606
+ Example of deleting the access from a folder and its subfolders using the path.
548
607
 
549
608
  ```python
550
609
  unique_sdk.Folder.remove_access(
551
610
  user_id=user_id,
552
611
  company_id=company_id,
553
- scope_id=scope_id,
612
+ folderPath="/Company/folder1/folder2"
554
613
  scopeAccesses=[
555
614
  {
556
615
  "entityId": "group_id",
@@ -701,6 +760,7 @@ Send a prompt to an AI model supported by Unique FinanceGPT and receive a result
701
760
  ```python
702
761
  chat_completion = unique_sdk.ChatCompletion.create(
703
762
  company_id=company_id,
763
+ user_id=user_id
704
764
  model="AZURE_GPT_35_TURBO",
705
765
  messages=[
706
766
  {"role": "system", "content": "You are a helpful assistant."},
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.9.33"
3
+ version = "0.9.36"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -52,7 +52,10 @@ class ChatCompletion(APIResource["ChatCompletion"]):
52
52
 
53
53
  @classmethod
54
54
  def create(
55
- cls, company_id: str, **params: Unpack["ChatCompletion.CreateParams"]
55
+ cls,
56
+ company_id: str,
57
+ user_id: str | None = None,
58
+ **params: Unpack["ChatCompletion.CreateParams"],
56
59
  ) -> "ChatCompletion":
57
60
  return cast(
58
61
  "ChatCompletion",
@@ -60,13 +63,17 @@ class ChatCompletion(APIResource["ChatCompletion"]):
60
63
  "post",
61
64
  cls.class_url(),
62
65
  company_id=company_id,
66
+ user_id=user_id,
63
67
  params=params,
64
68
  ),
65
69
  )
66
70
 
67
71
  @classmethod
68
72
  async def create_async(
69
- cls, company_id: str, **params: Unpack["ChatCompletion.CreateParams"]
73
+ cls,
74
+ company_id: str,
75
+ user_id: str | None = None,
76
+ **params: Unpack["ChatCompletion.CreateParams"],
70
77
  ) -> "ChatCompletion":
71
78
  return cast(
72
79
  "ChatCompletion",
@@ -74,6 +81,7 @@ class ChatCompletion(APIResource["ChatCompletion"]):
74
81
  "post",
75
82
  cls.class_url(),
76
83
  company_id=company_id,
84
+ user_id=user_id,
77
85
  params=params,
78
86
  ),
79
87
  )
@@ -101,6 +101,8 @@ class Folder(APIResource["Folder"]):
101
101
  Parameters for updating folder ingestion config.
102
102
  """
103
103
 
104
+ scopeId: str | None
105
+ folderPath: str | None
104
106
  ingestionConfig: "Folder.IngestionConfig"
105
107
  applyToSubScopes: bool
106
108
 
@@ -109,6 +111,8 @@ class Folder(APIResource["Folder"]):
109
111
  Parameters for adding access to a folder.
110
112
  """
111
113
 
114
+ scopeId: str | None
115
+ folderPath: str | None
112
116
  scopeAccesses: List["Folder.ScopeAccess"]
113
117
  applyToSubScopes: bool
114
118
 
@@ -117,6 +121,8 @@ class Folder(APIResource["Folder"]):
117
121
  Parameters for removing access from a folder.
118
122
  """
119
123
 
124
+ scopeId: str | None
125
+ folderPath: str | None
120
126
  scopeAccesses: List["Folder.ScopeAccess"]
121
127
  applyToSubScopes: bool
122
128
 
@@ -199,7 +205,6 @@ class Folder(APIResource["Folder"]):
199
205
  cls,
200
206
  user_id: str,
201
207
  company_id: str,
202
- scope_id: str,
203
208
  **params: Unpack["Folder.UpdateIngestionConfigParams"],
204
209
  ) -> "Folder":
205
210
  """
@@ -209,7 +214,7 @@ class Folder(APIResource["Folder"]):
209
214
  "Folder",
210
215
  cls._static_request(
211
216
  "patch",
212
- f"/folder/{scope_id}/ingestion-config",
217
+ "/folder/ingestion-config",
213
218
  user_id,
214
219
  company_id,
215
220
  params=params,
@@ -221,7 +226,6 @@ class Folder(APIResource["Folder"]):
221
226
  cls,
222
227
  user_id: str,
223
228
  company_id: str,
224
- scope_id: str,
225
229
  **params: Unpack["Folder.UpdateIngestionConfigParams"],
226
230
  ) -> "Folder":
227
231
  """
@@ -231,7 +235,7 @@ class Folder(APIResource["Folder"]):
231
235
  "Folder",
232
236
  await cls._static_request_async(
233
237
  "patch",
234
- f"/folder/{scope_id}/ingestion-config",
238
+ "/folder/ingestion-config",
235
239
  user_id,
236
240
  company_id,
237
241
  params=params,
@@ -243,7 +247,6 @@ class Folder(APIResource["Folder"]):
243
247
  cls,
244
248
  user_id: str,
245
249
  company_id: str,
246
- scope_id: str,
247
250
  **params: Unpack["Folder.AddAccessParams"],
248
251
  ) -> "Folder":
249
252
  """
@@ -253,7 +256,7 @@ class Folder(APIResource["Folder"]):
253
256
  "Folder",
254
257
  cls._static_request(
255
258
  "patch",
256
- f"/folder/{scope_id}/access",
259
+ "/folder/add-access",
257
260
  user_id,
258
261
  company_id,
259
262
  params=params,
@@ -265,7 +268,6 @@ class Folder(APIResource["Folder"]):
265
268
  cls,
266
269
  user_id: str,
267
270
  company_id: str,
268
- scope_id: str,
269
271
  **params: Unpack["Folder.AddAccessParams"],
270
272
  ) -> "Folder":
271
273
  """
@@ -275,7 +277,7 @@ class Folder(APIResource["Folder"]):
275
277
  "Folder",
276
278
  await cls._static_request_async(
277
279
  "patch",
278
- f"/folder/{scope_id}/access",
280
+ "/folder/add-access",
279
281
  user_id,
280
282
  company_id,
281
283
  params=params,
@@ -287,7 +289,6 @@ class Folder(APIResource["Folder"]):
287
289
  cls,
288
290
  user_id: str,
289
291
  company_id: str,
290
- scope_id: str,
291
292
  **params: Unpack["Folder.RemoveAccessParams"],
292
293
  ) -> dict:
293
294
  """
@@ -297,7 +298,7 @@ class Folder(APIResource["Folder"]):
297
298
  dict,
298
299
  cls._static_request(
299
300
  "patch",
300
- f"/folder/{scope_id}/remove-access",
301
+ "/folder/remove-access",
301
302
  user_id,
302
303
  company_id,
303
304
  params=params,
@@ -309,7 +310,6 @@ class Folder(APIResource["Folder"]):
309
310
  cls,
310
311
  user_id: str,
311
312
  company_id: str,
312
- scope_id: str,
313
313
  **params: Unpack["Folder.RemoveAccessParams"],
314
314
  ) -> "Folder":
315
315
  """
@@ -319,7 +319,7 @@ class Folder(APIResource["Folder"]):
319
319
  "Folder",
320
320
  await cls._static_request_async(
321
321
  "patch",
322
- f"/folder/{scope_id}/remove-access",
322
+ "/folder/remove-access",
323
323
  user_id,
324
324
  company_id,
325
325
  params=params,
File without changes