unique_toolkit 0.8.2__py3-none-any.whl → 0.8.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.
@@ -34,6 +34,7 @@ def search_content_chunks(
34
34
  chat_only: bool | None = None,
35
35
  metadata_filter: dict | None = None,
36
36
  content_ids: list[str] | None = None,
37
+ score_threshold: float | None = None,
37
38
  ) -> list[ContentChunk]:
38
39
  """
39
40
  Performs a synchronous search for content chunks in the knowledge base.
@@ -48,6 +49,7 @@ def search_content_chunks(
48
49
  chat_only (bool | None): Whether to search only in the current chat. Defaults to None.
49
50
  metadata_filter (dict | None): UniqueQL metadata filter. If unspecified/None, it tries to use the metadata filter from the event. Defaults to None.
50
51
  content_ids (list[str] | None): The content IDs to search. Defaults to None.
52
+ score_threshold (float | None): The minimum score threshold for results. Defaults to 0.
51
53
  Returns:
52
54
  list[ContentChunk]: The search results.
53
55
  """
@@ -73,6 +75,7 @@ def search_content_chunks(
73
75
  chatOnly=chat_only,
74
76
  metaDataFilter=metadata_filter,
75
77
  contentIds=content_ids,
78
+ scoreThreshold=score_threshold,
76
79
  )
77
80
  return map_to_content_chunks(searches)
78
81
  except Exception as e:
@@ -93,6 +96,7 @@ async def search_content_chunks_async(
93
96
  chat_only: bool | None = None,
94
97
  metadata_filter: dict | None = None,
95
98
  content_ids: list[str] | None = None,
99
+ score_threshold: float | None = None,
96
100
  ):
97
101
  """
98
102
  Performs an asynchronous search for content chunks in the knowledge base.
@@ -121,6 +125,7 @@ async def search_content_chunks_async(
121
125
  chatOnly=chat_only,
122
126
  metaDataFilter=metadata_filter,
123
127
  contentIds=content_ids,
128
+ scoreThreshold=score_threshold,
124
129
  )
125
130
  return map_to_content_chunks(searches)
126
131
  except Exception as e:
@@ -236,6 +236,7 @@ class ContentService:
236
236
  chat_only: bool | None = None,
237
237
  metadata_filter: dict | None = None,
238
238
  content_ids: list[str] | None = None,
239
+ score_threshold: float | None = None,
239
240
  ) -> list[ContentChunk]:
240
241
  """
241
242
  Performs a synchronous search for content chunks in the knowledge base.
@@ -251,6 +252,7 @@ class ContentService:
251
252
  chat_only (bool | None, optional): Whether to search only in the current chat. Defaults to None.
252
253
  metadata_filter (dict | None, optional): UniqueQL metadata filter. If unspecified/None, it tries to use the metadata filter from the event. Defaults to None.
253
254
  content_ids (list[str] | None, optional): The content IDs to search within. Defaults to None.
255
+ score_threshold (float | None, optional): Sets the minimum similarity score for search results to be considered. Defaults to 0.
254
256
 
255
257
  Returns:
256
258
  list[ContentChunk]: The search results.
@@ -281,6 +283,7 @@ class ContentService:
281
283
  chat_only=chat_only,
282
284
  metadata_filter=metadata_filter,
283
285
  content_ids=content_ids,
286
+ score_threshold=score_threshold,
284
287
  )
285
288
  return searches
286
289
  except Exception as e:
@@ -299,6 +302,7 @@ class ContentService:
299
302
  chat_only: bool | None = None,
300
303
  metadata_filter: dict | None = None,
301
304
  content_ids: list[str] | None = None,
305
+ score_threshold: float | None = None,
302
306
  ):
