unique_toolkit 0.5.40__tar.gz → 0.5.42__tar.gz
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.
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/CHANGELOG.md +6 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/PKG-INFO +7 -1
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/pyproject.toml +1 -1
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/language_model/schemas.py +22 -20
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/LICENSE +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/README.md +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/__init__.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/_common/_base_service.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/_common/_time_utils.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/_common/exception.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/_common/validators.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/__init__.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/init_logging.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/init_sdk.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/performance/async_tasks.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/performance/async_wrapper.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/schemas.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/verification.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/chat/__init__.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/chat/schemas.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/chat/service.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/chat/state.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/chat/utils.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/content/__init__.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/content/schemas.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/content/service.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/content/utils.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/embedding/__init__.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/embedding/schemas.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/embedding/service.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/embedding/utils.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/config.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/context_relevancy/constants.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/context_relevancy/prompts.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/context_relevancy/service.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/context_relevancy/utils.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/exception.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/constants.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/prompts.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/service.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/utils.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/output_parser.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/schemas.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/language_model/__init__.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/language_model/infos.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/language_model/service.py +0 -0
- {unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/language_model/utils.py +0 -0
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.5.42] - 2024-12-11
|
9
|
+
- Update `LanguageModelTokenLimits` with fix avoiding floats for token
|
10
|
+
|
11
|
+
## [0.5.41] - 2024-12-11
|
12
|
+
- Update `LanguageModelTokenLimits` includes a fraction_input now to always have input/output token limits available.
|
13
|
+
|
8
14
|
## [0.5.40] - 2024-12-11
|
9
15
|
- Add `other_options` to `LanguageModelService.complete`, `LanguageModelService.complete_async`, `LanguageModelService.stream_complete` and `LanguageModelService.stream_complete_async`
|
10
16
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_toolkit
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.42
|
4
4
|
Summary:
|
5
5
|
License: Proprietary
|
6
6
|
Author: Martin Fadler
|
@@ -100,6 +100,12 @@ 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
|
+
|
106
|
+
## [0.5.41] - 2024-12-11
|
107
|
+
- Update `LanguageModelTokenLimits` includes a fraction_input now to always have input/output token limits available.
|
108
|
+
|
103
109
|
## [0.5.40] - 2024-12-11
|
104
110
|
- Add `other_options` to `LanguageModelService.complete`, `LanguageModelService.complete_async`, `LanguageModelService.stream_complete` and `LanguageModelService.stream_complete_async`
|
105
111
|
|
@@ -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
|
@@ -197,29 +198,30 @@ class LanguageModelTokenLimits(BaseModel):
|
|
197
198
|
token_limit_input: Optional[int] = None
|
198
199
|
token_limit_output: Optional[int] = None
|
199
200
|
|
201
|
+
fraction_input: float = Field(default=0.4, le=1, ge=0)
|
202
|
+
|
200
203
|
@model_validator(mode="after")
|
201
|
-
def
|
202
|
-
|
203
|
-
token_limit_input
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
204
|
+
def check_required_fields(self):
|
205
|
+
# Best case input and output is determined
|
206
|
+
if self.token_limit_input and self.token_limit_output:
|
207
|
+
self.token_limit = self.token_limit_input + self.token_limit_output
|
208
|
+
self.fraction_input = self.token_limit_input / self.token_limit
|
209
|
+
return self
|
210
|
+
|
211
|
+
# Deal with case where only token_limit and optional fraction_input is given
|
212
|
+
if self.token_limit:
|
213
|
+
if not self.fraction_input:
|
214
|
+
self.fraction_input = 0.4
|
215
|
+
|
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
|
213
219
|
)
|
220
|
+
return self
|
214
221
|
|
215
|
-
|
216
|
-
token_limit
|
217
|
-
|
218
|
-
and token_limit_output is not None
|
219
|
-
):
|
220
|
-
self.token_limit = token_limit_input + token_limit_output
|
221
|
-
|
222
|
-
return self
|
222
|
+
raise ValueError(
|
223
|
+
'Either "token_limit_input" and "token_limit_output" must be provided together, or "token_limit" must be provided.'
|
224
|
+
)
|
223
225
|
|
224
226
|
|
225
227
|
class LanguageModelToolParameterProperty(BaseModel):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/performance/async_tasks.py
RENAMED
File without changes
|
{unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/app/performance/async_wrapper.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/context_relevancy/utils.py
RENAMED
File without changes
|
File without changes
|
{unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/constants.py
RENAMED
File without changes
|
{unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/prompts.py
RENAMED
File without changes
|
{unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/service.py
RENAMED
File without changes
|
{unique_toolkit-0.5.40 → unique_toolkit-0.5.42}/unique_toolkit/evaluators/hallucination/utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|