unique_sdk 0.10.2__tar.gz → 0.10.4__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.

Potentially problematic release.


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

Files changed (40) hide show
  1. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/CHANGELOG.md +6 -0
  2. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/PKG-INFO +42 -1
  3. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/README.md +35 -0
  4. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/pyproject.toml +1 -1
  5. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_integrated.py +87 -0
  6. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_search.py +1 -0
  7. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/LICENSE +0 -0
  8. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/__init__.py +0 -0
  9. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_api_requestor.py +0 -0
  10. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_api_resource.py +0 -0
  11. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_api_version.py +0 -0
  12. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_error.py +0 -0
  13. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_http_client.py +0 -0
  14. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_list_object.py +0 -0
  15. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_object_classes.py +0 -0
  16. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_request_options.py +0 -0
  17. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_unique_object.py +0 -0
  18. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_unique_ql.py +0 -0
  19. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_unique_response.py +0 -0
  20. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_util.py +0 -0
  21. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_version.py +0 -0
  22. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/_webhook.py +0 -0
  23. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/__init__.py +0 -0
  24. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_acronyms.py +0 -0
  25. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_chat_completion.py +0 -0
  26. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_content.py +0 -0
  27. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_embedding.py +0 -0
  28. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_event.py +0 -0
  29. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_folder.py +0 -0
  30. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_mcp.py +0 -0
  31. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_message.py +0 -0
  32. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_message_assessment.py +0 -0
  33. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_search_string.py +0 -0
  34. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  35. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/api_resources/_space.py +0 -0
  36. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/utils/chat_history.py +0 -0
  37. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/utils/chat_in_space.py +0 -0
  38. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/utils/file_io.py +0 -0
  39. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/utils/sources.py +0 -0
  40. {unique_sdk-0.10.2 → unique_sdk-0.10.4}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,12 @@ 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.4] - 2025-08-05
9
+ - Add support for reasoning API with streaming within a chat.
10
+
11
+ ## [0.10.3] - 2025-08-05
12
+ - Expose scoreThreshold param for search.
13
+
8
14
  ## [0.10.2] - 2025-08-05
9
15
  - Add script to chat against file.
