unique_toolkit 2026.40.0.dev4__py3-none-any.whl → 2026.40.0.dev5__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.
@@ -23,7 +23,6 @@ class FeatureFlagNames(StrEnum):
23
23
  "FEATURE_FLAG_ENABLE_MCP_METADATA_FALLBACK_UN_19145"
24
24
  )
25
25
  enable_html_rendering_un_15131 = "FEATURE_FLAG_ENABLE_HTML_RENDERING_UN_15131"
26
- enable_html_with_fence_un_17927 = "FEATURE_FLAG_ENABLE_HTML_WITH_FENCE_UN_17927"
27
26
  enable_web_search_argument_screening_un_18741 = (
28
27
  "FEATURE_FLAG_ENABLE_WEB_SEARCH_ARGUMENT_SCREENING_UN_18741"
29
28
  )
@@ -118,7 +117,13 @@ class FeatureFlags(BaseSettings):
118
117
 
119
118
  enable_html_with_fence_un_17927: FeatureFlag = Field(
120
119
  default=FeatureFlag(False),
121
- description="Render HTML code interpreter files as htmlWithSource fences instead of HtmlRendering blocks (UN-17927). Requires the `enable_code_execution_fence` config field (ShowExecutedCodePostprocessorConfig) to also be enabled. Can be 'true' or comma-separated company IDs.",
120
+ description=(
121
+ "Retired: replaced by the `enable_html_with_fence` config field "
122
+ "on ShowExecutedCodePostprocessorConfig (default true). "
123
+ "No code reads this field anymore. Kept only so removing it doesn't "
124
+ "trip the config-checker's breaking-change gate on this settings "
125
+ "model; delete once that checker allows field removal."
126
+ ),
122
127
  )
123
128
 
124
129
  enable_web_search_argument_screening_un_18741: FeatureFlag = Field(
@@ -41,6 +41,15 @@ class ShowExecutedCodePostprocessorConfig(BaseModel):
41
41
  "and hide the legacy collapsible code block below."
42
42
  ),
43
43
  )
