unique_toolkit 2026.26.0.dev9__py3-none-any.whl → 2026.26.0.dev10__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,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from enum import StrEnum
3
4
  from logging import getLogger
4
5
  from pathlib import Path
5
6
  from typing import TYPE_CHECKING, Any, Self, TypeVar
@@ -308,6 +309,11 @@ class UniqueApp(BaseSettings):
308
309
 
309
310
  # Api
310
311
  # Settings only as only obtained from the environment.
312
+ class ApiType(StrEnum):
313
+ INTERNAL = "internal"
314
+ EXTERNAL = "external"
315
+ NEXT = "next"
316
+ LEGACY = "legacy"
311
317
 
312
318
 
313
319
  @register_config()
@@ -323,6 +329,9 @@ class UniqueApi(BaseSettings):
323
329
  "API_BASE",
324
330
  ),
325
331
  )
332
+
333
+ api_type: ApiType = Field(default=ApiType.LEGACY)
334
+
326
335
  version: str = Field(
327
336
  default="2023-12-06",
328
337
  validation_alias=AliasChoices(
@@ -353,24 +362,39 @@ class UniqueApi(BaseSettings):
353
362
  )
354
363
  )
355
364
 
356
- def base_path(self) -> tuple[ParseResult, str]:
357
- parsed = urlparse(self.base_url)
365
+ @staticmethod
366
+ def _legacy_base_path(hostname: str | None) -> str:
358
367
  base_path = "/public/chat"
359
-
360
- if parsed.hostname and (
361
- "gateway.qa.unique" in parsed.hostname
362
- or "gateway.unique" in parsed.hostname
368
+ if hostname and (
369
+ "gateway.qa.unique" in hostname or "gateway.unique" in hostname
363
370
  ):
364
371
  base_path = "/public/chat-gen2"
365
372
 
366
- if parsed.hostname and (
367
- "localhost" in parsed.hostname
368
- or "svc.cluster.local" in parsed.hostname
369
- or ".svc." in parsed.hostname
370
- or parsed.hostname.endswith(".svc")
373
+ # Typical internal single tenants
374
+ if hostname and (
375
+ "localhost" in hostname
376
+ or "svc.cluster.local" in hostname
377
+ or ".svc." in hostname
378
+ or hostname.endswith(".svc")
371
379
  ):
372
380
  base_path = "/public"
373
381
 
382
+ return base_path
383
+
384
+ def base_path(self) -> tuple[ParseResult, str]:
385
+ parsed = urlparse(self.base_url)
386
+
387
+ # Case of next qa only
388
+ match self.api_type:
389
+ case ApiType.NEXT:
390
+ base_path = "public/chat-gen2"
391
+ case ApiType.EXTERNAL:
392
+ base_path = "public/chat"
393
+ case ApiType.INTERNAL:
394
+ base_path = "public"
395
+ case ApiType.LEGACY:
396
+ base_path = self._legacy_base_path(parsed.hostname)
397
+
374
398
  return parsed, base_path
375
399
 
376
400
  def sdk_url(self) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: unique-toolkit
3
- Version: 2026.26.0.dev9
3
+ Version: 2026.26.0.dev10
4
4
  Summary:
5
5
  Author: Cedric Klinkert, Martin Fadler, Sadique Sheik, Fabian Schläpfer, Pascal Hauri, Ejiroghene Oki-Peter, Rami Azouz, Ricardo Visini, Sanzio Monti
6
6
  Author-email: Cedric Klinkert <cedric.klinkert@unique.ch>, Martin Fadler <martin.fadler@unique.ch>, Sadique Sheik <sadique@unique.ch>, Fabian Schläpfer <fabian@unique.ch>, Pascal Hauri <pascal@unique.ch>, Ejiroghene Oki-Peter <oki-peter.ejiroghene@unique.ai>, Rami Azouz <rami.ext@unique.ch>, Ricardo Visini <ricardo.visini@unique.ch>, Sanzio Monti <sanzio.monti@unique.ai>
@@ -16,7 +16,7 @@ Requires-Dist: sseclient>=0.0.27,<0.0.28
16
16
  Requires-Dist: openai>=1.105.0,<3
17
17
  Requires-Dist: platformdirs>=4.0.0,<5
18
18
  Requires-Dist: pillow>=12.1.1
19
- Requires-Dist: unique-sdk>=2026.26.0.dev9,<2026.26.0rc0
19
+ Requires-Dist: unique-sdk>=2026.26.0.dev12,<2026.26.0rc0
20
20
  Requires-Dist: jambo>=0.1.2,<0.2
21
21
  Requires-Dist: jinja2>=3.1.6,<4
22
22
  Requires-Dist: docxtpl>=0.20.1,<0.21
@@ -234,7 +234,7 @@ unique_toolkit/app/init_sdk.py,sha256=5_oDoETr6akwYyBCb0ivTdMNu3SVgPSkrXcDS6ELyY
234
234
  unique_toolkit/app/performance/async_tasks.py,sha256=8Xv5kEmmFDJO7YyyBxv4e7bcNgq-3z_E2_4z1Yn9EqU,1970
235
235
  unique_toolkit/app/performance/async_wrapper.py,sha256=yVVcRDkcdyfjsxro-N29SBvi-7773wnfDplef6-y8xw,1077
236
236
  unique_toolkit/app/schemas.py,sha256=f5h9BqCuqHvrXUAB7tjrx0PSLmuJJKlZ89othqOsuSY,14762
237
- unique_toolkit/app/unique_settings.py,sha256=bUrT57CIhu8fnU5pdEboZ4Ic6BPG1FetfsOh0mwlHoM,22704
237
+ unique_toolkit/app/unique_settings.py,sha256=XrRcKobm0DHFIFJvScEeRVBDmRotBZTz9qctg34FbY8,23364
238
238
  unique_toolkit/app/verification.py,sha256=GxFFwcJMy25fCA_Xe89wKW7bgqOu8PAs5y8QpHF0GSc,3861
239
239
  unique_toolkit/app/webhook.py,sha256=evpxLDnvz7P3D7-TV1XBkl8WcoldXpjOkw3tvFRxHr0,2368
240
240
  unique_toolkit/chat/__init__.py,sha256=N9RubtxWN7UF0DlxP7YgeNTgjjk6p7AwkbGaVvuZCv0,938
@@ -399,6 +399,6 @@ unique_toolkit/short_term_memory/service.py,sha256=Qo-c9yxzC1ZEEHJyIG_vnRs_ef0SK
399
399
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
400
400
  unique_toolkit/smart_rules/compile.py,sha256=vRe0aMJWuVIK-VsqomgxQImzke7MDmwgSxxJfYCa7zw,1386
401
401
  unique_toolkit/test_utilities/events.py,sha256=FLrhMh0A_mQutAUjoD0FdMcVQ4Gq31r35OVGzRjvLro,6760
402
- unique_toolkit-2026.26.0.dev9.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
403
- unique_toolkit-2026.26.0.dev9.dist-info/METADATA,sha256=3BvT8998w5CQF7UtryVHnh_469ETb4elK06yWV_G1oM,7426
404
- unique_toolkit-2026.26.0.dev9.dist-info/RECORD,,
402
+ unique_toolkit-2026.26.0.dev10.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
403
+ unique_toolkit-2026.26.0.dev10.dist-info/METADATA,sha256=CVZCkcBgE9h3sf9dyxIX6NjYXjG1V_pu2qn3PWpsMsU,7428
404
+ unique_toolkit-2026.26.0.dev10.dist-info/RECORD,,