unique_sdk 0.10.43__py3-none-any.whl → 0.10.47__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.
@@ -29,6 +29,7 @@ class Content(APIResource["Content"]):
29
29
  metadata: Optional[Dict[str, Any]]
30
30
  writeUrl: Optional[str]
31
31
  readUrl: Optional[str]
32
+ expiredAt: Optional[str]
32
33
 
33
34
  class QueryMode(Enum):
34
35
  Default = "default"
@@ -25,6 +25,15 @@ class Group(APIResource["Group"]):
25
25
  take: NotRequired[Optional[int]]
26
26
  name: NotRequired[Optional[str]]
27
27
 
28
+ class CreateParams(RequestOptions):
29
+ """
30
+ Parameters for creating a group.
31
+ """
32
+
33
+ name: str
34
+ externalId: NotRequired[Optional[str]]
35
+ parentId: NotRequired[Optional[str]]
36
+
28
37
  class UpdateParams(RequestOptions):
29
38
  """
30
39
  Parameters for updating a group.
@@ -32,6 +41,20 @@ class Group(APIResource["Group"]):
32
41
 
33
42
  name: NotRequired[Optional[str]]
34
43
 
44
+ class AddUsersParams(RequestOptions):
45
+ """
46
+ Parameters for adding users to a group.
47
+ """
48
+
49
+ userIds: List[str]
50
+
51
+ class RemoveUsersParams(RequestOptions):
52
+ """
53
+ Parameters for removing users from a group.
54
+ """
55
+
56
+ userIds: List[str]
57
+
35
58
  class GroupMember(TypedDict):
36
59
  """
37
60
  Represents a member of a group.
@@ -39,6 +62,15 @@ class Group(APIResource["Group"]):
39
62
 
40
63
  entityId: str
41
64
 
65
+ class GroupMembership(TypedDict):
66
+ """
67
+ Represents a membership relationship between a user and a group.
68
+ """
69
+
70
+ entityId: str
71
+ groupId: str
72
+ createdAt: str
73
+
42
74
  class Group(TypedDict):
