unique_sdk 0.10.30__py3-none-any.whl → 0.10.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.

Potentially problematic release.


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

@@ -59,6 +59,16 @@ class Message(APIResource["Message"]):
59
59
  class RetrieveParams(RequestOptions):
60
60
  chatId: str
61
61
 
62
+ class CreateEventParams(RequestOptions):
63
+ messageId: str
64
+ chatId: str
65
+ originalText: NotRequired[str | None]
66
+ text: NotRequired[str | None]
67
+ references: NotRequired[List["Message.Reference"] | None]
68
+ gptRequest: NotRequired[Dict[str, Any] | None]
69
+ debugInfo: NotRequired[Dict[str, Any] | None]
70
+ completedAt: NotRequired[datetime | None]
71
+
62
72
  chatId: str
63
73
  text: Optional[str]
64
74
  role: Literal["SYSTEM", "USER", "ASSISTANT"]
@@ -303,3 +313,49 @@ class Message(APIResource["Message"]):
303
313
  company_id,
304
314
  params=params,
305
315
  )
316
+
317
+ @classmethod
318
+ def create_event(
319
+ cls,
320
+ user_id: str,
321
+ company_id: str,
322
+ **params: Unpack["Message.CreateEventParams"],
323
+ ) -> "Message":
324
+ """
325
+ Creates a new message event object.
326
+ """
327
+ message_id = params.get("messageId")
328
+ params.pop("messageId", None)
329
+ return cast(
330
+ "Message",
331
+ cls._static_request(
332
+ "post",
333
+ f"{cls.class_url()}/{message_id}/event",
334
+ user_id,
335
+ company_id,
336
+ params,
337
+ ),
338
+ )
339
+
340
+ @classmethod
341
+ async def create_event_async(
342
+ cls,
343
+ user_id: str,
344
+ company_id: str,
345
+ **params: Unpack["Message.CreateEventParams"],
346
+ ) -> "Message":
347
+ """
348
+ Creates a new message event object.
349
+ """
350
+ message_id = params.get("messageId")
351
+ params.pop("messageId", None)
352
+ return cast(
353
+ "Message",
354
+ await cls._static_request_async(
355
+ "post",
356
+ f"{cls.class_url()}/{message_id}/event",
357
+ user_id,
358
+ company_id,
359
+ params,
360
+ ),
361
+ )
@@ -36,7 +36,7 @@ class MessageLog(APIResource["MessageLog"]):
36
36
 
37
37
  text: NotRequired[str | None]
38
38
  status: NotRequired[Literal["RUNNING", "COMPLETED", "FAILED"] | None]
39
- order: int
39
+ order: NotRequired[int | None]
40
40
  details: NotRequired[dict | None]
41
41
  uncitedReferences: NotRequired[dict | None]
42
42
  references: NotRequired[list["MessageLog.Reference"] | None]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.30
