unique_toolkit 0.7.0__tar.gz → 0.7.1__tar.gz

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.
Files changed (65) hide show
  1. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/CHANGELOG.md +4 -1
  2. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/PKG-INFO +5 -2
  3. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/pyproject.toml +1 -1
  4. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/content/service.py +36 -17
  5. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/LICENSE +0 -0
  6. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/README.md +0 -0
  7. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/__init__.py +0 -0
  8. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/_common/_base_service.py +0 -0
  9. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/_common/_time_utils.py +0 -0
  10. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/_common/exception.py +0 -0
  11. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/_common/validate_required_values.py +0 -0
  12. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/_common/validators.py +0 -0
  13. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/app/__init__.py +0 -0
  14. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/app/init_logging.py +0 -0
  15. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/app/init_sdk.py +0 -0
  16. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/app/performance/async_tasks.py +0 -0
  17. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/app/performance/async_wrapper.py +0 -0
  18. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/app/schemas.py +0 -0
  19. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/app/verification.py +0 -0
  20. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/chat/__init__.py +0 -0
  21. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/chat/constants.py +0 -0
  22. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/chat/functions.py +0 -0
  23. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/chat/schemas.py +0 -0
  24. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/chat/service.py +0 -0
  25. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/chat/state.py +0 -0
  26. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/chat/utils.py +0 -0
  27. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/content/__init__.py +0 -0
  28. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/content/constants.py +0 -0
  29. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/content/functions.py +0 -0
  30. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/content/schemas.py +0 -0
  31. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/content/utils.py +0 -0
  32. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/embedding/__init__.py +0 -0
  33. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/embedding/constants.py +0 -0
  34. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/embedding/functions.py +0 -0
  35. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/embedding/schemas.py +0 -0
  36. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/embedding/service.py +0 -0
  37. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/embedding/utils.py +0 -0
  38. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/__init__.py +0 -0
  39. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/config.py +0 -0
  40. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/constants.py +0 -0
  41. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/context_relevancy/constants.py +0 -0
  42. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/context_relevancy/prompts.py +0 -0
  43. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/context_relevancy/service.py +0 -0
  44. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/context_relevancy/utils.py +0 -0
  45. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/exception.py +0 -0
  46. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/hallucination/constants.py +0 -0
  47. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/hallucination/prompts.py +0 -0
  48. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/hallucination/service.py +0 -0
  49. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/hallucination/utils.py +0 -0
  50. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/output_parser.py +0 -0
  51. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/evaluators/schemas.py +0 -0
  52. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/__init__.py +0 -0
  53. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/builder.py +0 -0
  54. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/constants.py +0 -0
  55. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/functions.py +0 -0
  56. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/infos.py +0 -0
  57. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/prompt.py +0 -0
  58. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/schemas.py +0 -0
  59. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/service.py +0 -0
  60. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/language_model/utils.py +0 -0
  61. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/short_term_memory/__init__.py +0 -0
  62. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/short_term_memory/constants.py +0 -0
  63. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/short_term_memory/functions.py +0 -0
  64. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/short_term_memory/schemas.py +0 -0
  65. {unique_toolkit-0.7.0 → unique_toolkit-0.7.1}/unique_toolkit/short_term_memory/service.py +0 -0
@@ -5,9 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.1] - 2025-03-11
9
+ - Fix Breaking change: `ContentService.search_content_chunks` `ContentService.search_content_chunks` now accepts`chat_id` for the specific to handle chat_only instances
10
+
8
11
  ## [0.7.0] - 2025-03-11
9
12
  - Fix the issue with `ShortTermMemoryService.create_memory_async` adding `self.chat_id` and `self.message_id` as part of the parameter.
10
- - Breaking chang: `ContentService.search_content_on_chat` now requires you pass in a `chat_id` for the specific chat instance
13
+ - Breaking change: `ContentService.search_content_on_chat` now requires you pass in a `chat_id` for the specific chat instance
11
14
 
12
15
  ## [0.6.9] - 2025-03-11
13
16
  - Add o1-preview as part of the language model info, make the name consistent across board.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -111,9 +111,12 @@ All notable changes to this project will be documented in this file.
111
111
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
112
112
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
113
113
 
114
+ ## [0.7.1] - 2025-03-11
115
+ - Fix Breaking change: `ContentService.search_content_chunks` `ContentService.search_content_chunks` now accepts`chat_id` for the specific to handle chat_only instances
116
+
114
117
  ## [0.7.0] - 2025-03-11
115
118
  - Fix the issue with `ShortTermMemoryService.create_memory_async` adding `self.chat_id` and `self.message_id` as part of the parameter.
116
- - Breaking chang: `ContentService.search_content_on_chat` now requires you pass in a `chat_id` for the specific chat instance
119
+ - Breaking change: `ContentService.search_content_on_chat` now requires you pass in a `chat_id` for the specific chat instance
117
120
 
118
121
  ## [0.6.9] - 2025-03-11
119
122
  - Add o1-preview as part of the language model info, make the name consistent across board.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_toolkit"
3
- version = "0.7.0"
3
+ version = "0.7.1"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -35,9 +35,10 @@ class ContentService:
35
35
  Provides methods for searching, downloading and uploading content in the knowledge base.
36
36
 
37
37
  Attributes:
