unique_toolkit 2026.32.0.dev2__py3-none-any.whl → 2026.32.0.dev3__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.
@@ -5,6 +5,7 @@ import functools
5
5
  import os
6
6
  import time
7
7
  import warnings
8
+ from collections.abc import Sequence
8
9
  from contextlib import contextmanager
9
10
  from typing import Any, Callable, Literal
10
11
 
@@ -66,9 +67,31 @@ class MetricNamespace:
66
67
  def __init__(self, prefix: str) -> None:
67
68
  self._prefix = prefix
68
69
 
69
- def histogram(self, name: str, description: str, labels: list[str]) -> Histogram:
70
+ def histogram(
71
+ self,
72
+ name: str,
73
+ description: str,
74
+ labels: list[str],
75
+ buckets: Sequence[float] | None = None,
76
+ ) -> Histogram:
77
+ """Create a Histogram, optionally with custom bucket boundaries.
78
+
79
+ When ``buckets`` is omitted, prometheus_client's default buckets are used
80
+ (top finite bucket 10s). Provide explicit buckets for workloads whose
81
+ latency regularly exceeds 10s so ``histogram_quantile`` can resolve the
82
+ tail; observations above the largest bucket fall into the implicit +Inf
83
+ bucket. prometheus_client appends +Inf automatically.
84
+ """
85
+ if buckets is None:
86
+ return Histogram(
87
+ f"{self._prefix}_{name}", description, labels, registry=REGISTRY
88
+ )
70
89
  return Histogram(
71
- f"{self._prefix}_{name}", description, labels, registry=REGISTRY
90
+ f"{self._prefix}_{name}",
91
+ description,
92
+ labels,
93
+ registry=REGISTRY,
94
+ buckets=tuple(buckets),
72
95
  )
73
96
 
74
97
  def counter(self, name: str, description: str, labels: list[str]) -> Counter:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: unique-toolkit
3
- Version: 2026.32.0.dev2
3
+ Version: 2026.32.0.dev3
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>
@@ -33,8 +33,8 @@ Requires-Dist: tenacity>=9.1.4
33
33
  Requires-Dist: pydantic-core>=2.41.5
34
34
  Requires-Dist: cachetools>=5.0,<6
35
35
  Requires-Dist: rapidfuzz>=3.0,<4
36
- Requires-Dist: fastapi>=0.121.0,<0.122 ; extra == 'fastapi'
37
- Requires-Dist: starlette>=0.49.1 ; extra == 'fastapi'
36
+ Requires-Dist: fastapi>=0.133.0,<1.0.0 ; extra == 'fastapi'
37
+ Requires-Dist: starlette>=1.3.1,<2.0.0 ; extra == 'fastapi'
38
38
  Requires-Dist: uvicorn>=0.37.0,<0.38 ; extra == 'fastapi'
39
39
  Requires-Dist: openai>=1.105.0,<3 ; extra == 'langchain'
40
40
  Requires-Dist: langchain>=1.0.0,<2 ; extra == 'langchain'
@@ -404,7 +404,7 @@ unique_toolkit/language_model/utils.py,sha256=bPQ4l6_YO71w-zaIPanUUmtbXC1_hCvLK0
404
404
  unique_toolkit/monitoring/__init__.py,sha256=z1gkOCLxGcg936MFuLSeWFa0tREcBFSUbV09NxilBw4,1065
405
405
  unique_toolkit/monitoring/gunicorn.py,sha256=urTFFS5zYHKoxb1TEQHcLqb2byi-aYgFRHGwgYRzYYI,844
406
406
  unique_toolkit/monitoring/middleware.py,sha256=JNh5v_INAkexuLtXhCG9n5n2t6Pnf8ZdPTnimAVS0_s,2931
407
- unique_toolkit/monitoring/registry.py,sha256=8r9jqaQoRHZveGRZe_GQvBzvQpmUV4cpw8Ej1ssDIdE,5056
407
+ unique_toolkit/monitoring/registry.py,sha256=De2Bx5QBBRJQY2MM3xtntiJ2JU2FoKkVT7rNMG7ewgA,5874
408
408
  unique_toolkit/protocols/support.py,sha256=x5edzbBmKAUuvm3oLFh52gkgQsqR5LU7M0t8RHK0DZk,5161
409
409
  unique_toolkit/services/__init__.py,sha256=b9Wl7Wvz1JmZDbDexIZzBoXZ0wscXuczGAH8LoL-Qak,572
410
410
  unique_toolkit/services/chat_service.py,sha256=ofhNHCW7kz6xXN4pUTBdDEYovZ7PXhUglPDgez8Qov0,99142
@@ -418,6 +418,6 @@ unique_toolkit/short_term_memory/service.py,sha256=2JMBEBn6GoyK-a0xvdcWpPft-3C74
418
418
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
419
419
  unique_toolkit/smart_rules/compile.py,sha256=vRe0aMJWuVIK-VsqomgxQImzke7MDmwgSxxJfYCa7zw,1386
420
420
  unique_toolkit/test_utilities/events.py,sha256=FLrhMh0A_mQutAUjoD0FdMcVQ4Gq31r35OVGzRjvLro,6760
421
- unique_toolkit-2026.32.0.dev2.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
422
- unique_toolkit-2026.32.0.dev2.dist-info/METADATA,sha256=gZVUsvWymA7AnuSTmC2ZMgOqE1ZYXN0SaqAhdEoGGso,7459
423
- unique_toolkit-2026.32.0.dev2.dist-info/RECORD,,
421
+ unique_toolkit-2026.32.0.dev3.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
422
+ unique_toolkit-2026.32.0.dev3.dist-info/METADATA,sha256=56S1t7gvRT_iCfhx_SeRNDxt1DERgazGT-bWdZ2CsB0,7465
423
+ unique_toolkit-2026.32.0.dev3.dist-info/RECORD,,