44
+ enable_html_with_fence: bool = Field(
45
+ default=True,
46
+ description=(
47
+ "Show generated HTML files as interactive cards with a built-in code "
48
+ "view instead of a plain rendered HTML block. Has no effect on its "
49
+ "own: 'enable_code_execution_fence' must be on as well. While that "
50
+ "switch is off, HTML files stay a plain rendered HTML block."
51
+ ),
52
+ )
44
53
  remove_from_history: SkipJsonSchema[bool] = (
45
54
  Field( # At the moment, it's not possible to keep executed code in the history
46
55
  default=True,
@@ -21,7 +21,6 @@ from tenacity import (
21
21
 
22
22
  from unique_toolkit import ChatService
23
23
  from unique_toolkit._common.execution import failsafe_async
24
- from unique_toolkit.agentic.feature_flags import FeatureFlagNames
25
24
  from unique_toolkit.agentic.postprocessor.postprocessor_manager import (
26
25
  ResponsesApiPostprocessor,
27
26
  )
@@ -40,10 +39,6 @@ from unique_toolkit.agentic.tools.openai_builtin.code_interpreter.schemas import
40
39
  )
41
40
  from unique_toolkit.content.schemas import ContentReference
42
41
  from unique_toolkit.content.service import ContentService
43
- from unique_toolkit.experimental.resources.feature_flags import (
44
- COMPANY_ID_PLACEHOLDER,
45
- is_flag_enabled,
46
- )
47
42
  from unique_toolkit.language_model.schemas import ResponsesLanguageModelStreamResponse
48
43
  from unique_toolkit.services.knowledge_base import KnowledgeBaseService
49
44
  from unique_toolkit.short_term_memory.service import ShortTermMemoryService
@@ -377,6 +372,7 @@ class DisplayCodeInterpreterFilesPostProcessor(
377
372
  user_id: str | None = None,
378
373
  chat_id: str | None = None,
379
374
  code_execution_fence_enabled: bool = True,
375
+ html_with_fence_enabled: bool = True,
380
376
  ) -> None:
381
377
  super().__init__(self.__class__.__name__)
382
378
 
@@ -384,7 +380,6 @@ class DisplayCodeInterpreterFilesPostProcessor(
384
380
  self._chat_service = chat_service
385
381
  self._client = client
386
382
  self._config = config
387
- self._company_id = company_id
388
383
 
389
384
  if self._chat_service is None:
390
385
  raise ValueError("ChatService is required if uploadToChat is True")
@@ -405,12 +400,11 @@ class DisplayCodeInterpreterFilesPostProcessor(
405
400
  self._file_size_map: dict[str, int] = {}
406
401
  self._container_files: list[CodeInterpreterContainerFile] = []
407
402
 
408
- # Fence rendering is a plain config switch now (was FF UN-17972). The
409
- # value lives on ShowExecutedCodePostprocessorConfig ("Code display" on
410
- # the config page) and is passed in by the orchestrator.
403
+ # Both switches are plain config values now (were FFs UN-17972 / UN-17927).
404
+ # They live on ShowExecutedCodePostprocessorConfig ("Code display" on the
405
+ # config page) and are passed in by the orchestrator.
411
406
  self._fence_enabled = code_execution_fence_enabled
412
- # Resolved in run() (before apply_postprocessing_to_response) since flag evaluation is async.
413
- self._html_fence_ff_on = False
407
+ self._html_fence_enabled = html_with_fence_enabled
414
408
 
415
409
  def _build_retry(self) -> AsyncRetrying:
416
410
  """Build a tenacity retry policy from the current config.
@@ -515,13 +509,6 @@ class DisplayCodeInterpreterFilesPostProcessor(
515
509
  run_t0 = time.monotonic()
516
510
  self._log.info("run() started — fetching and uploading code interpreter files")
517
511
 
518
- # htmlWithSource requires BOTH the fence config and the HTML-fence FF on;
519
- # default (FF off) keeps HtmlRendering, so existing deployments are unaffected.
520
- self._html_fence_ff_on = await is_flag_enabled(
521
- FeatureFlagNames.enable_html_with_fence_un_17927,
522
- company_id=self._company_id or COMPANY_ID_PLACEHOLDER,
523
- )
524
-
525
512
  container_files = await self._resolve_container_files(loop_response)
526
513
  self._container_files = container_files
527
514
  self._log.info(
@@ -711,9 +698,9 @@ class DisplayCodeInterpreterFilesPostProcessor(
711
698
  )
712
699
  changed |= replaced
713
700
 
714
- # HTML uses HtmlRendering unless BOTH the fence config and the
715
- # html-fence FF are on (htmlWithSource needs both).
716
- elif is_html and not (self._html_fence_ff_on and self._fence_enabled):
701
+ # HTML uses HtmlRendering unless BOTH switches are on (htmlWithSource
702
+ # needs the code-execution fence too).
703
+ elif is_html and not (self._html_fence_enabled and self._fence_enabled):
717
704
  loop_response.message.text, replaced = _replace_container_html_citation(
718
705
  text=loop_response.message.text or "",
719
706
  filename=filename,
@@ -770,7 +757,7 @@ class DisplayCodeInterpreterFilesPostProcessor(
770
757
  loop_response,
771
758
  self._content_map,
772
759
  self._container_files,
773
- include_html=self._html_fence_ff_on,
760
+ include_html=self._html_fence_enabled,
774
761
  )
775
762
  self._log.info(
776
763
  "Fence injection — %d code block(s), files: %s",
@@ -778,7 +765,7 @@ class DisplayCodeInterpreterFilesPostProcessor(
778
765
  [f.filename for b in code_blocks for f in b.files],
779
766
  )
780
767
  _warn_unmatched_code_blocks(
781
- self._content_map, code_blocks, include_html=self._html_fence_ff_on
768
+ self._content_map, code_blocks, include_html=self._html_fence_enabled
782
769
  )
783
770
  text_before = loop_response.message.text
784
771
  loop_response.message.text = _inject_code_execution_fences(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: unique-toolkit
3
- Version: 2026.40.0.dev4
3
+ Version: 2026.40.0.dev5
4
4
  Summary:
5
5
  Author: Cedric Klinkert, Martin Fadler, Sadique Sheik, Fabian Schläpfer, Pascal Hauri, Ejiroghene Oki-Peter, Rami Azouz, Ricardo Visini, Sanzio Monti
6
6
  Author-email: Cedric Klinkert <cedric.klinkert@unique.ch>, Martin Fadler <martin.fadler@unique.ch>, Sadique Sheik <sadique@unique.ch>, Fabian Schläpfer <fabian@unique.ch>, Pascal Hauri <pascal@unique.ch>, Ejiroghene Oki-Peter <oki-peter.ejiroghene@unique.ai>, Rami Azouz <rami.ext@unique.ch>, Ricardo Visini <ricardo.visini@unique.ch>, Sanzio Monti <sanzio.monti@unique.ai>
@@ -112,7 +112,7 @@ unique_toolkit/agentic/evaluation/tests/test_output_parser.py,sha256=KfltytmvqnP
112
112
  unique_toolkit/agentic/evaluation/tests/test_prompt_loaders.py,sha256=zBREdlKf5tdDyB8XSaNgpQv3-tuZJoYteeJrp6WMWDM,11897
113
113
  unique_toolkit/agentic/evaluation/utils.py,sha256=HmyPaDV8wdW-_gOjjW-wDaMKgdrsP5-SHP7OqTmGI_A,264
114
114
  unique_toolkit/agentic/feature_flags/__init__.py,sha256=fBR9FaLrc9e8sdYDe1LwP9aNJt5aLLtAq3nIphVWkIk,191
115
- unique_toolkit/agentic/feature_flags/feature_flags.py,sha256=tPXiHzUWrDhybcbGkjwP8Q_2L3f05sk3inEnNYgApZ8,7095
115
+ unique_toolkit/agentic/feature_flags/feature_flags.py,sha256=LlFfcgGV4lRQ_mgOGsbZzjKeTXxjCCOl7agCxvJUhvQ,7133
116
116
  unique_toolkit/agentic/history_manager/history_construction_with_contents.py,sha256=7d1f9VGBtgB-73uk72ewBKbtefzKMxxfW2_8BcmLGTc,25359
117
117
  unique_toolkit/agentic/history_manager/history_manager.py,sha256=PqSa87yzNIDRXqjh1KN7moeIpp_jWxj9qEPig4wv790,16062
118
118
  unique_toolkit/agentic/history_manager/loop_token_reducer.py,sha256=lgo5zAq6gYLo7FFTNWe5sc6o80vnadKsr-cgEDP6hM8,30754
@@ -217,8 +217,8 @@ unique_toolkit/agentic/tools/openai_builtin/code_interpreter/builder/builder.py,
217
217
  unique_toolkit/agentic/tools/openai_builtin/code_interpreter/config.py,sha256=C4Vrj_xLgLB8AEUz-cp0JpXAIwYwz-VaSRh-xAG7PW8,2381
218
218
  unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/__init__.py,sha256=SzEiUqxIw8D4_51SvTt-8oTOYTGirYkmH4J6SgojzME,634
219
219
  unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/artifacts.py,sha256=_zQZVRyqGzgKCFYL8QMfd6B0RjYXljH3SKESwdwv0T0,6851
220
- unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/code_display.py,sha256=4f5zrO-C3MMdrEShk3rLNJFZfiGrYxLpTxmQFRBae5g,3003
221
- unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/generated_files.py,sha256=m7QVds084Dt-LmKGH5SntXgOAPzsDSNVVMq0kEUPaDc,67258
220
+ unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/code_display.py,sha256=Q1XI_Wi2Lg8Vn31nGTtu6YHOyz9QBFwI6d9MBYGhkW8,3425
221
+ unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/generated_files.py,sha256=mXbiBj8m1TOPAgPxzBihI5Lv1zr877nmFkxAepD_p3Q,66640
222
222
  unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/office_preview.py,sha256=5DtJWkzJwEFsh2uyHjT5qU5G277qXaHun1JRCYVhZFE,4951
223
223
  unique_toolkit/agentic/tools/openai_builtin/code_interpreter/schemas.py,sha256=4JDJ2SuKTYcLFo_bYoDWKTgjlcO20mid203NVpJ1jm4,779
224
224
  unique_toolkit/agentic/tools/openai_builtin/code_interpreter/tool/__init__.py,sha256=r6yXmGTLJzXNq5laHOlre9veu--VbCQVlDRVm2QUGzI,326
@@ -423,6 +423,6 @@ unique_toolkit/short_term_memory/service.py,sha256=2JMBEBn6GoyK-a0xvdcWpPft-3C74
423
423
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
424
424
  unique_toolkit/smart_rules/compile.py,sha256=vRe0aMJWuVIK-VsqomgxQImzke7MDmwgSxxJfYCa7zw,1386
425
425
  unique_toolkit/test_utilities/events.py,sha256=FLrhMh0A_mQutAUjoD0FdMcVQ4Gq31r35OVGzRjvLro,6760
426
- unique_toolkit-2026.40.0.dev4.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
427
- unique_toolkit-2026.40.0.dev4.dist-info/METADATA,sha256=2WY_saE6SEQU6fBgRGMU1j_J20M05B4a53ADoeqbGGc,7821
428
- unique_toolkit-2026.40.0.dev4.dist-info/RECORD,,
426
+ unique_toolkit-2026.40.0.dev5.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
427
+ unique_toolkit-2026.40.0.dev5.dist-info/METADATA,sha256=TB781mnDzgeSR6SyyT5eQZym_pvENv44MlVx-Q8ano4,7821
428
+ unique_toolkit-2026.40.0.dev5.dist-info/RECORD,,