38
- company_id (str | None): The company ID.
39
- user_id (str | None): The user ID.
40
- metadata_filter (dict | None): The metadata filter.
38
+ event: BaseEvent | Event, this can be None ONLY if company_id and user_id are provided.
39
+ company_id (str): The company ID.
40
+ user_id (str): The user ID.
41
+ metadata_filter (dict | None): is only initialised from an Event(Deprecated) or ChatEvent.
41
42
  """
42
43
 
43
44
  def __init__(
@@ -77,6 +78,7 @@ class ContentService:
77
78
  search_type: ContentSearchType,
78
79
  limit: int,
79
80
  search_language: str = DEFAULT_SEARCH_LANGUAGE,
81
+ chat_id: str = "",
80
82
  reranker_config: ContentRerankerConfig | None = None,
81
83
  scope_ids: list[str] | None = None,
82
84
  chat_only: bool | None = None,
@@ -90,24 +92,32 @@ class ContentService:
90
92
  search_string (str): The search string.
91
93
  search_type (ContentSearchType): The type of search to perform.
92
94
  limit (int): The maximum number of results to return.
93
- search_language (str): The language for the full-text search. Defaults to "english".
94
- reranker_config (ContentRerankerConfig | None): The reranker configuration. Defaults to None.
95
- scope_ids (list[str] | None): The scope IDs. Defaults to None.
96
- chat_only (bool | None): Whether to search only in the current chat. Defaults to None.
97
- metadata_filter (dict | None): UniqueQL metadata filter. If unspecified/None, it tries to use the metadata filter from the event. Defaults to None.
98
- content_ids (list[str] | None): The content IDs to search. Defaults to None.
95
+ search_language (str, optional): The language for the full-text search. Defaults to "english".
96
+ chat_id (str, optional): The chat ID for context. Defaults to empty string.
97
+ reranker_config (ContentRerankerConfig | None, optional): The reranker configuration. Defaults to None.
98
+ scope_ids (list[str] | None, optional): The scope IDs to filter by. Defaults to None.
99
+ chat_only (bool | None, optional): Whether to search only in the current chat. Defaults to None.
100
+ metadata_filter (dict | None, optional): UniqueQL metadata filter. If unspecified/None, it tries to use the metadata filter from the event. Defaults to None.
101
+ content_ids (list[str] | None, optional): The content IDs to search within. Defaults to None.
102
+
99
103
  Returns:
100
104
  list[ContentChunk]: The search results.
105
+
106
+ Raises:
107
+ Exception: If there's an error during the search operation.
101
108
  """
102
109
 
103
110
  if metadata_filter is None:
104
111
  metadata_filter = self.metadata_filter
105
112
 
113
+ if chat_only and not chat_id:
114
+ raise ValueError("Please provide chat_id when limiting with chat_only")
115
+
106
116
  try:
107
117
  searches = search_content_chunks(
108
118
  user_id=self.user_id,
109
119
  company_id=self.company_id,
110
- chat_id="",
120
+ chat_id=chat_id,
111
121
  search_string=search_string,
112
122
  search_type=search_type,
113
123
  limit=limit,
@@ -129,6 +139,7 @@ class ContentService:
129
139
  search_type: ContentSearchType,
130
140
  limit: int,
131
141
  search_language: str = DEFAULT_SEARCH_LANGUAGE,
142
+ chat_id: str = "",
132
143
  reranker_config: ContentRerankerConfig | None = None,
133
144
  scope_ids: list[str] | None = None,
134
145
  chat_only: bool | None = None,
@@ -142,23 +153,31 @@ class ContentService:
142
153
  search_string (str): The search string.
143
154
  search_type (ContentSearchType): The type of search to perform.
144
155
  limit (int): The maximum number of results to return.
145
- search_language (str): The language for the full-text search. Defaults to "english".
146
- reranker_config (ContentRerankerConfig | None): The reranker configuration. Defaults to None.
147
- scope_ids (list[str] | None): The scope IDs. Defaults to None.
148
- chat_only (bool | None): Whether to search only in the current chat. Defaults to None.
149
- metadata_filter (dict | None): UniqueQL metadata filter. If unspecified/None, it tries to use the metadata filter from the event. Defaults to None.
150
- content_ids (list[str] | None): The content IDs to search. Defaults to None.
156
+ search_language (str, optional): The language for the full-text search. Defaults to "english".
157
+ chat_id (str, optional): The chat ID for context. Defaults to empty string.
158
+ reranker_config (ContentRerankerConfig | None, optional): The reranker configuration. Defaults to None.
159
+ scope_ids (list[str] | None, optional): The scope IDs to filter by. Defaults to None.
160
+ chat_only (bool | None, optional): Whether to search only in the current chat. Defaults to None.
161
+ metadata_filter (dict | None, optional): UniqueQL metadata filter. If unspecified/None, it tries to use the metadata filter from the event. Defaults to None.
162
+ content_ids (list[str] | None, optional): The content IDs to search within. Defaults to None.
163
+
151
164
  Returns:
152
165
  list[ContentChunk]: The search results.
166
+
167
+ Raises:
168
+ Exception: If there's an error during the search operation.
153
169
  """
154
170
  if metadata_filter is None:
155
171
  metadata_filter = self.metadata_filter
156
172
 
173
+ if chat_only and not chat_id:
174
+ raise ValueError("Please provide chat_id when limiting with chat_only.")
175
+
157
176
  try:
158
177
  searches = await search_content_chunks_async(
159
178
  user_id=self.user_id,
160
179
  company_id=self.company_id,
161
- chat_id="",
180
+ chat_id=chat_id,
162
181
  search_string=search_string,
163
182
  search_type=search_type,
164
183
  limit=limit,
File without changes
File without changes