unique_sdk 0.10.31__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
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.31
3
+ Version: 0.10.32
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -700,6 +700,26 @@ message = unique_sdk.Message.create(
700
700
  )
701
701
  ```
702
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
+
703
723
  #### `unique_sdk.Message.modify`
704
724
 
705
725
  Modify an existing chat message.
@@ -825,7 +845,7 @@ unique_sdk.Integrated.responses_stream(
825
845
 
826
846
  #### `unique_sdk.MessageLog.create`
827
847
 
828
- Create a message log for a provided `messageId`.
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.
829
849
 
830
850
  ```python
831
851
  msg_log = unique_sdk.MessageLog.create(
@@ -834,10 +854,10 @@ msg_log = unique_sdk.MessageLog.create(
834
854
  messageId="msg_a0jgnt1jrqv1d3uzr450waxw",
835
855
  text="Create message log text",
836
856
  order=1,
837
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
838
- details=None, # optional, details dictionary
839
- uncitedReferences=None, # optional, references dictionary
840
- references=None, # optional, list of references
857
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
858
+ details={}, # optional, details dictionary
859
+ uncitedReferences={}, # optional, references dictionary
860
+ references=[], # optional, list of references
841
861
  )
842
862
  ```
843
863
 
@@ -850,12 +870,12 @@ msg_log = unique_sdk.MessageLog.update(
850
870
  user_id=user_id,
851
871
  company_id=company_id,
852
872
  message_log_id="message_log_fd7z7gjljo1z2wu5g6l9q7r9",
853
- text="Update a message log text", # optional
854
- order=1, # optional
855
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
856
- details=None, # optional, details dictionary
857
- uncitedReferences=None, # optional, references dictionary
858
- references=None,
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
859
879
  )
860
880
  ```
861
881
 
@@ -871,9 +891,9 @@ msg_execution = unique_sdk.MessageExecution.create(
871
891
  company_id=company_id,
872
892
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
873
893
  chatId="chat_nx21havszl1skchd7544oykh",
874
- type="DEEP_RESEARCH"
875
- secondsRemaining=None # optional, number defining the seconds remaining
876
- percentageCompleted=None # optional, number defining the percentage completed
894
+ type="DEEP_RESEARCH",
895
+ secondsRemaining=None, # optional, number defining the seconds remaining
896
+ percentageCompleted=None, # optional, number defining the percentage completed
877
897
  )
878
898
  ```
879
899
 
@@ -898,9 +918,9 @@ msg_execution = unique_sdk.MessageExecution.update(
898
918
  user_id=user_id,
899
919
  company_id=company_id,
900
920
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
901
- status="COMPLETED", # one of: COMPLETED, FAILED
902
- secondsRemaining=55 # optional, number defining the seconds remaining
903
- percentageCompleted=10 # optional, number defining the percentage completed
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
904
924
  )
905
925
  ```
906
926
 
@@ -1749,6 +1769,9 @@ All notable changes to this project will be documented in this file.
1749
1769
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1750
1770
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1751
1771
 
1772
+ ## [0.10.32] - 2025-10-14
1773
+ - Add function to stream to chat frontend.
1774
+
1752
1775
  ## [0.10.31] - 2025-10-13
1753
1776
  - Add readme for message log and execution.
1754
1777
 
@@ -23,7 +23,7 @@ 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
29
  unique_sdk/api_resources/_message_log.py,sha256=-R8f_WDv7ug5PU4OPktlRlvKEPwsYPtfhf2oAc7zdww,3678
@@ -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.31.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
40
- unique_sdk-0.10.31.dist-info/METADATA,sha256=7iQ373jDw7EOVisMDJfLbbC-88u52MkElCwkyETZC7s,60911
41
- unique_sdk-0.10.31.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
42
- unique_sdk-0.10.31.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,,