303
307
  """
304
308
  Performs an asynchronous search for content chunks in the knowledge base.
@@ -314,6 +318,7 @@ class ContentService:
314
318
  chat_only (bool | None, optional): Whether to search only in the current chat. Defaults to None.
315
319
  metadata_filter (dict | None, optional): UniqueQL metadata filter. If unspecified/None, it tries to use the metadata filter from the event. Defaults to None.
316
320
  content_ids (list[str] | None, optional): The content IDs to search within. Defaults to None.
321
+ score_threshold (float | None, optional): Sets the minimum similarity score for search results to be considered. Defaults to 0.
317
322
 
318
323
  Returns:
319
324
  list[ContentChunk]: The search results.
@@ -343,6 +348,7 @@ class ContentService:
343
348
  chat_only=chat_only,
344
349
  metadata_filter=metadata_filter,
345
350
  content_ids=content_ids,
351
+ score_threshold=score_threshold,
346
352
  )
347
353
  return searches
348
354
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -113,6 +113,8 @@ All notable changes to this project will be documented in this file.
113
113
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
114
114
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
115
115
 
116
+ ## [0.8.3] - 2025-08-05
117
+ - Expose threshold field for search.
116
118
 
117
119
  ## [0.8.2] - 2025-08-05
118
120
  - Implement overloads for services for clearer dev experience
@@ -22,9 +22,9 @@ unique_toolkit/chat/state.py,sha256=Cjgwv_2vhDFbV69xxsn7SefhaoIAEqLx3ferdVFCnOg,
22
22
  unique_toolkit/chat/utils.py,sha256=ihm-wQykBWhB4liR3LnwPVPt_qGW6ETq21Mw4HY0THE,854
23
23
  unique_toolkit/content/__init__.py,sha256=EdJg_A_7loEtCQf4cah3QARQreJx6pdz89Rm96YbMVg,940
24
24
  unique_toolkit/content/constants.py,sha256=1iy4Y67xobl5VTnJB6SxSyuoBWbdLl9244xfVMUZi5o,60
25
- unique_toolkit/content/functions.py,sha256=0ELepm3_sl0SD_SYzvQVQ-jTdrcUqK5mVJZv0nQBuAw,18367
25
+ unique_toolkit/content/functions.py,sha256=HZtDIAH3ZxWleq5Si_v30n_7vTnNRu6BCxpTHb9TxdA,18635
26
26
  unique_toolkit/content/schemas.py,sha256=KJ604BOx0vBh2AwlTCZkOo55aHsI6yj8vxDAARKKqEo,2995
27
- unique_toolkit/content/service.py,sha256=9Re_UK7pkv-zNROlKRmfoomfhUQcuzFQvQ05aUl8q6Y,20502
27
+ unique_toolkit/content/service.py,sha256=GA4KHNmppp2L2TRKbFUI1grYUJbuNscfoVBYTPilY7s,20972
28
28
  unique_toolkit/content/utils.py,sha256=qNVmHTuETaPNGqheg7TbgPr1_1jbNHDc09N5RrmUIyo,7901
29
29
  unique_toolkit/embedding/__init__.py,sha256=uUyzjonPvuDCYsvXCIt7ErQXopLggpzX-MEQd3_e2kE,250
30
30
  unique_toolkit/embedding/constants.py,sha256=Lj8-Lcy1FvuC31PM9Exq7vaFuxQV4pEI1huUMFX-J2M,52
@@ -73,7 +73,7 @@ unique_toolkit/tools/tool_definitions.py,sha256=YYu53vXMJBeJtuSU1L_FJBsiN52LSA5L
73
73
  unique_toolkit/tools/tool_definitionsV2.py,sha256=yjLmP85pFGd1QtIVMC3oLQPSQ2NckBj9hIihjIr2FZg,5728
74
74
  unique_toolkit/tools/tool_factory.py,sha256=ux11jd7Oobb-6eBeS51T-tviH14k6HKqsKmljA7h6qA,879
75
75
  unique_toolkit/tools/tool_progress_reporter.py,sha256=AyPdgxpd48qotJyPB8qJ7h7ghiv2w2EK8nlyqQVFRt4,8048
76
- unique_toolkit-0.8.2.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
77
- unique_toolkit-0.8.2.dist-info/METADATA,sha256=nfNsDNjxM9xxW1FdMV3UVLEIXry-6kQU5Uu7RGUPrsc,26025
78
- unique_toolkit-0.8.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
79
- unique_toolkit-0.8.2.dist-info/RECORD,,
76
+ unique_toolkit-0.8.3.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
77
+ unique_toolkit-0.8.3.dist-info/METADATA,sha256=UEfARrL_5zaX43AazPC7fxsW53RVJO0lwJAOlzc3hUQ,26086
78
+ unique_toolkit-0.8.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
79
+ unique_toolkit-0.8.3.dist-info/RECORD,,