unique_toolkit 1.5.0__py3-none-any.whl → 1.5.1__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.
@@ -31,3 +31,7 @@ class CommonException(Exception):
31
31
 
32
32
  def __str__(self):
33
33
  return self._error_message
34
+
35
+
36
+ class ConfigurationException(Exception):
37
+ pass
@@ -11,6 +11,7 @@ from typing import (
11
11
 
12
12
  from sseclient import SSEClient
13
13
 
14
+ from unique_toolkit._common.exception import ConfigurationException
14
15
  from unique_toolkit.app import BaseEvent, ChatEvent, EventName
15
16
  from unique_toolkit.app.init_sdk import init_unique_sdk
16
17
  from unique_toolkit.app.unique_settings import UniqueSettings
@@ -79,6 +80,9 @@ def get_event_generator(
79
80
 
80
81
  yield parsed_event
81
82
 
83
+ except ConfigurationException as e:
84
+ # Re-raise ConfigurationException from filter_event (configuration errors)
85
+ raise e
82
86
  except Exception as e:
83
87
  LOGGER.error(f"Could not parse SSE event data as JSON: {e}")
84
88
  continue
@@ -1,5 +1,6 @@
1
1
  import json
2
2
  from enum import StrEnum
3
+ from logging import getLogger
3
4
  from pathlib import Path
4
5
  from typing import Any, Generic, Optional, TypeVar, override
5
6
 
@@ -8,6 +9,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator
8
9
  from pydantic_settings import BaseSettings
9
10
  from typing_extensions import deprecated
10
11
 
12
+ from unique_toolkit._common.exception import ConfigurationException
11
13
  from unique_toolkit.app.unique_settings import UniqueChatEventFilterOptions
12
14
  from unique_toolkit.smart_rules.compile import UniqueQL, parse_uniqueql
13
15
 
@@ -19,6 +21,7 @@ model_config = ConfigDict(
19
21
  populate_by_name=True,
20
22
  arbitrary_types_allowed=True,
21
23
  )
24
+ _logger = getLogger(__name__)
22
25
 
23
26
 
24
27
  class EventName(StrEnum):
@@ -255,9 +258,20 @@ class ChatEvent(BaseEvent):
255
258
  self, *, filter_options: UniqueChatEventFilterOptions | None = None
256
259
  ) -> bool:
257
260
  # Empty string evals to False
258
- if filter_options is None:
259
- return False
260
261
 
262
+ if filter_options is None:
263
+ return False # Don't filter when no options provided
264
+
265
+ if not filter_options.assistant_ids and not filter_options.references_in_code:
266
+ raise ConfigurationException(
267
+ "No filter options provided, all events will be filtered! \n"
268
+ "Please define: \n"
269
+ " - 'UNIQUE_CHAT_EVENT_FILTER_OPTIONS_ASSISTANT_IDS' \n"
270
+ " - 'UNIQUE_CHAT_EVENT_FILTER_OPTIONS_REFERENCES_IN_CODE' \n"
271
+ "in your environment variables."
272
+ )
273
+
274
+ # Per reference in code there can be multiple assistants
261
275
  if (
262
276
  filter_options.assistant_ids
263
277
  and self.payload.assistant_id not in filter_options.assistant_ids
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Cedric Klinkert
@@ -118,6 +118,10 @@ All notable changes to this project will be documented in this file.
118
118
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
119
119
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
120
120
 
121
+
122
+ ## [1.5.1] - 2025-10-01
123
+ - Fix filtering logic to raise a ConfigurationException if chat event filters are not specified
124
+
121
125
  ## [1.5.0] - 2025-10-01
122
126
  - Allow history manager to fetch only ui visible text
123
127
 
@@ -11,7 +11,7 @@ unique_toolkit/_common/chunk_relevancy_sorter/tests/test_service.py,sha256=UhDll
11
11
  unique_toolkit/_common/default_language_model.py,sha256=tmHSqg6e8G7RmKqmdE_tmLxkSN0x-aGoyUdy6Pl2oAE,334
12
12
  unique_toolkit/_common/endpoint_builder.py,sha256=WzJrJ7azUQhvQRd-vsFFoyj6omJpHiVYrh1UFxNQvVg,8242
13
13
  unique_toolkit/_common/endpoint_requestor.py,sha256=JbbfJGLxgxLz8a3Yx1FdJvdHGbCYO8MSBd7cLg_Mtp0,5927
14
- unique_toolkit/_common/exception.py,sha256=caQIE1btsQnpKCHqL2cgWUSbHup06enQu_Pt7uGUTTE,727
14
+ unique_toolkit/_common/exception.py,sha256=hwh60UUawHDyPFNs-Wom-Gc6Yb09gPelftAuW1tXE6o,779
15
15
  unique_toolkit/_common/feature_flags/schema.py,sha256=F1NdVJFNU8PKlS7bYzrIPeDu2LxRqHSM9pyw622a1Kk,547
16
16
  unique_toolkit/_common/pydantic/rjsf_tags.py,sha256=T3AZIF8wny3fFov66s258nEl1GqfKevFouTtG6k9PqU,31219
17
17
  unique_toolkit/_common/pydantic_helpers.py,sha256=1zzg6PlzSkHqPTdX-KoBaDHmBeeG7S5PprBsyMSCEuU,4806
@@ -86,12 +86,12 @@ unique_toolkit/agentic/tools/utils/source_handling/schema.py,sha256=l4B6kA6grbL-
86
86
  unique_toolkit/agentic/tools/utils/source_handling/source_formatting.py,sha256=uZ0QXqrPWgId3ZA67dvjHQ6xrW491LK1xxx_sVJmFHg,9160
87
87
  unique_toolkit/agentic/tools/utils/source_handling/tests/test_source_formatting.py,sha256=EA8iVvb3L91OFk2XMbGcFuhe2etqm3Sx9QCYDGiOSOM,6995
88
88
  unique_toolkit/app/__init__.py,sha256=ETxYDpEizg_PKmi4JPX_P76ySq-us-xypfAIdKQ1QZU,1284
89
- unique_toolkit/app/dev_util.py,sha256=5tkGEcjHZ1u4kY0yUOhTWLjhXLvAcEMutY3h8j1bBJE,5312
89
+ unique_toolkit/app/dev_util.py,sha256=J20peCvrSQKfMGdYPYwCirs3Yq2v_e33GzNBzNKbWN4,5531
90
90
  unique_toolkit/app/init_logging.py,sha256=Sh26SRxOj8i8dzobKhYha2lLrkrMTHfB1V4jR3h23gQ,678
91
91
  unique_toolkit/app/init_sdk.py,sha256=5_oDoETr6akwYyBCb0ivTdMNu3SVgPSkrXcDS6ELyY8,2269
92
92
  unique_toolkit/app/performance/async_tasks.py,sha256=H0l3OAcosLwNHZ8d2pd-Di4wHIXfclEvagi5kfqLFPA,1941
93
93
  unique_toolkit/app/performance/async_wrapper.py,sha256=yVVcRDkcdyfjsxro-N29SBvi-7773wnfDplef6-y8xw,1077
94
- unique_toolkit/app/schemas.py,sha256=UE1UaL_N2o48O-mLb_rF3Sp9MrVkfdDE6f_dm7WTOO4,9137
94
+ unique_toolkit/app/schemas.py,sha256=wbfYGl5PjMBG25IEPzeygObBJIxP5CfXpBWS-4NWZJs,9830
95
95
  unique_toolkit/app/unique_settings.py,sha256=849pbASOu8QbHu9QfCJhYTisjKRet34J-fRs0gNKZ0Q,12369
96
96
  unique_toolkit/app/verification.py,sha256=GxFFwcJMy25fCA_Xe89wKW7bgqOu8PAs5y8QpHF0GSc,3861
97
97
  unique_toolkit/chat/__init__.py,sha256=LRs2G-JTVuci4lbtHTkVUiNcZcSR6uqqfnAyo7af6nY,619
@@ -138,7 +138,7 @@ unique_toolkit/short_term_memory/schemas.py,sha256=OhfcXyF6ACdwIXW45sKzjtZX_gkcJ
138
138
  unique_toolkit/short_term_memory/service.py,sha256=5PeVBu1ZCAfyDb2HLVvlmqSbyzBBuE9sI2o9Aajqjxg,8884
139
139
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
140
140
  unique_toolkit/smart_rules/compile.py,sha256=cxWjb2dxEI2HGsakKdVCkSNi7VK9mr08w5sDcFCQyWI,9553
141
- unique_toolkit-1.5.0.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
142
- unique_toolkit-1.5.0.dist-info/METADATA,sha256=521VJV6pIIEKtepXsgoCfdRj8QLH62E6tHz4js9cjVA,34392
143
- unique_toolkit-1.5.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
144
- unique_toolkit-1.5.0.dist-info/RECORD,,
141
+ unique_toolkit-1.5.1.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
142
+ unique_toolkit-1.5.1.dist-info/METADATA,sha256=1jL7EK6jc2i-l7G1fRUBjmFTxsrp_I43P3d6Yx_zF0w,34514
143
+ unique_toolkit-1.5.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
144
+ unique_toolkit-1.5.1.dist-info/RECORD,,