unique_toolkit 2026.46.0.dev4__py3-none-any.whl → 2026.46.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.
@@ -252,12 +252,12 @@ def _split_contents(
252
252
  for content in contents:
253
253
  if selected_content_ids is not None and content.id not in selected_content_ids:
254
254
  continue
255
- is_image = FileUtils.is_image_content(content.key)
256
- if is_image or FileUtils.is_file_content(content.key):
257
- serializable.append(content)
258
- # Failed or expired uploads cannot be downloaded; they are still listed
259
- # via the serializer but never attached as an image.
260
- if is_image and not content.has_ingestion_failed() and not content.is_expired():
255
+ serializable.append(content)
256
+ if (
257
+ FileUtils.is_image_content(content.key)
258
+ and not content.has_ingestion_failed()
259
+ and not content.is_expired()
260
+ ):
261
261
  images.append(content)
262
262
  return _SplitContents(serializable=serializable, images=images)
263
263
 
@@ -177,6 +177,11 @@ class Content(BaseModel):
177
177
  ingestion_state: str | None = None
178
178
 
179
179
  def is_ingested(self, *, default_if_unknown: bool = True) -> bool:
180
+ # FINISHED is written both after a real ingestion and when ingestion
181
+ # is skipped. Chunks are what separate the two.
182
+ if self.ingestion_state == "FINISHED":
183
+ return len(self.chunks) > 0
184
+
180
185
  if (
181
186
  self.applied_ingestion_config is None
182
187
  or "uniqueIngestionMode" not in self.applied_ingestion_config
@@ -832,12 +832,7 @@ class ContentService:
832
832
  },
833
833
  )
834
834
 
835
- content: list[Content] = []
836
- for c in chat_contents:
837
- if self.is_file_content(c.key):
838
- content.append(c)
839
-
840
- return content
835
+ return [c for c in chat_contents if not self.is_image_content(c.key)]
841
836
 
842
837
  async def get_documents_uploaded_to_chat_async(self) -> list[Content]:
843
838
  chat_contents = await self.search_contents_async(
@@ -848,12 +843,7 @@ class ContentService:
848
843
  },
849
844
  )
850
845
 
851
- content: list[Content] = []
852
- for c in chat_contents:
853
- if self.is_file_content(c.key):
854
- content.append(c)
855
-
856
- return content
846
+ return [c for c in chat_contents if not self.is_image_content(c.key)]
857
847
 
858
848
  def get_images_uploaded_to_chat(self) -> list[Content]:
859
849
  chat_contents = self.search_contents(
@@ -117,6 +117,7 @@ class LanguageModelName(StrEnum):
117
117
  GEMINI_3_FLASH_PREVIEW = "litellm:gemini-3-flash-preview"
118
118
  GEMINI_3_PRO_PREVIEW = "litellm:gemini-3-pro-preview"
119
119
  GEMINI_4_ARGON = "litellm:gemini-4-argon"
120
+ GEMINI_4_CARBON = "litellm:gemini-4-carbon"
120
121
  GROK_4_1_FAST_NON_REASONING = "litellm:grok-4-1-fast-non-reasoning"
121
122
  GROK_4_1_FAST_REASONING = "litellm:grok-4-1-fast-reasoning"
122
123
  GROK_4_5 = "litellm:grok-4-5"
@@ -177,6 +178,7 @@ class LanguageModelName(StrEnum):
177
178
  VERTEX_CLAUDE_FABLE_5 = "litellm:vertex-claude-fable-5"
178
179
  VERTEX_GEMINI_3_8_FLASH = "litellm:vertex-gemini-3-8-flash"
179
180
  VERTEX_GEMINI_4_ARGON = "litellm:vertex-gemini-4-argon"
181
+ VERTEX_GEMINI_4_CARBON = "litellm:vertex-gemini-4-carbon"
180
182
 
181
183
 
182
184
  class EncoderName(StrEnum):
@@ -2541,6 +2543,35 @@ class LanguageModelInfo(BaseModel):
2541
2543
  default_options={"reasoning_effort": "medium"},
2542
2544
  supported_reasoning_efforts=["low", "medium", "high"],
2543
2545
  )
2546
+ case (
2547
+ LanguageModelName.GEMINI_4_CARBON
2548
+ | LanguageModelName.VERTEX_GEMINI_4_CARBON
2549
+ ):
2550
+ return cls(
2551
+ name=model_name,
2552
+ capabilities=[
2553
+ ModelCapabilities.FUNCTION_CALLING,
2554
+ ModelCapabilities.STREAMING,
2555
+ ModelCapabilities.VISION,
2556
+ ModelCapabilities.STRUCTURED_OUTPUT,
2557
+ ModelCapabilities.REASONING,
2558
+ ],
2559
+ provider=LanguageModelProvider.LITELLM,
2560
+ family=ModelFamily.GOOGLE,
2561
+ version="gemini-4-carbon",
2562
+ encoder_name=EncoderName.O200K_BASE, # TODO: Update encoder with litellm
2563
+ token_limits=LanguageModelTokenLimits(
2564
+ # No public model card yet. Limits follow Gemini 4 Argon.
2565
+ # https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-carbon/
2566
+ token_limit_input=1_048_576,
2567
+ token_limit_output=65_536,
2568
+ ),
2569
+ published_at=date(2026, 10, 28),
2570
+ # Gemini 4 thinking levels are low, medium (default), and high.
2571
+ # https://ai.google.dev/gemini-api/docs/generate-content/thinking
2572
+ default_options={"reasoning_effort": "medium"},
2573
+ supported_reasoning_efforts=["low", "medium", "high"],
2574
+ )
2544
2575
  case LanguageModelName.GROK_4_1_FAST_NON_REASONING:
2545
2576
  return cls(
2546
2577
  name=model_name,
@@ -21,7 +21,7 @@ from unique_toolkit._common.metadata_filter_scope import (
21
21
  build_folder_id_in_clause,
22
22
  merge_scope_clause_into_metadata_filter,
23
23
  )
24
- from unique_toolkit._common.utils.files import is_file_content, is_image_content
24
+ from unique_toolkit._common.utils.files import is_image_content
25
25
  from unique_toolkit.agentic.message_log_order import next_message_log_order
26
26
  from unique_toolkit.app.unique_settings import UniqueContext, UniqueSettings
27
27
  from unique_toolkit.chat.cancellation import CancellationWatcher
@@ -2086,10 +2086,10 @@ class ChatService(ChatServiceDeprecated):
2086
2086
  images: list[Content] = []
2087
2087
  files: list[Content] = []
2088
2088
  for c in contents:
2089
- if is_file_content(filename=c.key):
2090
- files.append(c)
2091
2089
  if is_image_content(filename=c.key):
2092
2090
  images.append(c)
2091
+ else:
2092
+ files.append(c)
2093
2093
  return images, files
2094
2094
 
2095
2095
  def download_chat_images_and_documents(self) -> tuple[list[Content], list[Content]]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: unique-toolkit
3
- Version: 2026.46.0.dev4
3
+ Version: 2026.46.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>
@@ -115,7 +115,7 @@ unique_toolkit/agentic/evaluation/utils.py,sha256=HmyPaDV8wdW-_gOjjW-wDaMKgdrsP5
115
115
  unique_toolkit/agentic/feature_flags/__init__.py,sha256=fBR9FaLrc9e8sdYDe1LwP9aNJt5aLLtAq3nIphVWkIk,191
116
116
  unique_toolkit/agentic/feature_flags/feature_flags.py,sha256=3E24xKSlpmZmIgIyPrXT_P_6yG1zeODFVJdEgcY0uJA,7250
117
117
  unique_toolkit/agentic/history_manager/context_overflow.py,sha256=N5g8bHUHcRz7gey3cCX-xwK7DJkp_O-3IthMnGsIvcE,9472
118
- unique_toolkit/agentic/history_manager/history_construction_with_contents.py,sha256=bJH5RiLM__fg-i_ycact--9xtV5A321xe_cktT__bzA,26284
118
+ unique_toolkit/agentic/history_manager/history_construction_with_contents.py,sha256=cw7YpLMk3NKlNJ4k0Nv2bhMH15NEDYUUwvrloJrV38s,26096
119
119
  unique_toolkit/agentic/history_manager/history_manager.py,sha256=JM57S-Cou_vzDR3eM52gYRjgu-lhVUDoYyVGE7pgIYY,19078
120
120
  unique_toolkit/agentic/history_manager/loop_token_reducer.py,sha256=yLxBPF6gkzpBTL5aOzPgQ61bsZd2kOOxeNrGBEdWTEg,31350
121
121
  unique_toolkit/agentic/history_manager/settings.py,sha256=Lrx3a8yXeU0MXrWlV6RZSHsgYWF9Zrs8LyR96OpqQ_k,1216
@@ -275,8 +275,8 @@ unique_toolkit/chat/utils.py,sha256=CsD9IER2gA1IOV0fmUOl-N0LmKvA7JP9dGrOqeOY0Gg,
275
275
  unique_toolkit/content/__init__.py,sha256=yeVVqHjltRii_XwPOX2uId2kHF0_wCcSC4jwalv_5g8,1707
276
276
  unique_toolkit/content/constants.py,sha256=1iy4Y67xobl5VTnJB6SxSyuoBWbdLl9244xfVMUZi5o,60
277
277
  unique_toolkit/content/functions.py,sha256=fLEueWbiMOOO43HxnltqdRR_Et9JoQCjnCm5WZA94DY,36284
278
- unique_toolkit/content/schemas.py,sha256=6cvKqS2WerbrysD2FNmFef0REzaXfRUio7Nb3bLbViA,12734
279
- unique_toolkit/content/service.py,sha256=3_QUMhJ_zo0OgXiq99nj2J14Hls8z8Vvlioevydp9J4,31775
278
+ unique_toolkit/content/schemas.py,sha256=sYkXvP7SItHbaVvnU8HKgBPgQdJemPk3fgonDOvROpQ,12955
279
+ unique_toolkit/content/service.py,sha256=mZZtIm23dK6ZXI66V98dbYMwMvIjdKuhc-EnKnPczzI,31591
280
280
  unique_toolkit/content/smart_rules.py,sha256=-bRlF_e66yKA8KsXTPYqfhHZu1jsXXl5akIZnSgu5X8,11621
281
281
  unique_toolkit/content/utils.py,sha256=keDkqu_ZzQY0y_g7g_XLOza3p4XsvfqVVDI9ylM91KY,10115
282
282
  unique_toolkit/data_extraction/README.md,sha256=5KxzqPHC29wxBiWJ-87wBQisSgRBkuSnPTb38pGH1wA,3138
@@ -400,7 +400,7 @@ unique_toolkit/language_model/constants.py,sha256=B-topqW0r83dkC_25DeQfnPk3n53qz
400
400
  unique_toolkit/language_model/default_language_model.py,sha256=mcyuFs_V6tp52C8xJSHiEHO4kFGj6xed1gvozvCRD7k,1181
401
401
  unique_toolkit/language_model/errors.py,sha256=0nm4psGCGJM2B7LIyKXy7WuswRzwARIgIK5xoC4xo34,3186
402
402
  unique_toolkit/language_model/functions.py,sha256=6Le6dDm9su6xk3sQ8IPiyUn2tf1qvzxHVUhyTTgP8Kw,28109
403
- unique_toolkit/language_model/infos.py,sha256=IAwSmmFEdX51bYXsx62XQqJ4wwaJMz7fGf3nsNcHlZE,183833
403
+ unique_toolkit/language_model/infos.py,sha256=YFyqEDPweMDE7c0-CozfDrZ2ZUY3mVIPILFY4nlqH0Q,185513
404
404
  unique_toolkit/language_model/invocation_stats.py,sha256=CQbpUz394IsVd8eNTB1gPSMt5f0UXmkN1amNsqtAW6U,5857
405
405
  unique_toolkit/language_model/model_costs.py,sha256=AVHAuMTzsglzusWsVF_xwBVEndST-TVCVi0H49OhdvE,7419
406
406
  unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
@@ -419,7 +419,7 @@ unique_toolkit/monitoring/registry.py,sha256=De2Bx5QBBRJQY2MM3xtntiJ2JU2FoKkVT7r
419
419
  unique_toolkit/monitoring/tracing.py,sha256=0lmLuQjyyC3iFpNTw8rOyCpEZ6PTvp16nVbzcO9d2sQ,10043
420
420
  unique_toolkit/protocols/support.py,sha256=vlXZEC9_Gupk2x9wZln5FJQlM6srWv4hIZY6O5WXhbk,5636
421
421
  unique_toolkit/services/__init__.py,sha256=b9Wl7Wvz1JmZDbDexIZzBoXZ0wscXuczGAH8LoL-Qak,572
422
- unique_toolkit/services/chat_service.py,sha256=UasMB15wQnHp8-yMY9kN1zK8UZPhFPCi4vgkxrqBrEM,101802
422
+ unique_toolkit/services/chat_service.py,sha256=oj5Q6f5Dv6xJFrGwUSRNuQgnTH391ejzUon8zioqgSc,101755
423
423
  unique_toolkit/services/factory.py,sha256=7gNeanyHkgX23Iz7RMCQTCkE9gI5asCI11nXxM0jjx4,9832
424
424
  unique_toolkit/services/knowledge_base.py,sha256=qvq9JhRUNciyvTn7PaJEuPGFHAyZbM8LzxCXfBo1Mqg,45625
425
425
  unique_toolkit/short_term_memory/__init__.py,sha256=2mI3AUrffgH7Yt-xS57EGqnHf7jnn6xquoKEhJqk3Wg,185
@@ -430,6 +430,6 @@ unique_toolkit/short_term_memory/service.py,sha256=2JMBEBn6GoyK-a0xvdcWpPft-3C74
430
430
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
431
431
  unique_toolkit/smart_rules/compile.py,sha256=vRe0aMJWuVIK-VsqomgxQImzke7MDmwgSxxJfYCa7zw,1386
432
432
  unique_toolkit/test_utilities/events.py,sha256=FLrhMh0A_mQutAUjoD0FdMcVQ4Gq31r35OVGzRjvLro,6760
433
- unique_toolkit-2026.46.0.dev4.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
434
- unique_toolkit-2026.46.0.dev4.dist-info/METADATA,sha256=S3pb1MeBajfmMuiG1-DzzHjYwlu1YKRqAbgpw0XhhWA,7821
435
- unique_toolkit-2026.46.0.dev4.dist-info/RECORD,,
433
+ unique_toolkit-2026.46.0.dev6.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
434
+ unique_toolkit-2026.46.0.dev6.dist-info/METADATA,sha256=8yY6Ktt6coMQ6CD_HxfAWPyyYJyJEGWx9UJ45KDy8Bs,7821
435
+ unique_toolkit-2026.46.0.dev6.dist-info/RECORD,,