43
75
  """
44
76
  Represents a group in the company.
@@ -48,7 +80,6 @@ class Group(APIResource["Group"]):
48
80
  name: str
49
81
  externalId: str
50
82
  parentId: Optional[str]
51
- roles: Optional[List[str]]
52
83
  members: Optional[List["Group.GroupMember"]]
53
84
  createdAt: str
54
85
  updatedAt: str
@@ -67,6 +98,62 @@ class Group(APIResource["Group"]):
67
98
 
68
99
  id: str
69
100
 
101
+ class AddUsersToGroupResponse(TypedDict):
102
+ """
103
+ Response for adding users to a group.
104
+ """
105
+
106
+ memberships: List["Group.GroupMembership"]
107
+
108
+ class RemoveUsersFromGroupResponse(TypedDict):
109
+ """
110
+ Response for removing users from a group.
111
+ """
112
+
113
+ success: bool
114
+
115
+ @classmethod
116
+ def create_group(
117
+ cls,
118
+ user_id: str,
119
+ company_id: str,
120
+ **params: Unpack["Group.CreateParams"],
121
+ ) -> "Group.Group":
122
+ """
123
+ Create a group in a company.
124
+ """
125
+ return cast(
126
+ "Group.Group",
127
+ cls._static_request(
128
+ "post",
129
+ "/groups",
130
+ user_id,
131
+ company_id,
132
+ params=params,
133
+ ),
134
+ )
135
+
136
+ @classmethod
137
+ async def create_group_async(
138
+ cls,
139
+ user_id: str,
140
+ company_id: str,
141
+ **params: Unpack["Group.CreateParams"],
142
+ ) -> "Group.Group":
143
+ """
144
+ Async create a group in a company.
145
+ """
146
+ return cast(
147
+ "Group.Group",
148
+ await cls._static_request_async(
149
+ "post",
150
+ "/groups",
151
+ user_id,
152
+ company_id,
153
+ params=params,
154
+ ),
155
+ )
156
+
70
157
  @classmethod
71
158
  def get_groups(
72
159
  cls,
@@ -192,3 +279,91 @@ class Group(APIResource["Group"]):
192
279
  params=params,
193
280
  ),
194
281
  )
282
+
283
+ @classmethod
284
+ def add_users_to_group(
285
+ cls,
286
+ user_id: str,
287
+ company_id: str,
288
+ group_id: str,
289
+ **params: Unpack["Group.AddUsersParams"],
290
+ ) -> "Group.AddUsersToGroupResponse":
291
+ """
292
+ Add users to a group in a company.
293
+ """
294
+ return cast(
295
+ "Group.AddUsersToGroupResponse",
296
+ cls._static_request(
297
+ "post",
298
+ f"/groups/{group_id}/users",
299
+ user_id,
300
+ company_id,
301
+ params=params,
302
+ ),
303
+ )
304
+
305
+ @classmethod
306
+ async def add_users_to_group_async(
307
+ cls,
308
+ user_id: str,
309
+ company_id: str,
310
+ group_id: str,
311
+ **params: Unpack["Group.AddUsersParams"],
312
+ ) -> "Group.AddUsersToGroupResponse":
313
+ """
314
+ Async add users to a group in a company.
315
+ """
316
+ return cast(
317
+ "Group.AddUsersToGroupResponse",
318
+ await cls._static_request_async(
319
+ "post",
320
+ f"/groups/{group_id}/users",
321
+ user_id,
322
+ company_id,
323
+ params=params,
324
+ ),
325
+ )
326
+
327
+ @classmethod
328
+ def remove_users_from_group(
329
+ cls,
330
+ user_id: str,
331
+ company_id: str,
332
+ group_id: str,
333
+ **params: Unpack["Group.RemoveUsersParams"],
334
+ ) -> "Group.RemoveUsersFromGroupResponse":
335
+ """
336
+ Remove users from a group in a company.
337
+ """
338
+ return cast(
339
+ "Group.RemoveUsersFromGroupResponse",
340
+ cls._static_request(
341
+ "delete",
342
+ f"/groups/{group_id}/users",
343
+ user_id,
344
+ company_id,
345
+ params=params,
346
+ ),
347
+ )
348
+
349
+ @classmethod
350
+ async def remove_users_from_group_async(
351
+ cls,
352
+ user_id: str,
353
+ company_id: str,
354
+ group_id: str,
355
+ **params: Unpack["Group.RemoveUsersParams"],
356
+ ) -> "Group.RemoveUsersFromGroupResponse":
357
+ """
358
+ Async remove users from a group in a company.
359
+ """
360
+ return cast(
361
+ "Group.RemoveUsersFromGroupResponse",
362
+ await cls._static_request_async(
363
+ "delete",
364
+ f"/groups/{group_id}/users",
365
+ user_id,
366
+ company_id,
367
+ params=params,
368
+ ),
369
+ )
@@ -29,6 +29,14 @@ class Space(APIResource["Space"]):
29
29
  toolChoices: NotRequired[List[str] | None]
30
30
  scopeRules: NotRequired[dict | None]
31
31
 
32
+ class GetChatMessagesParams(RequestOptions):
33
+ """
34
+ Parameters for getting chat messages.
35
+ """
36
+
37
+ skip: NotRequired[int]
38
+ take: NotRequired[int]
39
+
32
40
  class Reference(TypedDict):
33
41
  """
34
42
  Reference information for a message.
@@ -86,6 +94,14 @@ class Space(APIResource["Space"]):
86
94
 
87
95
  chat_id: str
88
96
 
97
+ class GetAllMessagesResponse(TypedDict):
98
+ """
99
+ Response for getting all messages in a chat.
100
+ """
101
+
102
+ messages: List["Space.Message"]
103
+ totalCount: int
104
+
89
105
  @classmethod
90
106
  def create_message(
91
107
  cls,
@@ -130,6 +146,50 @@ class Space(APIResource["Space"]):
130
146
  ),
131
147
  )
132
148
 
149
+ @classmethod
150
+ def get_chat_messages(
151
+ cls,
152
+ user_id: str,
153
+ company_id: str,
154
+ chat_id: str,
155
+ **params: Unpack["Space.GetChatMessagesParams"],
156
+ ) -> "Space.GetAllMessagesResponse":
157
+ """
158
+ Get all messages in a space chat.
159
+ """
160
+ return cast(
161
+ "Space.GetAllMessagesResponse",
162
+ cls._static_request(
163
+ "get",
164
+ f"/space/chat/{chat_id}/messages",
165
+ user_id,
166
+ company_id,
167
+ params=params,
168
+ ),
169
+ )
170
+
171
+ @classmethod
172
+ async def get_chat_messages_async(
173
+ cls,
174
+ user_id: str,
175
+ company_id: str,
176
+ chat_id: str,
177
+ **params: Unpack["Space.GetChatMessagesParams"],
178
+ ) -> "Space.GetAllMessagesResponse":
179
+ """
180
+ Async get all messages in a space chat.
181
+ """
182
+ return cast(
183
+ "Space.GetAllMessagesResponse",
184
+ await cls._static_request_async(
185
+ "get",
186
+ f"/space/chat/{chat_id}/messages",
187
+ user_id,
188
+ company_id,
189
+ params=params,
190
+ ),
191
+ )
192
+
133
193
  @classmethod
