unique_toolkit 0.8.36__py3-none-any.whl → 0.8.38__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.
@@ -0,0 +1,29 @@
1
+ import logging
2
+
3
+ import humps
4
+ from pydantic import ConfigDict
5
+ from pydantic.fields import ComputedFieldInfo, FieldInfo
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+
10
+ def field_title_generator(
11
+ title: str,
12
+ info: FieldInfo | ComputedFieldInfo,
13
+ ) -> str:
14
+ return humps.decamelize(title).replace("_", " ").title()
15
+
16
+
17
+ def model_title_generator(model: type) -> str:
18
+ return humps.decamelize(model.__name__).replace("_", " ").title()
19
+
20
+
21
+ def get_configuration_dict(**kwargs) -> ConfigDict:
22
+ return ConfigDict(
23
+ # alias_generator=to_camel,
24
+ field_title_generator=field_title_generator,
25
+ model_title_generator=model_title_generator,
26
+ # populate_by_name=True,
27
+ # protected_namespaces=(),
28
+ **kwargs,
29
+ )
@@ -1,11 +1,12 @@
1
1
  from datetime import date
2
2
  from enum import StrEnum
3
- from typing import Any, ClassVar, Optional, Self
3
+ from typing import Annotated, Any, ClassVar, Optional, Self
4
4
 
5
- from pydantic import BaseModel
5
+ from pydantic import BaseModel, Field
6
6
  from pydantic.json_schema import SkipJsonSchema
7
7
  from typing_extensions import deprecated
8
8
 
9
+ from unique_toolkit._common.pydantic_helpers import get_configuration_dict
9
10
  from unique_toolkit.language_model.schemas import LanguageModelTokenLimits
10
11
 
11
12
 
@@ -130,9 +131,13 @@ class TemperatureBounds(BaseModel):
130
131
 
131
132
 
132
133
  class LanguageModelInfo(BaseModel):
133
- name: LanguageModelName | str
134
- version: str
135
- provider: LanguageModelProvider
134
+ model_config = get_configuration_dict()
135
+ name: (
136
+ Annotated[str, Field(title="Custom Model Name")]
137
+ | SkipJsonSchema[LanguageModelName]
138
+ ) = Field(title="Model Name", default=LanguageModelName.AZURE_GPT_4o_2024_1120)
139
+ provider: LanguageModelProvider = LanguageModelProvider.AZURE
140
+ version: str = Field(title="Model Version", default="")
136
141
 
137
142
  encoder_name: EncoderName = EncoderName.CL100K_BASE
138
143
 
@@ -140,16 +145,34 @@ class LanguageModelInfo(BaseModel):
140
145
  token_limits: LanguageModelTokenLimits = LanguageModelTokenLimits(
141
146
  token_limit_input=7_000, token_limit_output=1_000
142
147
  )
148
+
143
149
  capabilities: list[ModelCapabilities] = [ModelCapabilities.STREAMING]
144
150
 
145
- info_cutoff_at: date | SkipJsonSchema[None] = None
146
- published_at: date | SkipJsonSchema[None] = None
147
- retirement_at: date | SkipJsonSchema[None] = None
151
+ info_cutoff_at: (
152
+ Annotated[date, Field(title="Info Cutoff")]
153
+ | Annotated[None, Field(title="Info Cutoff Unknown")]
154
+ ) = None
155
+
156
+ published_at: (
157
+ Annotated[date, Field(title="Publishing Date")]
158
+ | Annotated[None, Field(title="Publishing Date Unknown")]
159
+ ) = None
160
+
161
+ retirement_at: (
162
+ Annotated[date, Field(title="Retirement Date")]
163
+ | Annotated[None, Field(title="Retirement Date Unknown")]
164
+ ) = date(2225, 12, 31)
165
+
166
+ deprecated_at: (
167
+ Annotated[date, Field(title="Deprecated Date")]
168
+ | Annotated[None, Field(title="Deprecated Date Unknown")]
169
+ ) = date(2225, 12, 31)
148
170
 
149
- deprecated_at: date | SkipJsonSchema[None] = None
150
- retirement_text: str | SkipJsonSchema[None] = None
171
+ retirement_text: str = "This model is no longer supported."
151
172
 
152
- temperature_bounds: TemperatureBounds | None = None
173
+ temperature_bounds: (
174
+ TemperatureBounds | Annotated[None, Field(title="Temperature Bounds Unknown")]
175
+ ) = None
153
176
 
154
177
  default_options: dict[str, Any] = {}
155
178
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.8.36
3
+ Version: 0.8.38
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -116,6 +116,13 @@ All notable changes to this project will be documented in this file.
116
116
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
117
117
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
118
118
 
119
+
120
+ ## [0.8.38] - 2025-09-01
121
+ - Sanitize documentation
122
+
123
+ ## [0.8.37] - 2025-09-01
124
+ - Adapt defaults and json-schema in `LanguageModelInfo`
125
+
119
126
  ## [0.8.36] - 2025-09-01
