unique_sdk 0.10.39__py3-none-any.whl → 0.10.42__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.
unique_sdk/__init__.py CHANGED
@@ -84,6 +84,7 @@ from unique_sdk.api_resources._folder import Folder as Folder
84
84
  from unique_sdk.api_resources._embedding import Embeddings as Embeddings
85
85
  from unique_sdk.api_resources._acronyms import Acronyms as Acronyms
86
86
  from unique_sdk.api_resources._llm_models import LLMModels as LLMModels
87
+ from unique_sdk.api_resources._user import User as User
87
88
  from unique_sdk.api_resources._message_assessment import (
88
89
  MessageAssessment as MessageAssessment,
89
90
  )
@@ -351,6 +351,9 @@ class Content(APIResource["Content"]):
351
351
  """
352
352
  if "input" in params:
353
353
  params["input"]["metadata"] = params["input"].get("metadata") or {}
354
+ if "description" in params["input"] and not params["input"]["description"]:
355
+ params["input"].pop("description")
356
+
354
357
  return cast(
355
358
  "Content",
356
359
  cls._static_request(
@@ -374,6 +377,9 @@ class Content(APIResource["Content"]):
374
377
  """
375
378
  if "input" in params:
376
379
  params["input"]["metadata"] = params["input"].get("metadata") or {}
