unique_toolkit 2026.40.0.dev4__py3-none-any.whl → 2026.40.0.dev6__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/feature_flags/feature_flags.py +7 -2
- unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/code_display.py +9 -0
- unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/generated_files.py +10 -23
- unique_toolkit/language_model/infos.py +29 -0
- {unique_toolkit-2026.40.0.dev4.dist-info → unique_toolkit-2026.40.0.dev6.dist-info}/METADATA +2 -2
- {unique_toolkit-2026.40.0.dev4.dist-info → unique_toolkit-2026.40.0.dev6.dist-info}/RECORD +7 -7
- {unique_toolkit-2026.40.0.dev4.dist-info → unique_toolkit-2026.40.0.dev6.dist-info}/WHEEL +0 -0
|
@@ -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=
|
|
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,
|
unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/generated_files.py
CHANGED
|
@@ -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
|
-
#
|
|
409
|
-
#
|
|
410
|
-
#
|
|
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
|
-
|
|
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
|
|
715
|
-
#
|
|
716
|
-
elif is_html and not (self.
|
|
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.
|
|
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.
|
|
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(
|
|
@@ -113,6 +113,7 @@ class LanguageModelName(StrEnum):
|
|
|
113
113
|
GROK_4_1_FAST_REASONING = "litellm:grok-4-1-fast-reasoning"
|
|
114
114
|
GROK_4_5 = "litellm:grok-4-5"
|
|
115
115
|
GROK_4_6 = "litellm:grok-4-6"
|
|
116
|
+
GROK_4_7 = "litellm:grok-4-7"
|
|
116
117
|
LITELLM_OPENAI_GPT_5 = "litellm:openai-gpt-5"
|
|
117
118
|
LITELLM_OPENAI_GPT_5_MINI = "litellm:openai-gpt-5-mini"
|
|
118
119
|
LITELLM_OPENAI_GPT_5_NANO = "litellm:openai-gpt-5-nano"
|
|
@@ -2322,6 +2323,34 @@ class LanguageModelInfo(BaseModel):
|
|
|
2322
2323
|
supported_reasoning_efforts=["low", "medium", "high", "xhigh"],
|
|
2323
2324
|
default_options={"reasoning_effort": "high"},
|
|
2324
2325
|
)
|
|
2326
|
+
case LanguageModelName.GROK_4_7:
|
|
2327
|
+
# Specs from https://docs.x.ai/developers/models/grok-4.7
|
|
2328
|
+
# Knowledge cutoff from https://docs.x.ai/developers/models
|
|
2329
|
+
# Published 2026-09-21: https://vercel.com/changelog/grok-4-7-now-available-and-40-off-on-ai-gateway-fx-eve
|
|
2330
|
+
return cls(
|
|
2331
|
+
name=model_name,
|
|
2332
|
+
capabilities=[
|
|
2333
|
+
ModelCapabilities.FUNCTION_CALLING,
|
|
2334
|
+
ModelCapabilities.REASONING,
|
|
2335
|
+
ModelCapabilities.STREAMING,
|
|
2336
|
+
ModelCapabilities.STRUCTURED_OUTPUT,
|
|
2337
|
+
ModelCapabilities.VISION,
|
|
2338
|
+
],
|
|
2339
|
+
provider=LanguageModelProvider.LITELLM,
|
|
2340
|
+
family=ModelFamily.XAI,
|
|
2341
|
+
version="grok-4.7",
|
|
2342
|
+
encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with grok tokenizer
|
|
2343
|
+
token_limits=LanguageModelTokenLimits(
|
|
2344
|
+
# Context window is 500_000, we leave 20_000 tokens as buffer due to tokenizer mismatch
|
|
2345
|
+
# Assign 90% for input and 10% for output
|
|
2346
|
+
token_limit_input=int(480_000 * 0.9),
|
|
2347
|
+
token_limit_output=int(480_000 * 0.1),
|
|
2348
|
+
),
|
|
2349
|
+
info_cutoff_at=date(2026, 5, day=1),
|
|
2350
|
+
published_at=date(2026, 9, day=21),
|
|
2351
|
+
supported_reasoning_efforts=["low", "medium", "high", "xhigh"],
|
|
2352
|
+
default_options={"reasoning_effort": "high"},
|
|
2353
|
+
)
|
|
2325
2354
|
case LanguageModelName.LITELLM_OPENAI_GPT_5:
|
|
2326
2355
|
return cls(
|
|
2327
2356
|
name=model_name,
|
{unique_toolkit-2026.40.0.dev4.dist-info → unique_toolkit-2026.40.0.dev6.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: unique-toolkit
|
|
3
|
-
Version: 2026.40.0.
|
|
3
|
+
Version: 2026.40.0.dev6
|
|
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>
|
|
@@ -16,7 +16,7 @@ Requires-Dist: sseclient>=0.0.27,<0.0.28
|
|
|
16
16
|
Requires-Dist: openai>=1.105.0,<3
|
|
17
17
|
Requires-Dist: platformdirs>=4.0.0,<5
|
|
18
18
|
Requires-Dist: pillow>=12.1.1
|
|
19
|
-
Requires-Dist: unique-sdk>=2026.40.0.
|
|
19
|
+
Requires-Dist: unique-sdk>=2026.40.0.dev4,<2026.40.0rc0
|
|
20
20
|
Requires-Dist: jambo>=0.1.2,<0.2
|
|
21
21
|
Requires-Dist: jinja2>=3.1.6,<4
|
|
22
22
|
Requires-Dist: docxtpl>=0.20.1,<0.21
|
|
@@ -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=
|
|
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=
|
|
221
|
-
unique_toolkit/agentic/tools/openai_builtin/code_interpreter/postprocessors/generated_files.py,sha256=
|
|
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
|
|
@@ -394,7 +394,7 @@ unique_toolkit/language_model/builder.py,sha256=KwBzsD6-fvQnB4p2I7M-5Tk6j4tmQ973
|
|
|
394
394
|
unique_toolkit/language_model/constants.py,sha256=B-topqW0r83dkC_25DeQfnPk3n53qzIHUCBS7YJ0-1U,119
|
|
395
395
|
unique_toolkit/language_model/default_language_model.py,sha256=mcyuFs_V6tp52C8xJSHiEHO4kFGj6xed1gvozvCRD7k,1181
|
|
396
396
|
unique_toolkit/language_model/functions.py,sha256=W6JC4LUh-LZ9waDgph--xVmKeQ7Ls6NRAqDx9DwQdeY,26691
|
|
397
|
-
unique_toolkit/language_model/infos.py,sha256=
|
|
397
|
+
unique_toolkit/language_model/infos.py,sha256=7SWbktrOHKQhNJQtEYRJUC05gmPLXkUzQvJYNX4JaTk,158888
|
|
398
398
|
unique_toolkit/language_model/invocation_stats.py,sha256=CQbpUz394IsVd8eNTB1gPSMt5f0UXmkN1amNsqtAW6U,5857
|
|
399
399
|
unique_toolkit/language_model/model_costs.py,sha256=ShuDAzMew1fUkJ3tzPgU5Zqjp6ivUZaG97BFh93tEn4,6358
|
|
400
400
|
unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
|
|
@@ -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.
|
|
427
|
-
unique_toolkit-2026.40.0.
|
|
428
|
-
unique_toolkit-2026.40.0.
|
|
426
|
+
unique_toolkit-2026.40.0.dev6.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
427
|
+
unique_toolkit-2026.40.0.dev6.dist-info/METADATA,sha256=vbzpuiTtX4OvAZk4O3wrQY-ie0UYxA8ga5WiI0BjrW4,7821
|
|
428
|
+
unique_toolkit-2026.40.0.dev6.dist-info/RECORD,,
|
|
File without changes
|