120
127
  - Added dependency `Pillow` and `Platformsdir`
121
128
 
@@ -126,12 +133,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
126
133
  - Automatic initializations of services and event generator
127
134
 
128
135
  ## [0.8.33] - 2025-08-31
129
-
130
- fixed tool for `web_search`
136
+ - fixed tool for `web_search`
131
137
 
132
138
  ## [0.8.32] - 2025-08-30
133
-
134
- moved over general packages for `web_search`
139
+ - moved over general packages for `web_search`
135
140
 
136
141
  ## [0.8.31] - 2025-08-29
137
142
  - Add various openai models to supported model list
@@ -10,6 +10,7 @@ unique_toolkit/_common/default_language_model.py,sha256=tmHSqg6e8G7RmKqmdE_tmLxk
10
10
  unique_toolkit/_common/endpoint_builder.py,sha256=oM6uDmxUqTAJut6MuJQj3bIX4yOccyErWD5bJ1d1lcY,4526
11
11
  unique_toolkit/_common/exception.py,sha256=caQIE1btsQnpKCHqL2cgWUSbHup06enQu_Pt7uGUTTE,727
12
12
  unique_toolkit/_common/feature_flags/schema.py,sha256=3JpTuld8kK-UQ5B0sbYTu0yqhyFPnChXG2Iv4BNqHdg,539
13
+ unique_toolkit/_common/pydantic_helpers.py,sha256=4a8LPey31k4dCztYag1OBhYnGHREN08-l3NEjbFD1ok,743
13
14
  unique_toolkit/_common/token/image_token_counting.py,sha256=VpFfZyY0GIH27q_Wy4YNjk2algqvbCtJyzuuROoFQPw,2189
14
15
  unique_toolkit/_common/token/token_counting.py,sha256=Jo5B11GLlnaZDi4u7xCzIboLl8zn5cY_dmrogHixVdk,6132
15
16
  unique_toolkit/_common/utils/structured_output/schema.py,sha256=Tp7kDYcmKtnUhcuRkH86TSYhylRff0ZZJYb2dLkISts,131
@@ -88,7 +89,7 @@ unique_toolkit/language_model/__init__.py,sha256=lRQyLlbwHbNFf4-0foBU13UGb09lwEe
88
89
  unique_toolkit/language_model/builder.py,sha256=4OKfwJfj3TrgO1ezc_ewIue6W7BCQ2ZYQXUckWVPPTA,3369
89
90
  unique_toolkit/language_model/constants.py,sha256=B-topqW0r83dkC_25DeQfnPk3n53qzIHUCBS7YJ0-1U,119
90
91
  unique_toolkit/language_model/functions.py,sha256=4-zOzLsdjcfeTy6alqkYEBl-oVWptz9xLi8C5vdbWEg,16769
91
- unique_toolkit/language_model/infos.py,sha256=fKmpTEvrHotGFo-PHkLpdlmk57UyFLCkuPeTic-Zohg,56304
92
+ unique_toolkit/language_model/infos.py,sha256=eHln--Y5f6znFxknV6A8m-fRaEpH5-kmRh9m-ZWqco4,57188
92
93
  unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
93
94
  unique_toolkit/language_model/reference.py,sha256=nkX2VFz-IrUz8yqyc3G5jUMNwrNpxITBrMEKkbqqYoI,8583
94
95
  unique_toolkit/language_model/schemas.py,sha256=EOgy-p1GRcS46Sq0qEsN8MfOMl-KCcvEd9aCmqm9d08,16497
@@ -129,7 +130,7 @@ unique_toolkit/tools/utils/execution/execution.py,sha256=vjG2Y6awsGNtlvyQAGCTthQ
129
130
  unique_toolkit/tools/utils/source_handling/schema.py,sha256=vzAyf6ZWNexjMO0OrnB8y2glGkvAilmGGQXd6zcDaKw,870
130
131
  unique_toolkit/tools/utils/source_handling/source_formatting.py,sha256=C7uayNbdkNVJdEARA5CENnHtNY1SU6etlaqbgHNyxaQ,9152
131
132
  unique_toolkit/tools/utils/source_handling/tests/test_source_formatting.py,sha256=oM5ZxEgzROrnX1229KViCAFjRxl9wCTzWZoinYSHleM,6979
132
- unique_toolkit-0.8.36.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
133
- unique_toolkit-0.8.36.dist-info/METADATA,sha256=lIcGhl07QvJeFeCqQWiU2omeNiODrz-tX6vnb0xWJNc,29929
134
- unique_toolkit-0.8.36.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
135
- unique_toolkit-0.8.36.dist-info/RECORD,,
133
+ unique_toolkit-0.8.38.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
134
+ unique_toolkit-0.8.38.dist-info/METADATA,sha256=zaxZANY75Wqcau9eI7vLO7_k13-FGsJlE8HixC_RFYc,30065
135
+ unique_toolkit-0.8.38.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
136
+ unique_toolkit-0.8.38.dist-info/RECORD,,