380
+ if "description" in params["input"] and not params["input"]["description"]:
381
+ params["input"].pop("description")
382
+
377
383
  return cast(
378
384
  "Content",
379
385
  await cls._static_request_async(
@@ -167,6 +167,12 @@ class Message(APIResource["Message"]):
167
167
  """
168
168
  Creates a new message object.
169
169
  """
170
+ # Clean up empty descriptions from references
171
+ if "references" in params and params["references"]:
172
+ for ref in params["references"]:
173
+ if "description" in ref and not ref["description"]:
174
+ ref.pop("description")
175
+
170
176
  return cast(
171
177
  "Message",
172
178
  cls._static_request(
@@ -188,6 +194,12 @@ class Message(APIResource["Message"]):
188
194
  """
189
195
  Creates a new message object.
190
196
  """
197
+ # Clean up empty descriptions from references
198
+ if "references" in params and params["references"]:
199
+ for ref in params["references"]:
200
+ if "description" in ref and not ref["description"]:
201
+ ref.pop("description")
202
+
191
203
  return cast(
192
204
  "Message",
193
205
  await cls._static_request_async(
@@ -210,6 +222,12 @@ class Message(APIResource["Message"]):
210
222
  """
211
223
  Updates an existing message object.
212
224
  """
225
+ # Clean up empty descriptions from references
226
+ if "references" in params and params["references"]:
227
+ for ref in params["references"]:
228
+ if "description" in ref and not ref["description"]:
229
+ ref.pop("description")
230
+
213
231
  url = "%s/%s" % (cls.class_url(), quote_plus(id))
214
232
  return cast(
215
233
  "Message",
@@ -233,6 +251,12 @@ class Message(APIResource["Message"]):
233
251
  """
234
252
  Updates an existing message object.
235
253
  """
254
+ # Clean up empty descriptions from references
255
+ if "references" in params and params["references"]:
256
+ for ref in params["references"]:
257
+ if "description" in ref and not ref["description"]:
258
+ ref.pop("description")
259
+
236
260
  url = "%s/%s" % (cls.class_url(), quote_plus(id))
237
261
  return cast(
238
262
  "Message",
@@ -326,6 +350,12 @@ class Message(APIResource["Message"]):
326
350
  """
327
351
  Creates a new message event object.
328
352
  """
353
+ # Clean up empty descriptions from references
354
+ if "references" in params and params["references"]:
355
+ for ref in params["references"]:
356
+ if "description" in ref and not ref["description"]:
357
+ ref.pop("description")
358
+
329
359
  message_id = params.get("messageId")
330
360
  params.pop("messageId", None)
331
361
  return cast(
@@ -349,6 +379,12 @@ class Message(APIResource["Message"]):
349
379
  """
350
380
  Creates a new message event object.
351
381
  """
382
+ # Clean up empty descriptions from references
383
+ if "references" in params and params["references"]:
384
+ for ref in params["references"]:
385
+ if "description" in ref and not ref["description"]:
386
+ ref.pop("description")
387
+
352
388
  message_id = params.get("messageId")
353
389
  params.pop("messageId", None)
354
390
  return cast(
@@ -64,6 +64,12 @@ class MessageLog(APIResource["MessageLog"]):
64
64
  """
65
65
  Create a MessageLog.
66
66
  """
67
+ # Clean up empty descriptions from references
68
+ if "references" in params and params["references"]:
69
+ for ref in params["references"]:
70
+ if "description" in ref and not ref["description"]:
71
+ ref.pop("description")
72
+
67
73
  return cast(
68
74
  "MessageLog",
69
75
  cls._static_request(
@@ -85,6 +91,12 @@ class MessageLog(APIResource["MessageLog"]):
85
91
  """
86
92
  Async create a MessageLog.
87
93
  """
94
+ # Clean up empty descriptions from references
95
+ if "references" in params and params["references"]:
96
+ for ref in params["references"]:
97
+ if "description" in ref and not ref["description"]:
98
+ ref.pop("description")
99
+
88
100
  return cast(
89
101
  "MessageLog",
90
102
  await cls._static_request_async(
@@ -107,6 +119,12 @@ class MessageLog(APIResource["MessageLog"]):
107
119
  """
108
120
  Update a MessageLog.
109
121
  """
122
+ # Clean up empty descriptions from references
123
+ if "references" in params and params["references"]:
124
+ for ref in params["references"]:
125
+ if "description" in ref and not ref["description"]:
126
+ ref.pop("description")
127
+
110
128
  return cast(
111
129
  "MessageLog",
112
130
  cls._static_request(
@@ -129,6 +147,12 @@ class MessageLog(APIResource["MessageLog"]):
129
147
  """
130
148
  Async update a MessageLog.
131
149
  """
150
+ # Clean up empty descriptions from references
151
+ if "references" in params and params["references"]:
152
+ for ref in params["references"]:
153
+ if "description" in ref and not ref["description"]:
154
+ ref.pop("description")
155
+
132
156
  return cast(
133
157
  "MessageLog",
134
158
  await cls._static_request_async(
@@ -0,0 +1,91 @@
1
+ from typing import (
2
+ ClassVar,
3
+ List,
4
+ NotRequired,
5
+ Optional,
6
+ TypedDict,
7
+ Unpack,
8
+ cast,
9
+ )
10
+
11
+ from unique_sdk._api_resource import APIResource
12
+ from unique_sdk._request_options import RequestOptions
13
+
14
+
15
+ class User(APIResource["User"]):
16
+ OBJECT_NAME: ClassVar[str] = "users"
17
+
18
+ class GetParams(RequestOptions):
19
+ """
20
+ Parameters for getting users in a company.
21
+ """
22
+
23
+ skip: NotRequired[Optional[int]]
24
+ take: NotRequired[Optional[int]]
25
+ email: NotRequired[Optional[str]]
26
+ displayName: NotRequired[Optional[str]]
27
+
28
+ class User(TypedDict):
29
+ """
30
+ Represents a user in the company.
31
+ """
32
+
33
+ id: str
34
+ externalId: Optional[str]
35
+ firstName: str
36
+ lastName: str
37
+ displayName: str
38
+ userName: str
39
+ email: str
40
+ updatedAt: str
41
+ createdAt: str
42
+ active: bool
43
+
44
+ class Users(TypedDict):
45
+ """
46
+ Response for getting users.
47
+ """
48
+
49
+ users: List["User.User"]
50
+
51
+ @classmethod
52
+ def get_users(
53
+ cls,
54
+ user_id: str,
55
+ company_id: str,
56
+ **params: Unpack["User.GetParams"],
57
+ ) -> "User.Users":
58
+ """
59
+ Get users in a company.
60
+ """
61
+ return cast(
62
+ "User.Users",
63
+ cls._static_request(
64
+ "get",
65
+ "/users",
66
+ user_id,
67
+ company_id,
68
+ params=params,
69
+ ),
70
+ )
71
+
72
+ @classmethod
73
+ async def get_users_async(
74
+ cls,
75
+ user_id: str,
76
+ company_id: str,
77
+ **params: Unpack["User.GetParams"],
78
+ ) -> "User.Users":
79
+ """
80
+ Async get users in a company.
81
+ """
82
+ return cast(
83
+ "User.Users",
84
+ await cls._static_request_async(
85
+ "get",
86
+ "/users",
87
+ user_id,
88
+ company_id,
89
+ params=params,
90
+ ),
91
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.39
3
+ Version: 0.10.42
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -43,6 +43,7 @@ The Unique Python SDK provides access to the public API of Unique AI. It also en
43
43
  - [Folder](#folder)
44
44
  - [Space](#space)
45
45
  - [LLM Models](#llm-models)
46
+ - [User](#user)
46
47
  - [Agentic Table](#agentic-table)
47
48
  6. [UniqueQL](#uniqueql)
48
49
  - [Query Structure](#uniqueql-query-structure)
@@ -262,6 +263,7 @@ unique_sdk.Message.modify(
262
263
  - [Folder](#folder)
263
264
  - [Space](#space)
264
265
  - [LLM Models](#llm-models)
266
+ - [User](#user)
265
267
  - [Agentic Table](#agentic-table)
266
268
 
267
269
  Most of the API services provide an asynchronous version of the method. The async methods are suffixed with `_async`.
@@ -1364,6 +1366,42 @@ unique_sdk.Folder.delete(
1364
1366
 
1365
1367
  ### Space
1366
1368
 
1369
+ #### `unique_sdk.Space.create_message`
1370
+
1371
+ Send a message in a space. You can optionally provide a chat ID to continue an existing conversation, or omit it to start a new chat.
1372
+
1373
+ ```python
1374
+ message = unique_sdk.Space.create_message(
1375
+ user_id=user_id,
1376
+ company_id=company_id,
1377
+ chatId="chat_dejfhe729br398", # Optional - if not provided, a new chat will be created
1378
+ assistantId="assistant_abc123",
1379
+ text="Hello, how can you help me?",
1380
+ toolChoices=["WebSearch"], # Optional - list of tools to use
1381
+ scopeRules={ # Optional - scope rules for filtering
1382
+ "or": [
1383
+ {
1384
+ "operator": "contains",
1385
+ "path": ["folderIdPath"],
1386
+ "value": "uniquepathid://scope_123"
1387
+ }
1388
+ ]
1389
+ },
1390
+ )
1391
+ ```
1392
+
1393
+ #### `unique_sdk.Space.get_latest_message`
1394
+
1395
+ Get the latest message in a space chat.
1396
+
1397
+ ```python
1398
+ message = unique_sdk.Space.get_latest_message(
1399
+ user_id=user_id,
1400
+ company_id=company_id,
1401
+ chat_id="chat_dejfhe729br398",
1402
+ )
1403
+ ```
1404
+
1367
1405
  #### `unique_sdk.Space.delete_chat`
1368
1406
 
1369
1407
  Delete a space chat by id. If the chat does not exist, the function will return an error.
@@ -1390,6 +1428,23 @@ models = unique_sdk.LLMModels.get(
1390
1428
  )
1391
1429
  ```
1392
1430
 
1431
+ ### User
1432
+
1433
+ #### `unique_sdk.User.get_users` (Compatible with release >.48)
1434
+
1435
+ Get users in a company. You can filter by email, display name, and use pagination with skip and take parameters.
1436
+
1437
+ ```python
1438
+ users = unique_sdk.User.get_users(
1439
+ user_id=user_id,
1440
+ company_id=company_id,
1441
+ skip=0, # Optional - number of records to skip for pagination
1442
+ take=50, # Optional - number of records to return (max 1000)
1443
+ email="user@example.com", # Optional - filter by email
1444
+ displayName="John", # Optional - filter by display name
1445
+ )
1446
+ ```
1447
+
1393
1448
  ### Agentic Table
1394
1449
 
1395
1450
  The Agentic Table (Magic Table) API provides functionality for managing interactive tables with AI-powered cells, activity tracking, and metadata management.
@@ -1995,6 +2050,15 @@ All notable changes to this project will be documented in this file.
1995
2050
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1996
2051
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1997
2052
 
2053
+ ## [0.10.42] - 2025-11-14
2054
+ - Add get_users function.
2055
+
2056
+ ## [0.10.41] - 2025-11-13
2057
+ - Add create_message and get_latest_message.
2058
+
2059
+ ## [0.10.40] - 2025-11-10
2060
+ - Don't send description if not defined.
2061
+
1998
2062
  ## [0.10.39] - 2025-11-07
1999
2063
  - Add function to get llm models
2000
2064
 
@@ -1,4 +1,4 @@
1
- unique_sdk/__init__.py,sha256=64n1MmnhHojvt32j8QwF-t7JhTPyw9WIWKVBtkjrAVU,4089
1
+ unique_sdk/__init__.py,sha256=nBscz8qGKhZxUDUM43h4hfTjWZ_IWSswNo6bQ1K0TMs,4145
2
2
  unique_sdk/_api_requestor.py,sha256=i4gCpzx8zP95sv-AhJfpQxKvWR0U-I6lclHyV55RPtg,14397
3
3
  unique_sdk/_api_resource.py,sha256=ytjomI-IVJwsbvdPyuZCfF-bl-Abgf66bu1D34YxCu8,6244
4
4
  unique_sdk/_api_version.py,sha256=Ku4JPdeyJtnX5eJJvRCEc1_u44UObdVrvrL1T-WwWCs,46
@@ -17,27 +17,28 @@ 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=H-aL-dhWSBhMW4nFGpMuGziu0N-c0DnqY4mRAzsy2gU,17234
20
+ unique_sdk/api_resources/_content.py,sha256=Z7BU2bw1qULnn-UBX0f6ix_XV0qI1yaRH6zOSgtMvho,17514
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
24
  unique_sdk/api_resources/_integrated.py,sha256=O8e673z-RB7FRFMQYn_YEuHijebr5W7KJxkUnymbBZk,6164
25
25
  unique_sdk/api_resources/_llm_models.py,sha256=3Jn6MpxWgZ43Hze8JHd4_n27si5xmwd3JE8r8cEZq_M,1640
26
26
  unique_sdk/api_resources/_mcp.py,sha256=zKh0dyn0QnkKk57N2zlGVN_GQoxEp5T2CS38vVm6jQY,3341
27
- unique_sdk/api_resources/_message.py,sha256=W1Bh51lujpzmiFhZ-Mv_alQYZEY1OTEUr9O-k5jEgVM,9360
27
+ unique_sdk/api_resources/_message.py,sha256=tSS_jVwoAffBFH6RSClEnbRf48MleL7RMs3MnbNDq-E,10986
28
28
  unique_sdk/api_resources/_message_assessment.py,sha256=SSfx6eW7zb_GKe8cFJzCqW-t-_eWEXxKP5cnIb0DhIc,2276
29
29
  unique_sdk/api_resources/_message_execution.py,sha256=7V_Qovu4vzoXDd2em0AgnAJC460RUX6AE4byztNPlvg,4556
30
- unique_sdk/api_resources/_message_log.py,sha256=gwxDmEvTMDF9Nz5gH8Mq7qWw73dcjdqGJZjA0b42s6U,3709
30
+ unique_sdk/api_resources/_message_log.py,sha256=_DifZ4Di7uKyzkP0i8rwu5IIiYZPCBp5lvE4gfTrTHw,4793
31
31
  unique_sdk/api_resources/_search.py,sha256=GQItZKoGNOVZfkLLltBmsRZYBIreRKU0lGW8Kgpj1_Q,1959
32
32
  unique_sdk/api_resources/_search_string.py,sha256=LZz2_QPZXV1NXucRR06dnDC2miK7J8XBY7dXX2xoDY4,1610
33
33
  unique_sdk/api_resources/_short_term_memory.py,sha256=vPRN-Y0WPx74E6y-A3LocGc0TxJdzT-xGL66WzZwKRg,2820
34
34
  unique_sdk/api_resources/_space.py,sha256=JjIPauH37wULEiNO5PqOfgsipyfbRlC0KqjJ4_1Uugg,5035
35
+ unique_sdk/api_resources/_user.py,sha256=u59Hgq9i-QhYlqIYgk-KE7OeSx5xuNVo_gUgDpZTLcI,1974
35
36
  unique_sdk/utils/chat_history.py,sha256=5UqL9hF1O9pV7skbNOlEibF5rHdYsmG3m5-YEPUowOs,3037
36
37
  unique_sdk/utils/chat_in_space.py,sha256=cdjETBLnjv-OE8qsQpm626ks5yBdfQG_KBeG0WIzCbY,5994
37
38
  unique_sdk/utils/file_io.py,sha256=lskRULIh7qExK26o_1YqRs0f5mqJHTS9m_mdxlsVo4s,4497
38
39
  unique_sdk/utils/sources.py,sha256=DoxxhMLcLhmDfNarjXa41H4JD2GSSDywr71hiC-4pYc,4952
39
40
  unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
40
- unique_sdk-0.10.39.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
41
- unique_sdk-0.10.39.dist-info/METADATA,sha256=h60DXGC-Jf-cQ7PJHKstxh2OwyrZkUK3syPIseslL8Q,68798
42
- unique_sdk-0.10.39.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
43
- unique_sdk-0.10.39.dist-info/RECORD,,
41
+ unique_sdk-0.10.42.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
42
+ unique_sdk-0.10.42.dist-info/METADATA,sha256=hZwJdmI3RPTLRNJgAcPH0kedZuEo1pMK-7zfNpe0uvs,70570
43
+ unique_sdk-0.10.42.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
44
+ unique_sdk-0.10.42.dist-info/RECORD,,