unique_sdk 0.10.31__tar.gz → 0.10.32__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.
Files changed (43) hide show
  1. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/CHANGELOG.md +3 -0
  2. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/PKG-INFO +41 -18
  3. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/README.md +37 -17
  4. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/pyproject.toml +1 -1
  5. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_message.py +56 -0
  6. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/LICENSE +0 -0
  7. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/__init__.py +0 -0
  8. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_api_requestor.py +0 -0
  9. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_api_resource.py +0 -0
  10. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_api_version.py +0 -0
  11. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_error.py +0 -0
  12. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_http_client.py +0 -0
  13. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_list_object.py +0 -0
  14. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_object_classes.py +0 -0
  15. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_request_options.py +0 -0
  16. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_unique_object.py +0 -0
  17. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_unique_ql.py +0 -0
  18. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_unique_response.py +0 -0
  19. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_util.py +0 -0
  20. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_version.py +0 -0
  21. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/_webhook.py +0 -0
  22. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/__init__.py +0 -0
  23. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_acronyms.py +0 -0
  24. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_agentic_table.py +0 -0
  25. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_chat_completion.py +0 -0
  26. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_content.py +0 -0
  27. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_embedding.py +0 -0
  28. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_event.py +0 -0
  29. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_folder.py +0 -0
  30. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_integrated.py +0 -0
  31. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_mcp.py +0 -0
  32. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_message_assessment.py +0 -0
  33. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_message_execution.py +0 -0
  34. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_message_log.py +0 -0
  35. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_search.py +0 -0
  36. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_search_string.py +0 -0
  37. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  38. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/api_resources/_space.py +0 -0
  39. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/utils/chat_history.py +0 -0
  40. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/utils/chat_in_space.py +0 -0
  41. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/utils/file_io.py +0 -0
  42. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/utils/sources.py +0 -0
  43. {unique_sdk-0.10.31 → unique_sdk-0.10.32}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,9 @@ 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.10.32] - 2025-10-14
9
+ - Add function to stream to chat frontend.
10
+
8
11
  ## [0.10.31] - 2025-10-13
9
12
  - Add readme for message log and execution.
10
13
 
@@ -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
 
@@ -682,6 +682,26 @@ message = unique_sdk.Message.create(
682
682
  )
683
683
  ```
684
684
 
685
+ #### `unique_sdk.Message.create_event`
686
+
687
+ 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)
688
+
689
+ The event only changes the text in the UI, it *does not* update the database.
690
+
691
+ ```python
692
+ message = unique_sdk.Message.create_event(
693
+ user_id=user_id,
694
+ company_id=company_id,
695
+ messageId="msg_l4ushn85yqbewpf6tllh2cl7",
696
+ chatId="chat_kc8p3kgkn7393qhgmv5js5nt",
697
+ text="Hello.", #optional
698
+ originalText="Hello.", #optional
699
+ references=[], #optional
700
+ gptRequest={} #optional
701
+ debugInfo={ "hello": "test" }, #optional
702
+ )
703
+ ```
704
+
685
705
  #### `unique_sdk.Message.modify`
686
706
 
687
707
  Modify an existing chat message.
@@ -807,7 +827,7 @@ unique_sdk.Integrated.responses_stream(
807
827
 
808
828
  #### `unique_sdk.MessageLog.create`
809
829
 
810
- Create a message log for a provided `messageId`.
830
+ 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.
811
831
 
812
832
  ```python
813
833
  msg_log = unique_sdk.MessageLog.create(
@@ -816,10 +836,10 @@ msg_log = unique_sdk.MessageLog.create(
816
836
  messageId="msg_a0jgnt1jrqv1d3uzr450waxw",
817
837
  text="Create message log text",
818
838
  order=1,
819
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
820
- details=None, # optional, details dictionary
821
- uncitedReferences=None, # optional, references dictionary
822
- references=None, # optional, list of references
839
+ status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
840
+ details={}, # optional, details dictionary
841
+ uncitedReferences={}, # optional, references dictionary
842
+ references=[], # optional, list of references
823
843
  )
824
844
  ```
825
845
 
@@ -832,12 +852,12 @@ msg_log = unique_sdk.MessageLog.update(
832
852
  user_id=user_id,
833
853
  company_id=company_id,
834
854
  message_log_id="message_log_fd7z7gjljo1z2wu5g6l9q7r9",
835
- text="Update a message log text", # optional
836
- order=1, # optional
837
- status="RUNNING", # one of "RUNNING", "COMPLETED", "FAILED"
838
- details=None, # optional, details dictionary
839
- uncitedReferences=None, # optional, references dictionary
840
- references=None,
855
+ text="Update a message log text", # optional
856
+ order=1, # optional
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
 
@@ -853,9 +873,9 @@ msg_execution = unique_sdk.MessageExecution.create(
853
873
  company_id=company_id,
854
874
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
855
875
  chatId="chat_nx21havszl1skchd7544oykh",
856
- type="DEEP_RESEARCH"
857
- secondsRemaining=None # optional, number defining the seconds remaining
858
- percentageCompleted=None # optional, number defining the percentage completed
876
+ type="DEEP_RESEARCH",
877
+ secondsRemaining=None, # optional, number defining the seconds remaining
878
+ percentageCompleted=None, # optional, number defining the percentage completed
859
879
  )
860
880
  ```
861
881
 
@@ -880,9 +900,9 @@ msg_execution = unique_sdk.MessageExecution.update(
880
900
  user_id=user_id,
881
901
  company_id=company_id,
882
902
  messageId="msg_a0jgnt1jrqv143uzr750waxw",
883
- status="COMPLETED", # one of: COMPLETED, FAILED
884
- secondsRemaining=55 # optional, number defining the seconds remaining
885
- percentageCompleted=10 # optional, number defining the percentage completed
903
+ status="COMPLETED", # one of: COMPLETED, FAILED
904
+ secondsRemaining=55, # optional, number defining the seconds remaining
905
+ percentageCompleted=10, # optional, number defining the percentage completed
886
906
  )
887
907
  ```
888
908
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.10.31"
3
+ version = "0.10.32"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -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
+ )
File without changes