3
+ Version: 0.10.32
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -31,6 +31,8 @@ The Unique Python SDK provides access to the public API of Unique AI. It also en
31
31
  5. [Available API Resources](#available-api-resources)
32
32
  - [Content](#content)
33
33
  - [Message](#message)
34
+ - [Message Log](#message-log)
35
+ - [Message Execution](#message-execution)
34
36
  - [Chat Completion](#chat-completion)
35
37
  - [Embeddings](#embeddings)
36
38
  - [Acronyms](#acronyms)
@@ -246,6 +248,8 @@ unique_sdk.Message.modify(
246
248
 
247
249
  - [Content](#content)
248
250
  - [Message](#message)
251
+ - [Message Log](#message-log)
252
+ - [Message Execution](#message-execution)
249
253
  - [Chat Completion](#chat-completion)
250
254
  - [Embeddings](#embeddings)
251
255
  - [Acronyms](#acronyms)
@@ -696,6 +700,26 @@ message = unique_sdk.Message.create(
696
700
  )
697
701
  ```
698
702
 
703
+ #### `unique_sdk.Message.create_event`
704
+
705
+ Create a new message event in a chat. Updating the text of a message in the chat UI is possible by creating a message update event. This function can be used for custom streaming to the chat. (Compatible with release >.42)
706
+
707
+ The event only changes the text in the UI, it *does not* update the database.
708
+
709
+ ```python
710
+ message = unique_sdk.Message.create_event(
711
+ user_id=user_id,
712
+ company_id=company_id,
713
+ messageId="msg_l4ushn85yqbewpf6tllh2cl7",
714
+ chatId="chat_kc8p3kgkn7393qhgmv5js5nt",
715
+ text="Hello.", #optional
716
+ originalText="Hello.", #optional
717
+ references=[], #optional
718
+ gptRequest={} #optional
719
+ debugInfo={ "hello": "test" }, #optional
720
+ )
721
+ ```
722
+
699
723
  #### `unique_sdk.Message.modify`
700
724
 
701
725
  Modify an existing chat message.
@@ -817,6 +841,89 @@ unique_sdk.Integrated.responses_stream(
817
841
 
818
842
  **Warning:** Currently, the deletion of a chat message does not automatically sync with the user UI. Users must refresh the chat page to view the updated state. This issue will be addressed in a future update of our API.
819
843
 
844
+ ### Message Log
845
+
846
+ #### `unique_sdk.MessageLog.create`
847
+
848
+ Function to update the steps section of a message in the chat UI. This is possible by creating a message log record during a message execution.
849
+
850
+ ```python
851
+ msg_log = unique_sdk.MessageLog.create(
852
+ user_id=user_id,
853
+ company_id=company_id,
854
+ messageId="msg_a0jgnt1jrqv1d3uzr450waxw",
855
+ text="Create message log text",
856
+ order=1,
857
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
858
+ details={}, # optional, details dictionary
859
+ uncitedReferences={}, # optional, references dictionary
860
+ references=[], # optional, list of references
861
+ )
862
+ ```
863
+
864
+ #### `unique_sdk.MessageLog.update`
865
+
866
+ Update a message log for a provided `messageId`.
867
+
868
+ ```python
869
+ msg_log = unique_sdk.MessageLog.update(
870
+ user_id=user_id,
871
+ company_id=company_id,
872
+ message_log_id="message_log_fd7z7gjljo1z2wu5g6l9q7r9",
873
+ text="Update a message log text", # optional
874
+ order=1, # optional
875
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
876
+ details={}, # optional, details dictionary
877
+ uncitedReferences={}, # optional, references dictionary
878
+ references=[], # optional, list of references
879
+ )
880
+ ```
881
+
882
+ ### Message Execution
883
+
884
+ #### `unique_sdk.MessageExecution.create`
885
+
886
+ Create a message execution for a provided `messageId` and `chatId`.
887
+
888
+ ```python
889
+ msg_execution = unique_sdk.MessageExecution.create(
890
+ user_id=user_id,
891
+ company_id=company_id,
892
+ messageId="msg_a0jgnt1jrqv143uzr750waxw",
893
+ chatId="chat_nx21havszl1skchd7544oykh",
894
+ type="DEEP_RESEARCH",
895
+ secondsRemaining=None, # optional, number defining the seconds remaining
896
+ percentageCompleted=None, # optional, number defining the percentage completed
897
+ )
898
+ ```
899
+
900
+ #### `unique_sdk.MessageExecution.get`
901
+
902
+ Get a message execution for a provided `messageId`.
903
+
904
+ ```python
905
+ msg_execution = unique_sdk.MessageExecution.get(
906
+ user_id=user_id,
907
+ company_id=company_id,
908
+ messageId="msg_a0jgnt1jrqv143uzr750waxw",
909
+ )
910
+ ```
911
+
912
+ #### `unique_sdk.MessageExecution.update`
913
+
914
+ Update a message execution for a provided `messageId`.
915
+
916
+ ```python
917
+ msg_execution = unique_sdk.MessageExecution.update(
918
+ user_id=user_id,
919
+ company_id=company_id,
920
+ messageId="msg_a0jgnt1jrqv143uzr750waxw",
921
+ status="COMPLETED", # one of: COMPLETED, FAILED
922
+ secondsRemaining=55, # optional, number defining the seconds remaining
923
+ percentageCompleted=10, # optional, number defining the percentage completed
924
+ )
925
+ ```
926
+
820
927
  ### Chat Completion
821
928
 
822
929
  #### `unique_sdk.ChatCompletion.create`
@@ -1662,6 +1769,12 @@ All notable changes to this project will be documented in this file.
1662
1769
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1663
1770
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1664
1771
 
1772
+ ## [0.10.32] - 2025-10-14
1773
+ - Add function to stream to chat frontend.
1774
+
1775
+ ## [0.10.31] - 2025-10-13
1776
+ - Add readme for message log and execution.
1777
+
1665
1778
  ## [0.10.30] - 2025-10-07
1666
1779
  - Improve types for content get infos.
1667
1780
 
@@ -23,10 +23,10 @@ unique_sdk/api_resources/_event.py,sha256=bpWF9vstdoAWbUzr-iiGP713ceP0zPk77GJXiI
23
23
  unique_sdk/api_resources/_folder.py,sha256=mEKN3llhgi2Zyg-aVyz_LUU55V5ZGOKhgKytlyxBVF8,15679
24
24
  unique_sdk/api_resources/_integrated.py,sha256=O8e673z-RB7FRFMQYn_YEuHijebr5W7KJxkUnymbBZk,6164
25
25
  unique_sdk/api_resources/_mcp.py,sha256=zKh0dyn0QnkKk57N2zlGVN_GQoxEp5T2CS38vVm6jQY,3341
26
- unique_sdk/api_resources/_message.py,sha256=gEDIzg3METZU2k7m69meAuf0IWmZxnYOjbBKPRMwPYE,7688
26
+ unique_sdk/api_resources/_message.py,sha256=WgdvVS6Gx3gXGlaSlCjE-qrlj3SbkF--EFG7HiSp6cM,9282
27
27
  unique_sdk/api_resources/_message_assessment.py,sha256=SSfx6eW7zb_GKe8cFJzCqW-t-_eWEXxKP5cnIb0DhIc,2276
28
28
  unique_sdk/api_resources/_message_execution.py,sha256=qQH9NS8sdWLr55Yzc8pvPpYdfpewtSh6fy2alJjEoZk,4444
29
- unique_sdk/api_resources/_message_log.py,sha256=gV8hhzR_fgS28Ofpir6BjzuSyH6hXZgm8Pt3u0Onv2M,3658
29
+ unique_sdk/api_resources/_message_log.py,sha256=-R8f_WDv7ug5PU4OPktlRlvKEPwsYPtfhf2oAc7zdww,3678
30
30
  unique_sdk/api_resources/_search.py,sha256=GQItZKoGNOVZfkLLltBmsRZYBIreRKU0lGW8Kgpj1_Q,1959
31
31
  unique_sdk/api_resources/_search_string.py,sha256=LZz2_QPZXV1NXucRR06dnDC2miK7J8XBY7dXX2xoDY4,1610
32
32
  unique_sdk/api_resources/_short_term_memory.py,sha256=vPRN-Y0WPx74E6y-A3LocGc0TxJdzT-xGL66WzZwKRg,2820
@@ -36,7 +36,7 @@ unique_sdk/utils/chat_in_space.py,sha256=cdjETBLnjv-OE8qsQpm626ks5yBdfQG_KBeG0WI
36
36
  unique_sdk/utils/file_io.py,sha256=sJS-dJLjogG65mLukDO9pGDpKVTP4LhIgiZASnCvjNI,4330
37
37
  unique_sdk/utils/sources.py,sha256=DoxxhMLcLhmDfNarjXa41H4JD2GSSDywr71hiC-4pYc,4952
38
38
  unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
39
- unique_sdk-0.10.30.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
40
- unique_sdk-0.10.30.dist-info/METADATA,sha256=sKfJEwb0ATujyQrHOhdxaQsMy7SM_2LJBp-PCjH6u6w,57999
41
- unique_sdk-0.10.30.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
42
- unique_sdk-0.10.30.dist-info/RECORD,,
39
+ unique_sdk-0.10.32.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
40
+ unique_sdk-0.10.32.dist-info/METADATA,sha256=YRS5ChDwbvY7ZmFyhp46Qsh-pysRlXEodEbUqJJWtcI,61865
41
+ unique_sdk-0.10.32.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
42
+ unique_sdk-0.10.32.dist-info/RECORD,,