unique_toolkit 1.45.8__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.
@@ -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
- if replaced and not is_image:
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.8
3
+ Version: 1.45.9
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Cedric Klinkert
@@ -125,6 +125,10 @@ 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
+
128
132
  ## [1.45.8] - 2026-02-02
129
133
  - Hallucination: Hide Source Selection Mode and Reference pattern from schema
130
134
 
@@ -95,7 +95,7 @@ unique_toolkit/agentic/evaluation/tests/test_output_parser.py,sha256=KfltytmvqnP
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=4jPH0GGGt5-tQ6PJWNpMBIlYzNrQIIqBLx8W02lwxD0,1140
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=janOVTJtGDXWvWsUjB1pnRfLUVXPSkjjbXHxUS0IjjE,12685
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.8.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
258
- unique_toolkit-1.45.8.dist-info/METADATA,sha256=y8-QbF2LcCdVQbM40ldn9IaBWwOoUdhGxhnYfYEhcyQ,49638
259
- unique_toolkit-1.45.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
260
- unique_toolkit-1.45.8.dist-info/RECORD,,
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,,