unique_sdk 0.10.19__py3-none-any.whl → 0.10.21__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.
@@ -1,10 +1,13 @@
1
1
  from typing import (
2
+ Any,
2
3
  ClassVar,
4
+ Dict,
3
5
  List,
4
6
  Literal,
5
7
  NotRequired,
6
8
  Optional,
7
9
  TypedDict,
10
+ Union,
8
11
  Unpack,
9
12
  cast,
10
13
  )
@@ -34,6 +37,51 @@ class ChatCompletionChoicesInner(TypedDict):
34
37
  class ChatCompletion(APIResource["ChatCompletion"]):
35
38
  OBJECT_NAME: ClassVar[Literal["openai.chat.completion"]] = "openai.chat.completion"
36
39
 
40
+ class FunctionDefinition(TypedDict, total=False):
41
+ name: str
42
+ description: Optional[str]
43
+ parameters: Optional[Dict[str, Any]]
44
+
45
+ class ChatCompletionsFunctionToolDefinition(TypedDict):
46
+ type: Literal["function"]
47
+ function: "ChatCompletion.FunctionDefinition"
48
+
49
+ class FunctionName(TypedDict):
50
+ name: str
51
+
52
+ class ChatCompletionsNamedFunctionToolSelectionName(TypedDict):
53
+ name: str
54
+
55
+ class ChatCompletionsNamedFunctionToolSelection(TypedDict):
56
+ type: Literal["function"]
57
+ function: "ChatCompletion.ChatCompletionsNamedFunctionToolSelectionName"
58
+
59
+ class ChatCompletionsTextResponseFormat(TypedDict, total=False):
60
+ type: Literal["text", "json_schema"]
61
+ json_schema: dict
62
+
63
+ class Options(TypedDict, total=False):
64
+ functions: NotRequired[List["ChatCompletion.FunctionDefinition"]]
65
+ reasoningEffort: NotRequired[Literal["low", "medium", "high", None]]
66
+ functionCall: NotRequired[
67
+ Union[Literal["auto", "none"], "ChatCompletion.FunctionName"]
68
+ ]
69
+ maxTokens: NotRequired[int]
70
+ temperature: NotRequired[float]
71
+ topP: NotRequired[float]
72
+ logitBias: NotRequired[Dict[str, float]]
73
+ user: NotRequired[str]
74
+ n: NotRequired[int]
75
+ stop: NotRequired[List[str]]
76
+ presencePenalty: NotRequired[float]
77
+ frequencyPenalty: NotRequired[float]
78
+ seed: NotRequired[int]
79
+ responseFormat: NotRequired["ChatCompletion.ChatCompletionsTextResponseFormat"]
80
+ tools: NotRequired[List["ChatCompletion.ChatCompletionsFunctionToolDefinition"]]
81
+ toolChoice: NotRequired[
82
+ "ChatCompletion.ChatCompletionsNamedFunctionToolSelection"
83
+ ]
84
+
37
85
  class CreateParams(RequestOptions):
