unique_toolkit 1.45.7__py3-none-any.whl → 1.45.9__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.
- unique_toolkit/agentic/evaluation/hallucination/constants.py +2 -2
- unique_toolkit/agentic/evaluation/tests/test_hallucination_constants.py +34 -0
- unique_toolkit/agentic/feature_flags/feature_flags.py +12 -0
- unique_toolkit/agentic/responses_api/postprocessors/generated_files.py +9 -4
- {unique_toolkit-1.45.7.dist-info → unique_toolkit-1.45.9.dist-info}/METADATA +8 -1
- {unique_toolkit-1.45.7.dist-info → unique_toolkit-1.45.9.dist-info}/RECORD +8 -8
- {unique_toolkit-1.45.7.dist-info → unique_toolkit-1.45.9.dist-info}/LICENSE +0 -0
- {unique_toolkit-1.45.7.dist-info → unique_toolkit-1.45.9.dist-info}/WHEEL +0 -0
|
@@ -34,10 +34,10 @@ class HallucinationPromptsConfig(EvaluationMetricPromptsConfig):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
class HallucinationConfig(EvaluationMetricConfig):
|
|
37
|
-
source_selection_mode: SourceSelectionMode = Field(
|
|
37
|
+
source_selection_mode: SkipJsonSchema[SourceSelectionMode] = Field(
|
|
38
38
|
default=SourceSelectionMode.FROM_ORIGINAL_RESPONSE
|
|
39
39
|
)
|
|
40
|
-
reference_pattern: str = Field(default=r"[\[<]?source(\d+)[>\]]?")
|
|
40
|
+
reference_pattern: SkipJsonSchema[str] = Field(default=r"[\[<]?source(\d+)[>\]]?")
|
|
41
41
|
enabled: SkipJsonSchema[bool] = False
|
|
42
42
|
name: SkipJsonSchema[EvaluationMetricName] = EvaluationMetricName.HALLUCINATION
|
|
43
43
|
language_model: LMI = LanguageModelInfo.from_name(
|
|
@@ -598,3 +598,37 @@ def test_hallucination_required_input_fields__contains_only_valid_enum_values__f
|
|
|
598
598
|
# Act & Assert
|
|
599
599
|
for field in hallucination_required_input_fields:
|
|
600
600
|
assert isinstance(field, EvaluationMetricInputFieldName)
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
@pytest.mark.ai
|
|
604
|
+
def test_hallucination_config__excludes_source_selection_mode__from_json_schema() -> (
|
|
605
|
+
None
|
|
606
|
+
):
|
|
607
|
+
"""
|
|
608
|
+
Purpose: Verify that source_selection_mode is not included in JSON schema.
|
|
609
|
+
Why this matters: SkipJsonSchema annotation should exclude internal fields from schema.
|
|
610
|
+
Setup summary: Generate JSON schema, assert source_selection_mode is not present.
|
|
611
|
+
"""
|
|
612
|
+
# Arrange - No setup needed
|
|
613
|
+
|
|
614
|
+
# Act
|
|
615
|
+
schema: dict = HallucinationConfig.model_json_schema()
|
|
616
|
+
|
|
617
|
+
# Assert
|
|
618
|
+
assert "source_selection_mode" not in schema.get("properties", {})
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
@pytest.mark.ai
|
|
622
|
+
def test_hallucination_config__excludes_reference_pattern__from_json_schema() -> None:
|
|
623
|
+
"""
|
|
624
|
+
Purpose: Verify that reference_pattern is not included in JSON schema.
|
|
625
|
+
Why this matters: SkipJsonSchema annotation should exclude internal fields from schema.
|
|
626
|
+
Setup summary: Generate JSON schema, assert reference_pattern is not present.
|
|
627
|
+
"""
|
|
628
|
+
# Arrange - No setup needed
|
|
629
|
+
|
|
630
|
+
# Act
|
|
631
|
+
schema: dict = HallucinationConfig.model_json_schema()
|
|
632
|
+
|
|
633
|
+
# Assert
|
|
634
|
+
assert "reference_pattern" not in schema.get("properties", {})
|
|
@@ -15,6 +15,11 @@ class FeatureFlags(BaseSettings):
|
|
|
15
15
|
description="Enable new answers UI (UN-14411). Can be 'true' or comma-separated company IDs.",
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
+
feature_flag_enable_html_rendering_un_15131: str = Field(
|
|
19
|
+
default="",
|
|
20
|
+
description="Enable HTML rendering for code interpreter files (UN-15131). Can be 'true' or comma-separated company IDs.",
|
|
21
|
+
)
|
|
22
|
+
|
|
18
23
|
model_config = SettingsConfigDict(
|
|
19
24
|
extra="ignore",
|
|
20
25
|
case_sensitive=False,
|
|
@@ -27,6 +32,13 @@ class FeatureFlags(BaseSettings):
|
|
|
27
32
|
company_id and company_id in [id.strip() for id in value.split(",")]
|
|
28
33
|
)
|
|
29
34
|
|
|
35
|
+
def is_html_rendering_enabled(self, company_id: str | None = None) -> bool:
|
|
36
|
+
"""Check if HTML rendering is enabled for the given company."""
|
|
37
|
+
value = self.feature_flag_enable_html_rendering_un_15131
|
|
38
|
+
return value.lower() == "true" or bool(
|
|
39
|
+
company_id and company_id in [id.strip() for id in value.split(",")]
|
|
40
|
+
)
|
|
41
|
+
|
|
30
42
|
|
|
31
43
|
# Initialize once at module load - import this where needed
|
|
32
44
|
feature_flags = FeatureFlags()
|
|
@@ -10,6 +10,7 @@ from pydantic import BaseModel, Field, RootModel
|
|
|
10
10
|
|
|
11
11
|
from unique_toolkit import ChatService
|
|
12
12
|
from unique_toolkit._common.execution import failsafe_async
|
|
13
|
+
from unique_toolkit.agentic.feature_flags.feature_flags import feature_flags
|
|
13
14
|
from unique_toolkit.agentic.postprocessor.postprocessor_manager import (
|
|
14
15
|
ResponsesApiPostprocessor,
|
|
15
16
|
)
|
|
@@ -94,6 +95,7 @@ class DisplayCodeInterpreterFilesPostProcessor(
|
|
|
94
95
|
self._chat_service = chat_service
|
|
95
96
|
self._client = client
|
|
96
97
|
self._config = config
|
|
98
|
+
self._company_id = company_id
|
|
97
99
|
|
|
98
100
|
if self._config.upload_to_chat and self._chat_service is None:
|
|
99
101
|
raise ValueError("ChatService is required if uploadToChat is True")
|
|
@@ -169,8 +171,8 @@ class DisplayCodeInterpreterFilesPostProcessor(
|
|
|
169
171
|
)
|
|
170
172
|
changed |= replaced
|
|
171
173
|
|
|
172
|
-
# HTML
|
|
173
|
-
elif is_html:
|
|
174
|
+
# HTML (behind feature flag)
|
|
175
|
+
elif is_html and feature_flags.is_html_rendering_enabled(self._company_id):
|
|
174
176
|
loop_response.message.text, replaced = _replace_container_html_citation(
|
|
175
177
|
text=loop_response.message.text,
|
|
176
178
|
filename=filename,
|
|
@@ -178,7 +180,7 @@ class DisplayCodeInterpreterFilesPostProcessor(
|
|
|
178
180
|
)
|
|
179
181
|
changed |= replaced
|
|
180
182
|
|
|
181
|
-
# Files
|
|
183
|
+
# Files (including HTML when feature flag is disabled)
|
|
182
184
|
else:
|
|
183
185
|
loop_response.message.text, replaced = _replace_container_file_citation(
|
|
184
186
|
text=loop_response.message.text,
|
|
@@ -187,7 +189,10 @@ class DisplayCodeInterpreterFilesPostProcessor(
|
|
|
187
189
|
)
|
|
188
190
|
changed |= replaced
|
|
189
191
|
|
|
190
|
-
|
|
192
|
+
is_html_rendered = is_html and feature_flags.is_html_rendering_enabled(
|
|
193
|
+
self._company_id
|
|
194
|
+
)
|
|
195
|
+
if replaced and not is_image and not is_html_rendered:
|
|
191
196
|
loop_response.message.references.append(
|
|
192
197
|
ContentReference(
|
|
193
198
|
sequence_number=ref_number,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_toolkit
|
|
3
|
-
Version: 1.45.
|
|
3
|
+
Version: 1.45.9
|
|
4
4
|
Summary:
|
|
5
5
|
License: Proprietary
|
|
6
6
|
Author: Cedric Klinkert
|
|
@@ -125,6 +125,13 @@ All notable changes to this project will be documented in this file.
|
|
|
125
125
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
126
126
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
127
127
|
|
|
128
|
+
## [1.45.9] - 2026-02-03
|
|
129
|
+
- Add feature flag `FEATURE_FLAG_ENABLE_HTML_RENDERING_UN_15131` for HTML rendering support
|
|
130
|
+
- Put HTML rendering for code interpreter files behind the feature flag
|
|
131
|
+
|
|
132
|
+
## [1.45.8] - 2026-02-02
|
|
133
|
+
- Hallucination: Hide Source Selection Mode and Reference pattern from schema
|
|
134
|
+
|
|
128
135
|
## [1.45.7] - 2026-01-30
|
|
129
136
|
- Add JSON string parsing support for reasoning and text parameters in responses API (UI compatibility)
|
|
130
137
|
- Fix variable name bug in `_attempt_extract_verbosity_from_options` function
|
|
@@ -77,7 +77,7 @@ unique_toolkit/agentic/evaluation/context_relevancy/schema.py,sha256=lZd0TPzH43i
|
|
|
77
77
|
unique_toolkit/agentic/evaluation/context_relevancy/service.py,sha256=dsgpfKRSg9B4kjLhHJD_Kath4GVhHE-ZOVAGRkiCz20,8729
|
|
78
78
|
unique_toolkit/agentic/evaluation/evaluation_manager.py,sha256=wDN_Uuut9kEGek8JY3QeInKpF-ukbvOSKOVd7DHFT3Q,8121
|
|
79
79
|
unique_toolkit/agentic/evaluation/exception.py,sha256=7lcVbCyoN4Md1chNJDFxpUYyWbVrcr9dcc3TxWykJTc,115
|
|
80
|
-
unique_toolkit/agentic/evaluation/hallucination/constants.py,sha256
|
|
80
|
+
unique_toolkit/agentic/evaluation/hallucination/constants.py,sha256=Ed08BS6BUzxwP4ezpqk5Fu3YxbnoinCJc28Bh5MghI4,2505
|
|
81
81
|
unique_toolkit/agentic/evaluation/hallucination/hallucination_evaluation.py,sha256=x5ta2Fum4fE5ySgIXPKlnbTtmV140z0IazSATd0-REg,4092
|
|
82
82
|
unique_toolkit/agentic/evaluation/hallucination/prompts/__init__.py,sha256=4KFYMZsB3fJUKzoiUJE1npZ0gueWgvceB32EUrN-v7A,343
|
|
83
83
|
unique_toolkit/agentic/evaluation/hallucination/prompts/system_prompt.j2,sha256=sDUX6G645Ba40D_qKu4cUI8g-sJOfG8JpZreTNFgf7M,2616
|
|
@@ -89,13 +89,13 @@ unique_toolkit/agentic/evaluation/schemas.py,sha256=m9JMCUmeqP8KhsJOVEzsz6dRXUe1
|
|
|
89
89
|
unique_toolkit/agentic/evaluation/tests/fixtures.py,sha256=Q-ughTfDiAdsMKbBVGzFiBucFdAx-FXgJ9iqp5xMyPs,2801
|
|
90
90
|
unique_toolkit/agentic/evaluation/tests/test_config.py,sha256=p7xFQ7KE_yU8jGpqYA7ntAYe5Vln33wd6nwv3FM9XfI,8327
|
|
91
91
|
unique_toolkit/agentic/evaluation/tests/test_context_relevancy_service.py,sha256=NcSOyBJ_lqYehtlraZPo9RLutCitTP76kvkuyogSD2A,9477
|
|
92
|
-
unique_toolkit/agentic/evaluation/tests/test_hallucination_constants.py,sha256=
|
|
92
|
+
unique_toolkit/agentic/evaluation/tests/test_hallucination_constants.py,sha256=A77nRcniI7hUf640f1sTvCAibQbJE30ikbz1RX4fltw,20478
|
|
93
93
|
unique_toolkit/agentic/evaluation/tests/test_hallucination_utils.py,sha256=PKyGR073HxT0J_g8626kCURbMSlrMgkg-xPP7dPHD-0,31838
|
|
94
94
|
unique_toolkit/agentic/evaluation/tests/test_output_parser.py,sha256=KfltytmvqnPWLhmZpBXqcRmnlYorw_USwM5rkLVv8so,5179
|
|
95
95
|
unique_toolkit/agentic/evaluation/tests/test_prompt_loaders.py,sha256=zBREdlKf5tdDyB8XSaNgpQv3-tuZJoYteeJrp6WMWDM,11897
|
|
96
96
|
unique_toolkit/agentic/evaluation/utils.py,sha256=HmyPaDV8wdW-_gOjjW-wDaMKgdrsP5-SHP7OqTmGI_A,264
|
|
97
97
|
unique_toolkit/agentic/feature_flags/__init__.py,sha256=LhE2cHoa9AYBOR7TjiIToOn46sttm9paKcrzE7gnDPM,149
|
|
98
|
-
unique_toolkit/agentic/feature_flags/feature_flags.py,sha256=
|
|
98
|
+
unique_toolkit/agentic/feature_flags/feature_flags.py,sha256=0TCCtKi_3uOW-8tuEPksvWjDg14xIF2VnKFmAfHQGIc,1716
|
|
99
99
|
unique_toolkit/agentic/history_manager/history_construction_with_contents.py,sha256=TwamOOnYTYZMQdY1mAzj6_MZOe3T5RsjFDarT1tCtYo,8150
|
|
100
100
|
unique_toolkit/agentic/history_manager/history_manager.py,sha256=7V7_173XkAjc8otBACF0G3dbqRs34FSlURbBPrE95Wk,9537
|
|
101
101
|
unique_toolkit/agentic/history_manager/loop_token_reducer.py,sha256=3c-uonDovtanEJUpAO4zlA4-n9MS_Ws_V0Yb6G7hPM0,20172
|
|
@@ -121,7 +121,7 @@ unique_toolkit/agentic/postprocessor/postprocessor_manager.py,sha256=CoKzVFeLIr1
|
|
|
121
121
|
unique_toolkit/agentic/reference_manager/reference_manager.py,sha256=x51CT0D8HHu2LzgXdHGy0leOYpjnsxVbPZ2nc28G9mA,4005
|
|
122
122
|
unique_toolkit/agentic/responses_api/__init__.py,sha256=9WTO-ef7fGE9Y1QtZJFm8Q_jkwK8Srtl-HWvpAD2Wxs,668
|
|
123
123
|
unique_toolkit/agentic/responses_api/postprocessors/code_display.py,sha256=h6ZqPR0kPQnxM0ynshYQTa1BrcN8XGbUz9p03m8rOj0,2339
|
|
124
|
-
unique_toolkit/agentic/responses_api/postprocessors/generated_files.py,sha256=
|
|
124
|
+
unique_toolkit/agentic/responses_api/postprocessors/generated_files.py,sha256=DfOSxxa80Re5P7og02vqWRw2orEapkuL30HXvdwPGdU,13087
|
|
125
125
|
unique_toolkit/agentic/responses_api/stream_handler.py,sha256=Y1IM0uiPBdlab5UuOTCsHTaVX-fd9MxfS3xkwhdFie4,647
|
|
126
126
|
unique_toolkit/agentic/short_term_memory_manager/persistent_short_term_memory_manager.py,sha256=g8I64dKkpwWIXfwpxD1-rLte00hh_PoQ9-fXUAcNQCo,5817
|
|
127
127
|
unique_toolkit/agentic/thinking_manager/thinking_manager.py,sha256=41QWFsdRrbWlQHBfYCFv726UDom4WbcvaRfjCmoUOQI,4183
|
|
@@ -254,7 +254,7 @@ unique_toolkit/short_term_memory/service.py,sha256=5PeVBu1ZCAfyDb2HLVvlmqSbyzBBu
|
|
|
254
254
|
unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
255
255
|
unique_toolkit/smart_rules/compile.py,sha256=Ozhh70qCn2yOzRWr9d8WmJeTo7AQurwd3tStgBMPFLA,1246
|
|
256
256
|
unique_toolkit/test_utilities/events.py,sha256=_mwV2bs5iLjxS1ynDCjaIq-gjjKhXYCK-iy3dRfvO3g,6410
|
|
257
|
-
unique_toolkit-1.45.
|
|
258
|
-
unique_toolkit-1.45.
|
|
259
|
-
unique_toolkit-1.45.
|
|
260
|
-
unique_toolkit-1.45.
|
|
257
|
+
unique_toolkit-1.45.9.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
|
258
|
+
unique_toolkit-1.45.9.dist-info/METADATA,sha256=ur_CKjbMAiJpDRxa5u035UVzcdXCWLtel4fF7qGB4DM,49828
|
|
259
|
+
unique_toolkit-1.45.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
260
|
+
unique_toolkit-1.45.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|