unique_toolkit 0.8.27__py3-none-any.whl → 0.8.28__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.
@@ -2,7 +2,7 @@ import os
2
2
  from logging import getLogger
3
3
  from pathlib import Path
4
4
  from typing import Self, TypeVar
5
- from urllib.parse import urlparse, urlunparse
5
+ from urllib.parse import ParseResult, urlparse, urlunparse
6
6
 
7
7
  import unique_sdk
8
8
  from platformdirs import user_config_dir
@@ -99,22 +99,28 @@ class UniqueApi(BaseSettings):
99
99
  )
100
100
  )
101
101
 
102
- def sdk_url(self) -> str:
102
+ def base_path(self) -> tuple[ParseResult, str]:
103
103
  parsed = urlparse(self.base_url)
104
+ base_path = "/public/chat/"
104
105
 
105
- path = "/public/chat"
106
106
  if parsed.hostname and (
107
- "qa.unique" in parsed.hostname or ".unique" in parsed.hostname
107
+ "gateway.qa.unique" in parsed.hostname
108
+ or "gateway.unique" in parsed.hostname
108
109
  ):
109
- path = "/public/chat-gen2"
110
- return urlunparse(parsed._replace(path=path, query=None, fragment=None))
110
+ base_path = "/public/chat-gen2/"
111
111
 
112
- def openai_proxy_url(self) -> str:
113
- parsed = urlparse(self.base_url)
114
- path = "/public/chat/openai-proxy/"
115
- if parsed.hostname and "qa.unique" in parsed.hostname:
116
- path = "/public/chat-gen2/openai-proxy/"
112
+ if parsed.hostname and "localhost" in parsed.hostname:
113
+ base_path = "/public/"
117
114
 
115
+ return parsed, base_path
116
+
117
+ def sdk_url(self) -> str:
118
+ parsed, base_path = self.base_path()
119
+ return urlunparse(parsed._replace(path=base_path, query=None, fragment=None))
120
+
121
+ def openai_proxy_url(self) -> str:
122
+ parsed, base_path = self.base_path()
123
+ path = base_path + "openai-proxy/"
118
124
  return urlunparse(parsed._replace(path=path, query=None, fragment=None))
119
125
 
120
126
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.8.27
3
+ Version: 0.8.28
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -114,6 +114,8 @@ All notable changes to this project will be documented in this file.
114
114
 
115
115
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
116
116
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
117
+ ## [0.8.28] - 2025-08-28
118
+ - Fix paths for `sdk_url` and `openai_proxy` for localhost
117
119
 
118
120
  ## [0.8.27] - 2025-08-28
119
121
  - Fixed function "create_async" in language_model.functions : "user_id" argument should be optional.
@@ -15,7 +15,7 @@ unique_toolkit/app/init_sdk.py,sha256=5_oDoETr6akwYyBCb0ivTdMNu3SVgPSkrXcDS6ELyY
15
15
  unique_toolkit/app/performance/async_tasks.py,sha256=H0l3OAcosLwNHZ8d2pd-Di4wHIXfclEvagi5kfqLFPA,1941
16
16
  unique_toolkit/app/performance/async_wrapper.py,sha256=yVVcRDkcdyfjsxro-N29SBvi-7773wnfDplef6-y8xw,1077
17
17
  unique_toolkit/app/schemas.py,sha256=uh7PR-YYXfdTnuO5V_eGrW96eJmP5tJ4jeePyU8tsNI,7888
18
- unique_toolkit/app/unique_settings.py,sha256=hsQ4ViOs-E5K_bq96PwDvuVpfMJ-vNPq01B2gCK5R5g,9802
18
+ unique_toolkit/app/unique_settings.py,sha256=f9Ip1yBhIJqHpuHIo3ihCW2MGyQynBggEKDzlIOIlyg,9976
19
19
  unique_toolkit/app/verification.py,sha256=GxFFwcJMy25fCA_Xe89wKW7bgqOu8PAs5y8QpHF0GSc,3861
20
20
  unique_toolkit/chat/__init__.py,sha256=LRs2G-JTVuci4lbtHTkVUiNcZcSR6uqqfnAyo7af6nY,619
21
21
  unique_toolkit/chat/constants.py,sha256=05kq6zjqUVB2d6_P7s-90nbljpB3ryxwCI-CAz0r2O4,83
@@ -115,7 +115,7 @@ unique_toolkit/tools/utils/execution/execution.py,sha256=vjG2Y6awsGNtlvyQAGCTthQ
115
115
  unique_toolkit/tools/utils/source_handling/schema.py,sha256=vzAyf6ZWNexjMO0OrnB8y2glGkvAilmGGQXd6zcDaKw,870
116
116
  unique_toolkit/tools/utils/source_handling/source_formatting.py,sha256=C7uayNbdkNVJdEARA5CENnHtNY1SU6etlaqbgHNyxaQ,9152
117
117
  unique_toolkit/tools/utils/source_handling/tests/test_source_formatting.py,sha256=oM5ZxEgzROrnX1229KViCAFjRxl9wCTzWZoinYSHleM,6979
118
- unique_toolkit-0.8.27.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
119
- unique_toolkit-0.8.27.dist-info/METADATA,sha256=8ZMPPZWswpjAPnSCMCm8t4DbGCeB4e0jvpF97fC4ayM,29077
120
- unique_toolkit-0.8.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
121
- unique_toolkit-0.8.27.dist-info/RECORD,,
118
+ unique_toolkit-0.8.28.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
119
+ unique_toolkit-0.8.28.dist-info/METADATA,sha256=hMjsYHTpU3nvOolbSR6CO-8uMdkYZyuap3y2cue-0ck,29161
120
+ unique_toolkit-0.8.28.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
121
+ unique_toolkit-0.8.28.dist-info/RECORD,,