unique_toolkit 1.17.2__py3-none-any.whl → 1.17.3__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.

Potentially problematic release.


This version of unique_toolkit might be problematic. Click here for more details.

@@ -20,6 +20,7 @@ from unique_toolkit.chat.schemas import (
20
20
  ChatMessageAssessmentStatus,
21
21
  ChatMessageAssessmentType,
22
22
  )
23
+ from unique_toolkit.language_model.reference import _preprocess_message
23
24
  from unique_toolkit.language_model.schemas import (
24
25
  LanguageModelStreamResponse,
25
26
  )
@@ -43,10 +44,15 @@ class HallucinationEvaluation(Evaluation):
43
44
  self, loop_response: LanguageModelStreamResponse
44
45
  ) -> EvaluationMetricResult: # type: ignore
45
46
  all_chunks = self._reference_manager.get_chunks()
47
+
46
48
  # source numbers from original text
47
- ref_pattern = r"\[source(\d+)\]"
49
+ ref_pattern = r"\[(\d+)\]"
48
50
  original_text = loop_response.message.original_text
49
- source_number_matches = re.findall(ref_pattern, original_text)
51
+
52
+ # preprocess original text to deal with different source patterns
53
+ original_text_preprocessed = _preprocess_message(original_text)
54
+
55
+ source_number_matches = re.findall(ref_pattern, original_text_preprocessed)
50
56
  source_numbers = {int(num) for num in source_number_matches}
51
57
 
52
58
  referenced_chunks = [all_chunks[idx] for idx in source_numbers]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 1.17.2
3
+ Version: 1.17.3
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.17.3] - 2025-10-27
123
+ - Update Hallucination check citation regex parsing pattern
124
+
121
125
  ## [1.17.2] - 2025-10-23
122
126
  - Adding model `AZURE_GPT_5_PRO_2025_1006` and `litellm:openai-gpt-5-pro` to `language_model/info.py`
123
127
 
@@ -35,7 +35,7 @@ unique_toolkit/agentic/evaluation/context_relevancy/service.py,sha256=2NM1_PCP6f
35
35
  unique_toolkit/agentic/evaluation/evaluation_manager.py,sha256=IPx4BVUgkjFOP1BGLi0BlB6UujpXlZ0KGuSXDRemQhY,8143
36
36
  unique_toolkit/agentic/evaluation/exception.py,sha256=7lcVbCyoN4Md1chNJDFxpUYyWbVrcr9dcc3TxWykJTc,115
37
37
  unique_toolkit/agentic/evaluation/hallucination/constants.py,sha256=SoGmoYti2J33tSmmOC1BSF6Pkh8DQvbQAU9xIZFQZRs,2070
38
- unique_toolkit/agentic/evaluation/hallucination/hallucination_evaluation.py,sha256=JPSBr9JvufeKpIyiscaWCUqpJB5E7Z8ftKUPdbdp6XE,3829
38
+ unique_toolkit/agentic/evaluation/hallucination/hallucination_evaluation.py,sha256=6ZLbQWW5vmI0btoSjgUhQT7pADNc_-dUDFlexD31drU,4057
39
39
  unique_toolkit/agentic/evaluation/hallucination/prompts.py,sha256=O3Hi_rOzZlujvnO2wn2jhoPmrYLjzVtRWwxn5Q81m9Y,3405
40
40
  unique_toolkit/agentic/evaluation/hallucination/service.py,sha256=Ut-f768HY4E9zEhfMoKYnGTFRZVkxWGiSTGOpgfZWYM,2447
41
41
  unique_toolkit/agentic/evaluation/hallucination/utils.py,sha256=QLsYvgAyQ5XnKEzn7ko7bXfzePD4De99TWnMKglMpds,8178
@@ -165,7 +165,7 @@ unique_toolkit/short_term_memory/service.py,sha256=5PeVBu1ZCAfyDb2HLVvlmqSbyzBBu
165
165
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
166
166
  unique_toolkit/smart_rules/compile.py,sha256=Ozhh70qCn2yOzRWr9d8WmJeTo7AQurwd3tStgBMPFLA,1246
167
167
  unique_toolkit/test_utilities/events.py,sha256=_mwV2bs5iLjxS1ynDCjaIq-gjjKhXYCK-iy3dRfvO3g,6410
168
- unique_toolkit-1.17.2.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
169
- unique_toolkit-1.17.2.dist-info/METADATA,sha256=ShingmdOLZ9_XiL8Em_kQMzCzN4__5eoqheYcF7-FNU,38148
170
- unique_toolkit-1.17.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
171
- unique_toolkit-1.17.2.dist-info/RECORD,,
168
+ unique_toolkit-1.17.3.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
169
+ unique_toolkit-1.17.3.dist-info/METADATA,sha256=WpWG0ZZEMzpUBMiEOmvdBoGE-q0mfGKX_2RkyQXxwW4,38235
170
+ unique_toolkit-1.17.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
171
+ unique_toolkit-1.17.3.dist-info/RECORD,,