unique_toolkit 0.5.41__py3-none-any.whl → 0.5.42__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,4 +1,5 @@
1
1
  import json
2
+ import math
2
3
  from enum import StrEnum
3
4
  from typing import Any, Optional, Self
4
5
  from uuid import uuid4
@@ -212,8 +213,10 @@ class LanguageModelTokenLimits(BaseModel):
212
213
  if not self.fraction_input:
213
214
  self.fraction_input = 0.4
214
215
 
215
- self.token_limit_input = self.fraction_input * self.token_limit
216
- self.token_limit_output = (1 - self.fraction_input) * self.token_limit
216
+ self.token_limit_input = math.floor(self.fraction_input * self.token_limit)
217
+ self.token_limit_output = math.floor(
218
+ (1 - self.fraction_input) * self.token_limit
219
+ )
217
220
  return self
218
221
 
219
222
  raise ValueError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.5.41
3
+ Version: 0.5.42
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -100,6 +100,9 @@ All notable changes to this project will be documented in this file.
100
100
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
101
101
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
102
102
 
103
+ ## [0.5.42] - 2024-12-11
104
+ - Update `LanguageModelTokenLimits` with fix avoiding floats for token
105
+
103
106
  ## [0.5.41] - 2024-12-11
104
107
  - Update `LanguageModelTokenLimits` includes a fraction_input now to always have input/output token limits available.
105
108
 
@@ -37,10 +37,10 @@ unique_toolkit/evaluators/output_parser.py,sha256=eI72qkzK1dZyUvnfP2SOAQCGBj_-Pw
37
37
  unique_toolkit/evaluators/schemas.py,sha256=Jaue6Uhx75X1CyHKWj8sT3RE1JZXTqoLtfLt2xQNCX8,2507
38
38
  unique_toolkit/language_model/__init__.py,sha256=YuhyczGPj6w9xX-sOVUhmozvzIFxcckHFEkeMBecr5s,1784
39
39
  unique_toolkit/language_model/infos.py,sha256=kQK6F3r8xTN7oT6b39J7rxW-Y4iPXjx_Fr9bCOVQdm0,12509
40
- unique_toolkit/language_model/schemas.py,sha256=-5yTJsEUMKSc6qZ1zdBU9Eewo9qQlpqlVssKHIwUY64,6925
40
+ unique_toolkit/language_model/schemas.py,sha256=MBwEAFnnCYjSpbZDUYLrqkCc-0bsarsepSQEj1v6YEY,6991
41
41
  unique_toolkit/language_model/service.py,sha256=brNCPRA0XxgqHi2rI5i2lyFCkUiw4MNMe1VaR3UgWmY,15500
42
42
  unique_toolkit/language_model/utils.py,sha256=bPQ4l6_YO71w-zaIPanUUmtbXC1_hCvLK0tAFc3VCRc,1902
43
- unique_toolkit-0.5.41.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
44
- unique_toolkit-0.5.41.dist-info/METADATA,sha256=im-lBhwsW2ZgUZoA6mfyogye1c6ZIFXqgaw_Ilf2yLs,14764
45
- unique_toolkit-0.5.41.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
46
- unique_toolkit-0.5.41.dist-info/RECORD,,
43
+ unique_toolkit-0.5.42.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
44
+ unique_toolkit-0.5.42.dist-info/METADATA,sha256=N2FElgrmwsR2zsNLdpgWp3OtAoF26gPw3-3bO0uaZtU,14861
45
+ unique_toolkit-0.5.42.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
46
+ unique_toolkit-0.5.42.dist-info/RECORD,,