unique_toolkit 0.6.9__py3-none-any.whl → 0.7.0__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.
@@ -130,7 +130,6 @@ async def search_content_chunks_async(
130
130
  def search_contents(
131
131
  user_id: str,
132
132
  company_id: str,
133
- chat_id: str,
134
133
  where: dict,
135
134
  ):
136
135
  """
@@ -152,7 +151,6 @@ def search_contents(
152
151
  contents = unique_sdk.Content.search(
153
152
  user_id=user_id,
154
153
  company_id=company_id,
155
- chatId=chat_id,
156
154
  # TODO add type parameter in SDK
157
155
  where=where, # type: ignore
158
156
  )
@@ -165,7 +163,6 @@ def search_contents(
165
163
  async def search_contents_async(
166
164
  user_id: str,
167
165
  company_id: str,
168
- chat_id: str,
169
166
  where: dict,
170
167
  ):
171
168
  """Asynchronously searches for content in the knowledge base."""
@@ -176,7 +173,6 @@ async def search_contents_async(
176
173
  contents = await unique_sdk.Content.search_async(
177
174
  user_id=user_id,
178
175
  company_id=company_id,
179
- chatId=chat_id,
180
176
  where=where, # type: ignore
181
177
  )
182
178
  return map_contents(contents)
@@ -38,7 +38,6 @@ class ContentService:
38
38
  company_id (str | None): The company ID.
39
39
  user_id (str | None): The user ID.
40
40
  metadata_filter (dict | None): The metadata filter.
41
- chat_id (str | None): The chat ID.
42
41
  """
43
42
 
44
43
  def __init__(
@@ -48,17 +47,16 @@ class ContentService:
48
47
  user_id: str | None = None,
49
48
  ):
50
49
  self._event = event # Changed to protected attribute
50
+ self.metadata_filter = None
51
51
  if event:
52
52
  self.company_id = event.company_id
53
53
  self.user_id = event.user_id
54
54
  if isinstance(event, (ChatEvent, Event)):
55
55
  self.metadata_filter = event.payload.metadata_filter
56
- self.chat_id = event.payload.chat_id
57
56
  else:
58
57
  [company_id, user_id] = validate_required_values([company_id, user_id])
59
58
  self.company_id = company_id
60
59
  self.user_id = user_id
61
- self.metadata_filter = None
62
60
 
63
61
  @property
64
62
  @deprecated(
@@ -109,7 +107,7 @@ class ContentService:
109
107
  searches = search_content_chunks(
110
108
  user_id=self.user_id,
111
109
  company_id=self.company_id,
112
- chat_id=self.chat_id,
110
+ chat_id="",
113
111
  search_string=search_string,
114
112
  search_type=search_type,
115
113
  limit=limit,
@@ -160,7 +158,7 @@ class ContentService:
160
158
  searches = await search_content_chunks_async(
161
159
  user_id=self.user_id,
162
160
  company_id=self.company_id,
163
- chat_id=self.chat_id,
161
+ chat_id="",
164
162
  search_string=search_string,
165
163
  search_type=search_type,
166
164
  limit=limit,
@@ -193,7 +191,6 @@ class ContentService:
193
191
  return search_contents(
194
192
  user_id=self.user_id,
195
193
  company_id=self.company_id,
196
- chat_id=self.chat_id,
197
194
  where=where,
198
195
  )
199
196
 
@@ -213,14 +210,11 @@ class ContentService:
213
210
  return await search_contents_async(
214
211
  user_id=self.user_id,
215
212
  company_id=self.company_id,
216
- chat_id=self.chat_id,
217
213
  where=where,
218
214
  )
219
215
 
220
- def search_content_on_chat(
221
- self,
222
- ) -> list[Content]:
223
- where = {"ownerId": {"equals": self.chat_id}}
216
+ def search_content_on_chat(self, chat_id: str) -> list[Content]:
217
+ where = {"ownerId": {"equals": chat_id}}
224
218
 
225
219
  return self.search_contents(where)
226
220
 
@@ -136,6 +136,8 @@ class ShortTermMemoryService:
136
136
  company_id=self.company_id,
137
137
  key=key,
138
138
  value=value,
139
+ chat_id=self.chat_id,
140
+ message_id=self.message_id,
139
141
  )
140
142
 
141
143
  def create_memory(self, key: str, value: str | dict):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.6.9
3
+ Version: 0.7.0
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -111,6 +111,10 @@ 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.0] - 2025-03-11
115
+ - 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
117
+
114
118
  ## [0.6.9] - 2025-03-11
115
119
  - Add o1-preview as part of the language model info, make the name consistent across board.
116
120
 
@@ -20,9 +20,9 @@ unique_toolkit/chat/state.py,sha256=Cjgwv_2vhDFbV69xxsn7SefhaoIAEqLx3ferdVFCnOg,
20
20
  unique_toolkit/chat/utils.py,sha256=ihm-wQykBWhB4liR3LnwPVPt_qGW6ETq21Mw4HY0THE,854
21
21
  unique_toolkit/content/__init__.py,sha256=EdJg_A_7loEtCQf4cah3QARQreJx6pdz89Rm96YbMVg,940
22
22
  unique_toolkit/content/constants.py,sha256=1iy4Y67xobl5VTnJB6SxSyuoBWbdLl9244xfVMUZi5o,60
23
- unique_toolkit/content/functions.py,sha256=yB87wrbtmHzr3jGJUHetmuhy-7RVtnqG2IQ6gqFAun8,17093
23
+ unique_toolkit/content/functions.py,sha256=iuclQjuiupIJPk0-6ldl35EVkQ2h34_dxKxWisMrxWM,17001
24
24
  unique_toolkit/content/schemas.py,sha256=zks_Pkki2VhxICJJgHZyc-LPmRuj5dLbw3pgcUT7SW8,2362
25
- unique_toolkit/content/service.py,sha256=CyQNW3TJX4trMnQhm5Ec2XGE9GHIW_NSGGT7YuOZIHQ,14234
25
+ unique_toolkit/content/service.py,sha256=xcFN-vUakuovuzMXMN8qOmdlUzt2f1ZwHE4RzOWYjnQ,14040
26
26
  unique_toolkit/content/utils.py,sha256=GUVPrkZfMoAj4MRoBs5BD_7vSuLZTZx69hyWzYFrI50,7747
27
27
  unique_toolkit/embedding/__init__.py,sha256=uUyzjonPvuDCYsvXCIt7ErQXopLggpzX-MEQd3_e2kE,250
28
28
  unique_toolkit/embedding/constants.py,sha256=Lj8-Lcy1FvuC31PM9Exq7vaFuxQV4pEI1huUMFX-J2M,52
@@ -57,8 +57,8 @@ unique_toolkit/short_term_memory/__init__.py,sha256=2mI3AUrffgH7Yt-xS57EGqnHf7jn
57
57
  unique_toolkit/short_term_memory/constants.py,sha256=698CL6-wjup2MvU19RxSmQk3gX7aqW_OOpZB7sbz_Xg,34
58
58
  unique_toolkit/short_term_memory/functions.py,sha256=3WiK-xatY5nh4Dr5zlDUye1k3E6kr41RiscwtTplw5k,4484
59
59
  unique_toolkit/short_term_memory/schemas.py,sha256=OhfcXyF6ACdwIXW45sKzjtZX_gkcJs8FEZXcgQTNenw,1406
60
- unique_toolkit/short_term_memory/service.py,sha256=gdsVzoNqTXmLoBR_-p_lJlZDBo8L7Cr5EKchTNVJg1Q,5233
61
- unique_toolkit-0.6.9.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
62
- unique_toolkit-0.6.9.dist-info/METADATA,sha256=x6rRwyHVnMSaaQ2uzBaVrRua8gr234_exrWDG0ybbQY,20274
63
- unique_toolkit-0.6.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
64
- unique_toolkit-0.6.9.dist-info/RECORD,,
60
+ unique_toolkit/short_term_memory/service.py,sha256=0wrwuo6K17Edcuiwp5LMCvxFuBSDP82HF0_5qwi0nYc,5307
61
+ unique_toolkit-0.7.0.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
62
+ unique_toolkit-0.7.0.dist-info/METADATA,sha256=jDT49L28AksCEFj_0CXSyHJKg5Q2IWGXqNYLr0ninHY,20561
63
+ unique_toolkit-0.7.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
64
+ unique_toolkit-0.7.0.dist-info/RECORD,,