38
86
  model: NotRequired[
39
87
  Literal[
@@ -43,6 +91,7 @@ class ChatCompletion(APIResource["ChatCompletion"]):
43
91
  ]
44
92
  timeout: NotRequired[Optional["int"]]
45
93
  messages: List[ChatCompletionRequestMessage]
94
+ options: NotRequired["ChatCompletion.Options"]
46
95
 
47
96
  model: Literal[
48
97
  "AZURE_GPT_4_0613",
@@ -1,15 +1,29 @@
1
1
  from typing import (
2
+ TYPE_CHECKING,
2
3
  Any,
3
4
  ClassVar,
4
- Dict,
5
5
  List,
6
6
  Literal,
7
+ NotRequired,
7
8
  Optional,
8
- TypedDict,
9
+ Union,
10
+ Unpack,
9
11
  cast,
10
12
  )
11
13
 
12
- from typing_extensions import NotRequired, Unpack
14
+ from typing_extensions import TypedDict
15
+
16
+ # Avoid introducing a dependency on the openai sdk as it's only used for type hints
17
+ if TYPE_CHECKING:
18
+ from openai.types.responses import (
19
+ ResponseIncludable,
20
+ ResponseInputParam,
21
+ ResponseOutputItem,
22
+ ResponseTextConfigParam,
23
+ ToolParam,
24
+ response_create_params,
25
+ )
26
+ from openai.types.shared_params import Metadata, Reasoning
13
27
 
14
28
  from unique_sdk._api_resource import APIResource
15
29
  from unique_sdk._request_options import RequestOptions
@@ -35,63 +49,49 @@ class Integrated(APIResource["Integrated"]):
35
49
  content: str
36
50
  name: Optional[str]
37
51
 
38
- class CreateStream(RequestOptions):
39
- model: NotRequired[
40
- Literal[
41
- "AZURE_GPT_4_0613",
42
- "AZURE_GPT_4_32K_0613",
43
- ]
44
- ]
45
- timeout: NotRequired["int"]
46
- messages: List["Integrated.ChatCompletionRequestMessage"]
52
+ class CommonIntegratedParams(RequestOptions):
53
+ model: NotRequired[str]
47
54
  searchContext: NotRequired[List["Integrated.SearchResult"]]
48
55
  chatId: str
49
56
  assistantId: str
50
57
  assistantMessageId: str
51
58
  userMessageId: str
52
59
  startText: NotRequired["str"]
53
- debugInfo: NotRequired[Dict[str, Any]]
60
+ debugInfo: NotRequired[dict[str, Any]]
61
+
62
+ class CreateStream(CommonIntegratedParams):
63
+ timeout: NotRequired["int"]
64
+ messages: List["Integrated.ChatCompletionRequestMessage"]
54
65
 
55
66
  # 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
67
+ # Note that other parameters from openai.resources.responses.Response.create can be passed
68
+ class CreateStreamResponsesOpenaiParams(TypedDict):
69
+ include: NotRequired[list["ResponseIncludable"] | None]
70
+ instructions: NotRequired[str | None]
71
+ max_output_tokens: NotRequired[int | None]
72
+ metadata: NotRequired[Union["Metadata", None]]
73
+ parallel_tool_calls: NotRequired[bool | None]
74
+ temperature: NotRequired[float | None]
75
+ text: NotRequired["ResponseTextConfigParam"]
76
+ tool_choice: NotRequired["response_create_params.ToolChoice"]
77
+ tools: NotRequired[list["ToolParam"]]
78
+ top_p: NotRequired[float | None]
79
+ reasoning: NotRequired["Reasoning"]
80
+
81
+ class CreateStreamResponsesParams(CommonIntegratedParams):
82
+ input: Union[str, "ResponseInputParam"]
83
+ options: NotRequired["Integrated.CreateStreamResponsesOpenaiParams"]
85
84
 
86
85
  class ToolCall(TypedDict):
87
86
  id: str
88
- name: str | None = None
89
- arguments: str | None = None
87
+ name: str | None
88
+ arguments: str | None
90
89
 
91
90
  class ResponsesStreamResult(TypedDict):
92
91
  id: str
93
92
  message: Message
94
93
  toolCalls: List["Integrated.ToolCall"]
94
+ output: list["ResponseOutputItem"]
95
95
 
96
96
  @classmethod
97
97
  def chat_stream_completion(
@@ -146,7 +146,7 @@ class Integrated(APIResource["Integrated"]):
146
146
  cls,
147
147
  user_id: str,
148
148
  company_id: str,
149
- **params: Unpack["Integrated.CreateStreamResponseParams"],
149
+ **params: Unpack["Integrated.CreateStreamResponsesParams"],
150
150
  ) -> "Integrated.ResponsesStreamResult":
151
151
  """
152
152
  Executes a call to the language model and streams to the chat in real-time.
@@ -154,7 +154,7 @@ class Integrated(APIResource["Integrated"]):
154
154
  In the form of [sourceX]. The reference documents must be given as a list in searchContext.
155
155
  """
156
156
  return cast(
157
- "Integrated.Responses",
157
+ "Integrated.ResponsesStreamResult",
158
158
  cls._static_request(
159
159
  "post",
160
160
  "/integrated/chat/stream-responses",
@@ -169,7 +169,7 @@ class Integrated(APIResource["Integrated"]):
169
169
  cls,
170
170
  user_id: str,
171
171
  company_id: str,
172
- **params: Unpack["Integrated.CreateStreamResponseParams"],
172
+ **params: Unpack["Integrated.CreateStreamResponsesParams"],
173
173
  ) -> "Integrated.ResponsesStreamResult":
174
174
  """
175
175
  Executes a call to the language model and streams to the chat in real-time.
@@ -177,7 +177,7 @@ class Integrated(APIResource["Integrated"]):
177
177
  In the form of [sourceX]. The reference documents must be given as a list in searchContext.
178
178
  """
179
179
  return cast(
180
- "Integrated.Responses",
180
+ "Integrated.ResponsesStreamResult",
181
181
  cls._static_request(
182
182
  "post",
183
183
  "/integrated/chat/stream-responses",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.19
3
+ Version: 0.10.21
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -10,6 +10,8 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
+ Provides-Extra: openai
14
+ Requires-Dist: openai (>=1.105.0,<2.0.0) ; extra == "openai"
13
15
  Requires-Dist: requests (>=2.32.3,<3.0.0)
14
16
  Requires-Dist: typing-extensions (>=4.9.0,<5.0.0)
15
17
  Description-Content-Type: text/markdown
@@ -789,8 +791,9 @@ chat_completion = unique_sdk.ChatCompletion.create(
789
791
  {"role": "user", "content": "Hello!"},
790
792
  ],
791
793
  options={
792
- "temperature": 0.5
793
- } # optional
794
+ "temperature": 0.5, # optional
795
+ "reasoningEffort": "low", # optional
796
+ } # optional
794
797
  )
795
798
  ```
796
799
 
@@ -1575,6 +1578,12 @@ All notable changes to this project will be documented in this file.
1575
1578
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1576
1579
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1577
1580
 
1581
+ ## [0.10.21] - 2025-09-04
1582
+ - Update Chat Completions API types and add support for reasoning effort.
1583
+
1584
+ ## [0.10.20] - 2025-09-04
1585
+ - Update Responses API types
1586
+
1578
1587
  ## [0.10.19] - 2025-09-02
1579
1588
  - Improve `send_message_and_wait_for_completion`:
1580
1589
  - Add option to select stop_condition `["stoppedStreamingAt", "completedAt"]`.
@@ -16,12 +16,12 @@ unique_sdk/_webhook.py,sha256=GYxbUibQN_W4XlNTHaMIksT9FQJk4LJmlKcxOu3jqiU,2855
16
16
  unique_sdk/api_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
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
- unique_sdk/api_resources/_chat_completion.py,sha256=ILCAffxkbkfh2iV9L4KKnfe80gZmT9pWfkNmf3mq68U,2172
19
+ unique_sdk/api_resources/_chat_completion.py,sha256=dEaTPfTxAXAuLODt6b5c0N4pVzcqbSqKhMoSILnPEVU,4000
20
20
  unique_sdk/api_resources/_content.py,sha256=Vi-wZ-T5f-OqBGXkA3B9dALoFHer5F8LAQlc5x6pcls,14109
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=mIyWaxJtIHlDLPFZ0FY1U9b3dmtmIcjDEbgOZtLA-DI,12871
24
- unique_sdk/api_resources/_integrated.py,sha256=z_DrftwjgVCi10QQqRYnG5_-95kD7Kfjogbb-dmnJuA,5854
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
26
  unique_sdk/api_resources/_message.py,sha256=gEDIzg3METZU2k7m69meAuf0IWmZxnYOjbBKPRMwPYE,7688
27
27
  unique_sdk/api_resources/_message_assessment.py,sha256=SSfx6eW7zb_GKe8cFJzCqW-t-_eWEXxKP5cnIb0DhIc,2276
@@ -36,7 +36,7 @@ unique_sdk/utils/chat_in_space.py,sha256=NrH9e2lvXtj_oePG0RWUqFoTanMblF8-VgtnVfs
36
36
  unique_sdk/utils/file_io.py,sha256=YY8B7VJcTLOPmCXByiOfNerXGlAtjCC5EVNmAbQJ3dQ,4306
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.19.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
40
- unique_sdk-0.10.19.dist-info/METADATA,sha256=xppurAY1RbWZ-Z8BlMws7i_yZZhYY04pqxDj676FTpU,54448
41
- unique_sdk-0.10.19.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
42
- unique_sdk-0.10.19.dist-info/RECORD,,
39
+ unique_sdk-0.10.21.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
40
+ unique_sdk-0.10.21.dist-info/METADATA,sha256=Jr1CrOl2dawLrTd5MOW1laApnhRwoGugtWlelMc1Q1w,54756
41
+ unique_sdk-0.10.21.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
42
+ unique_sdk-0.10.21.dist-info/RECORD,,