134
194
  def get_latest_message(
135
195
  cls, user_id: str, company_id: str, chat_id: str
@@ -76,6 +76,7 @@ async def chat_against_file(
76
76
  text: str,
77
77
  poll_interval: float = 1.0,
78
78
  max_wait: float = 60.0,
79
+ should_delete_chat: bool = True,
79
80
  ) -> "Space.Message":
80
81
  """
81
82
  Chat against a file by uploading it, sending a message and waiting for a reply.
@@ -140,8 +141,8 @@ async def chat_against_file(
140
141
  print(f"Error during chat against file: {err}")
141
142
  raise
142
143
  finally:
143
- if chat_id:
144
- Space.delete_chat(
144
+ if chat_id and should_delete_chat:
145
+ await Space.delete_chat_async(
145
146
  user_id=user_id,
146
147
  company_id=company_id,
147
148
  chat_id=chat_id,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.43
3
+ Version: 0.10.47
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -1392,6 +1392,20 @@ message = unique_sdk.Space.create_message(
1392
1392
  )
1393
1393
  ```
1394
1394
 
1395
+ #### `unique_sdk.Space.get_chat_messages` (Compatible with release >.48)
1396
+
1397
+ Get all messages in a space chat. Returns a list of paginated messages in the specified chat.
1398
+
1399
+ ```python
1400
+ messages = unique_sdk.Space.get_chat_messages(
1401
+ user_id=user_id,
1402
+ company_id=company_id,
1403
+ chat_id="chat_dejfhe729br398",
1404
+ skip=0, # Optional (defaults to 0) - number of messages to skip for pagination
1405
+ take=50, # Optional (defaults to 10) - number of messages to return
1406
+ )
1407
+ ```
1408
+
1395
1409
  #### `unique_sdk.Space.get_latest_message`
1396
1410
 
1397
1411
  Get the latest message in a space chat.
@@ -1449,6 +1463,20 @@ users = unique_sdk.User.get_users(
1449
1463
 
1450
1464
  ### Group
1451
1465
 
1466
+ #### `unique_sdk.Group.create_group` (Compatible with release >.48)
1467
+
1468
+ Create a new group in a company. You can specify the group name (required), external ID and parent group ID.
1469
+
1470
+ ```python
1471
+ group = unique_sdk.Group.create_group(
1472
+ user_id=user_id,
1473
+ company_id=company_id,
1474
+ name="New Group", # Required - the name of the group
1475
+ externalId="ext_123", # Optional - external ID for the group
1476
+ parentId="group_a9cs7wr2z1bg2sxczvltgjch", # Optional - parent group ID
1477
+ )
1478
+ ```
1479
+
1452
1480
  #### `unique_sdk.Group.get_groups` (Compatible with release >.48)
1453
1481
 
1454
1482
  Get groups in a company. You can filter by name and use pagination with skip and take parameters.
@@ -1471,11 +1499,37 @@ Update a group in a company. You can update the group's name.
1471
1499
  updated_group = unique_sdk.Group.update_group(
1472
1500
  user_id=user_id,
1473
1501
  company_id=company_id,
1474
- group_id="group_id_here",
1502
+ group_id="group_a9cs7wr2z1bg2sxczvltgjch",
1475
1503
  name="New Group Name", # Optional - update the group name
1476
1504
  )
1477
1505
  ```
1478
1506
 
1507
+ #### `unique_sdk.Group.add_users_to_group` (Compatible with release >.48)
1508
+
1509
+ Add users to a group. Provide an array of user IDs to add as members to the specified group.
1510
+
1511
+ ```python
1512
+ result = unique_sdk.Group.add_users_to_group(
1513
+ user_id=user_id,
1514
+ company_id=company_id,
1515
+ group_id="group_a9cs7wr2z1bg2sxczvltgjch",
1516
+ userIds=["299420877169688584", "325402458132058201", "299426678160031752"], # Required - array of user IDs to add
1517
+ )
1518
+ ```
1519
+
1520
+ #### `unique_sdk.Group.remove_users_from_group` (Compatible with release >.48)
1521
+
1522
+ Remove users from a group. Provide an array of user IDs to remove from the specified group.
1523
+
1524
+ ```python
1525
+ result = unique_sdk.Group.remove_users_from_group(
1526
+ user_id=user_id,
1527
+ company_id=company_id,
1528
+ group_id="group_a9cs7wr2z1bg2sxczvltgjch",
1529
+ userIds=["299426678160031752", "299426678160031752"], # Required - array of user IDs to remove
1530
+ )
1531
+ ```
1532
+
1479
1533
  #### `unique_sdk.Group.delete_group` (Compatible with release >.48)
1480
1534
 
1481
1535
  Delete a group in a company by its group ID.
@@ -1484,7 +1538,7 @@ Delete a group in a company by its group ID.
1484
1538
  result = unique_sdk.Group.delete_group(
1485
1539
  user_id=user_id,
1486
1540
  company_id=company_id,
1487
- group_id="group_id_here",
1541
+ group_id="group_a9cs7wr2z1bg2sxczvltgjch",
1488
1542
  )
1489
1543
  ```
1490
1544
 
@@ -2032,11 +2086,12 @@ You must provide the following parameters:
2032
2086
  - `mime_type`: The mime type of the ifle to be uploaded.
2033
2087
  - `text`: The text to be sent to the chat for chatting against the file.
2034
2088
 
2035
- The script creates a chat and uploads the file to it. It then keeps polling the `ingestionState` field of the message, waiting for it to reach `FINISHED`, signaling the upload is complete. Once the file uploads successfully, the script sends the text, continues polling for completion, and finally retrieves the response message.
2089
+ The script creates a chat and uploads the file to it. It then keeps polling the `ingestionState` field of the message, waiting for it to reach `FINISHED`, signaling the upload is complete. Once the file uploads successfully, the script sends the text, continues polling for completion, and finally retrieves the response message. The function deletes the chat at the end unless the `should_delete_chat` is set to false.
2036
2090
 
2037
2091
  **Optional parameters:**
2038
2092
  - `poll_interval`: The number of seconds to wait between polling attempts (default: `1` second).
2039
2093
  - `max_wait`: The maximum number of seconds to wait for the message to complete (default: `60` seconds).
2094
+ - `should_delete_chat`: Setting this flag determines whether the chat should be deleted at the end or not. Default is True.
2040
2095
 
2041
2096
  Example of chatting against a PDF. (The usage can be extended to any supported file type)
2042
2097
 
@@ -2046,8 +2101,8 @@ latest_message = await unique_sdk.utils.chat_in_space.chat_against_file(
2046
2101
  company_id=company_id,
2047
2102
  assistant_id="assistant_hjcdga64bkcjnhu4",
2048
2103
  path_to_file="/files/hello.pdf",
2049
- displayed_filename="hello.pdf"
2050
- mime_type="application/pdf"
2104
+ displayed_filename="hello.pdf",
2105
+ mime_type="application/pdf",
2051
2106
  text="Give me a bullet point summary of the file.",
2052
2107
  )
2053
2108
  ```
@@ -2093,6 +2148,18 @@ All notable changes to this project will be documented in this file.
2093
2148
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2094
2149
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
2095
2150
 
2151
+ ## [0.10.47] - 2025-11-19
2152
+ - Add expired/s at fields on content search result.
2153
+
2154
+ ## [0.10.46] - 2025-11-18
2155
+ - chat_against_file function allows now a should_delete_chat flag.
2156
+
2157
+ ## [0.10.45] - 2025-11-18
2158
+ - Create group and manage users functions.
2159
+
2160
+ ## [0.10.44] - 2025-11-18
2161
+ - add function to get all messages in a chat.
2162
+
2096
2163
  ## [0.10.43] - 2025-11-14
2097
2164
  - Add get, delete and update groups functions.
2098
2165
 
@@ -17,11 +17,11 @@ unique_sdk/api_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
17
17
  unique_sdk/api_resources/_acronyms.py,sha256=GIU1XH1flGWQYcpsFqTYwg4ioIGxVmb15tux84nmhEg,891
18
18
  unique_sdk/api_resources/_agentic_table.py,sha256=8-_f7t-m_iiiOj2835iESoxz91YRxl4-tkxpzQbgdcI,9958
19
19
  unique_sdk/api_resources/_chat_completion.py,sha256=ILCAffxkbkfh2iV9L4KKnfe80gZmT9pWfkNmf3mq68U,2172
20
- unique_sdk/api_resources/_content.py,sha256=Z7BU2bw1qULnn-UBX0f6ix_XV0qI1yaRH6zOSgtMvho,17514
20
+ unique_sdk/api_resources/_content.py,sha256=vRynwj4QBZA1v2CVg_xbhmLqqh3m4cPGMoLeFZTaSYA,17543
21
21
  unique_sdk/api_resources/_embedding.py,sha256=C6qak7cCUBMBINfPhgH8taCJZ9n6w1MUElqDJJ8dG10,1281
22
22
  unique_sdk/api_resources/_event.py,sha256=bpWF9vstdoAWbUzr-iiGP713ceP0zPk77GJXiImf9zg,374
23
23
  unique_sdk/api_resources/_folder.py,sha256=WPyRPsdAE62tU7p4hEYiVB4OoArv_60b8t4j7hgrJKk,15765
24
- unique_sdk/api_resources/_group.py,sha256=f3spoWF0fX0rZkWrJZdalBMLkwRtccNOSSxFadypum0,4341
24
+ unique_sdk/api_resources/_group.py,sha256=KnuUkk9RxNPLTMBShCxJxNKcfx90yogt4BNoGU5lmRk,8685
25
25
  unique_sdk/api_resources/_integrated.py,sha256=O8e673z-RB7FRFMQYn_YEuHijebr5W7KJxkUnymbBZk,6164
26
26
  unique_sdk/api_resources/_llm_models.py,sha256=3Jn6MpxWgZ43Hze8JHd4_n27si5xmwd3JE8r8cEZq_M,1640
27
27
  unique_sdk/api_resources/_mcp.py,sha256=zKh0dyn0QnkKk57N2zlGVN_GQoxEp5T2CS38vVm6jQY,3341
@@ -32,14 +32,14 @@ unique_sdk/api_resources/_message_log.py,sha256=_DifZ4Di7uKyzkP0i8rwu5IIiYZPCBp5
32
32
  unique_sdk/api_resources/_search.py,sha256=GQItZKoGNOVZfkLLltBmsRZYBIreRKU0lGW8Kgpj1_Q,1959
33
33
  unique_sdk/api_resources/_search_string.py,sha256=LZz2_QPZXV1NXucRR06dnDC2miK7J8XBY7dXX2xoDY4,1610
34
34
  unique_sdk/api_resources/_short_term_memory.py,sha256=vPRN-Y0WPx74E6y-A3LocGc0TxJdzT-xGL66WzZwKRg,2820
35
- unique_sdk/api_resources/_space.py,sha256=JjIPauH37wULEiNO5PqOfgsipyfbRlC0KqjJ4_1Uugg,5035
35
+ unique_sdk/api_resources/_space.py,sha256=yQGoK3o8YbaEdoJvrWzx97Rbx_kdhRKNVsE1jdw_a5E,6580
36
36
  unique_sdk/api_resources/_user.py,sha256=u59Hgq9i-QhYlqIYgk-KE7OeSx5xuNVo_gUgDpZTLcI,1974
37
37
  unique_sdk/utils/chat_history.py,sha256=5UqL9hF1O9pV7skbNOlEibF5rHdYsmG3m5-YEPUowOs,3037
38
- unique_sdk/utils/chat_in_space.py,sha256=cdjETBLnjv-OE8qsQpm626ks5yBdfQG_KBeG0WIzCbY,5994
38
+ unique_sdk/utils/chat_in_space.py,sha256=e_Ny03eB7Q8oijdUR_sPlFTIgq2rsCbSR-Sin8jnxM8,6066
39
39
  unique_sdk/utils/file_io.py,sha256=lskRULIh7qExK26o_1YqRs0f5mqJHTS9m_mdxlsVo4s,4497
40
40
  unique_sdk/utils/sources.py,sha256=DoxxhMLcLhmDfNarjXa41H4JD2GSSDywr71hiC-4pYc,4952
41
41
  unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
42
- unique_sdk-0.10.43.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
43
- unique_sdk-0.10.43.dist-info/METADATA,sha256=KdrdST-aefdKEsL0BaXUxAm4IyhnZSwc4TcKVDEVOBA,71736
44
- unique_sdk-0.10.43.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
45
- unique_sdk-0.10.43.dist-info/RECORD,,
42
+ unique_sdk-0.10.47.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
43
+ unique_sdk-0.10.47.dist-info/METADATA,sha256=EwP9zbqw4sD462AvIvxAElpPxcbtdY27fePcUE9SdOY,74141
44
+ unique_sdk-0.10.47.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
45
+ unique_sdk-0.10.47.dist-info/RECORD,,