10
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.2
3
+ Version: 0.10.4
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -605,6 +605,39 @@ unique_sdk.Integrated.chat_stream_completion(
605
605
 
606
606
  **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.
607
607
 
608
+
609
+ #### `unique_sdk.Integrated.responses_stream`
610
+
611
+ Streams the answer to the chat frontend using the Responses API. Given the messages.
612
+
613
+ if the stream creates [source0] it is referenced with the references from the search context.
614
+
615
+ E.g.
616
+
617
+ ```
618
+ Hello this information is from [source1]
619
+ ```
620
+
621
+ adds the reference at index 1 and then changes the text to:
622
+
623
+ ```
624
+ Hello this information is from <sub>0</sub>
625
+ ```
626
+
627
+ ```python
628
+ unique_sdk.Integrated.responses_stream(
629
+ user_id=userId,
630
+ company_id=companyId,
631
+ model="AZURE_o3_2025_0416",
632
+ assistantMessageId=assistantMessageId,
633
+ userMessageId=userMessageId,
634
+ input="Tell me about the curious case of neural text degeneration",
635
+ chatId=chatId,
636
+ )
637
+ ```
638
+
639
+ **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.
640
+
608
641
  ### Chat Completion
609
642
 
610
643
  #### `unique_sdk.ChatCompletion.create`
@@ -672,6 +705,7 @@ These are the options are available for `searchType`:
672
705
  `language` Optional. The language specification for full text search.
673
706
  `reranker` Optional. The reranker service to be used for re-ranking the search results.
674
707
  `chatId` Optional, adds the documents uploaded in this chat to the scope of searched documents.
708
+ `scoreThreshold` Optional, sets the minimum similarity score for search results to be considered. Using 0 is recommended.
675
709
 
676
710
  ```python
677
711
  search = unique_sdk.Search.create(
@@ -686,6 +720,7 @@ search = unique_sdk.Search.create(
686
720
  reranker={"deploymentName": "my_deployment"},
687
721
  limit=20,
688
722
  page=1
723
+ scoreThreshold=0
689
724
  )
690
725
  ```
691
726
 
@@ -1336,6 +1371,12 @@ All notable changes to this project will be documented in this file.
1336
1371
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1337
1372
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1338
1373
 
1374
+ ## [0.10.4] - 2025-08-05
1375
+ - Add support for reasoning API with streaming within a chat.
1376
+
1377
+ ## [0.10.3] - 2025-08-05
1378
+ - Expose scoreThreshold param for search.
1379
+
1339
1380
  ## [0.10.2] - 2025-08-05
1340
1381
  - Add script to chat against file.
1341
1382
 
@@ -589,6 +589,39 @@ unique_sdk.Integrated.chat_stream_completion(
589
589
 
590
590
  **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.
591
591
 
592
+
593
+ #### `unique_sdk.Integrated.responses_stream`
594
+
595
+ Streams the answer to the chat frontend using the Responses API. Given the messages.
596
+
597
+ if the stream creates [source0] it is referenced with the references from the search context.
598
+
599
+ E.g.
600
+
601
+ ```
602
+ Hello this information is from [source1]
603
+ ```
604
+
605
+ adds the reference at index 1 and then changes the text to:
606
+
607
+ ```
608
+ Hello this information is from <sub>0</sub>
609
+ ```
610
+
611
+ ```python
612
+ unique_sdk.Integrated.responses_stream(
613
+ user_id=userId,
614
+ company_id=companyId,
615
+ model="AZURE_o3_2025_0416",
616
+ assistantMessageId=assistantMessageId,
617
+ userMessageId=userMessageId,
618
+ input="Tell me about the curious case of neural text degeneration",
619
+ chatId=chatId,
620
+ )
621
+ ```
622
+
623
+ **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.
624
+
592
625
  ### Chat Completion
593
626
 
594
627
  #### `unique_sdk.ChatCompletion.create`
@@ -656,6 +689,7 @@ These are the options are available for `searchType`:
656
689
  `language` Optional. The language specification for full text search.
657
690
  `reranker` Optional. The reranker service to be used for re-ranking the search results.
658
691
  `chatId` Optional, adds the documents uploaded in this chat to the scope of searched documents.
692
+ `scoreThreshold` Optional, sets the minimum similarity score for search results to be considered. Using 0 is recommended.
659
693
 
660
694
  ```python
661
695
  search = unique_sdk.Search.create(
@@ -670,6 +704,7 @@ search = unique_sdk.Search.create(
670
704
  reranker={"deploymentName": "my_deployment"},
671
705
  limit=20,
672
706
  page=1
707
+ scoreThreshold=0
673
708
  )
674
709
  ```
675
710
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.10.2"
3
+ version = "0.10.4"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -52,6 +52,47 @@ class Integrated(APIResource["Integrated"]):
52
52
  startText: NotRequired["str"]
53
53
  debugInfo: NotRequired[Dict[str, Any]]
54
54
 
55
+ # For further details about the responses parameters, see the OpenAI API documentation.
56
+ class CreateStreamResponseParams(TypedDict):
57
+ debugInfo: Optional[Dict[str, Any]] = None
58
+ input: Any
59
+ model: str
60
+ searchContext: Optional[List["Integrated.SearchResult"]] = None
61
+ chatId: str
62
+ assistantMessageId: str
63
+ userMessageId: str
64
+ startText: str | None = None
65
+ include: Optional[
66
+ list[
67
+ Literal[
68
+ "computer_call_output.output.image_url",
69
+ "file_search_call.results",
70
+ "message.input_image.image_url",
71
+ "reasoning.encrypted_content",
72
+ ]
73
+ ]
74
+ ] = None
75
+ instructions: str | None = None
76
+ max_output_tokens: int | None = None
77
+ metadata: Optional[Dict[str, str]] = None
78
+ parallel_tool_calls: float | None = None
79
+ temperature: float | None = None
80
+ text: Any
81
+ tool_choice: Any
82
+ tools: Any
83
+ top_p: float | None = None
84
+ reasoning: Any
85
+
86
+ class ToolCall(TypedDict):
87
+ id: str
88
+ name: str | None = None
89
+ arguments: str | None = None
90
+
91
+ class ResponsesStreamResult(TypedDict):
92
+ id: str
93
+ message: Message
94
+ toolCalls: List["Integrated.ToolCall"]
95
+
55
96
  @classmethod
56
97
  def chat_stream_completion(
57
98
  cls,
@@ -99,3 +140,49 @@ class Integrated(APIResource["Integrated"]):
99
140
  params,
100
141
  ),
101
142
  )
143
+
144
+ @classmethod
145
+ def responses_stream(
146
+ cls,
147
+ user_id: str,
148
+ company_id: str,
149
+ **params: Unpack["Integrated.CreateStreamResponseParams"],
150
+ ) -> "Integrated.ResponsesStreamResult":
151
+ """
152
+ Executes a call to the language model and streams to the chat in real-time.
153
+ It automatically inserts references that are mentioned by the model.
154
+ In the form of [sourceX]. The reference documents must be given as a list in searchContext.
155
+ """
156
+ return cast(
157
+ "Integrated.Responses",
158
+ cls._static_request(
159
+ "post",
160
+ "/integrated/chat/stream-responses",
161
+ user_id,
162
+ company_id,
163
+ params,
164
+ ),
165
+ )
166
+
167
+ @classmethod
168
+ async def responses_stream_async(
169
+ cls,
170
+ user_id: str,
171
+ company_id: str,
172
+ **params: Unpack["Integrated.CreateStreamResponseParams"],
173
+ ) -> "Integrated.ResponsesStreamResult":
174
+ """
175
+ Executes a call to the language model and streams to the chat in real-time.
176
+ It automatically inserts references that are mentioned by the model.
177
+ In the form of [sourceX]. The reference documents must be given as a list in searchContext.
178
+ """
179
+ return cast(
180
+ "Integrated.Responses",
181
+ cls._static_request(
182
+ "post",
183
+ "/integrated/chat/stream-responses",
184
+ user_id,
185
+ company_id,
186
+ params,
187
+ ),
188
+ )
@@ -19,6 +19,7 @@ class Search(APIResource["Search"]):
19
19
  page: NotRequired[Optional[int]]
20
20
  metaDataFilter: NotRequired[Optional[dict[str, Any]]]
21
21
  contentIds: NotRequired[Optional[list[str]]]
22
+ scoreThreshold: NotRequired[Optional[float]]
22
23
 
23
24
  id: str
24
25
  chunkId: str
File without changes