unique_toolkit 0.7.17__py3-none-any.whl → 0.7.19__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.
@@ -214,6 +214,7 @@ def upload_content_from_bytes(
214
214
  chat_id: str | None = None,
215
215
  skip_ingestion: bool = False,
216
216
  ingestion_config: unique_sdk.Content.IngestionConfig | None = None,
217
+ metadata: dict[str, any] | None = None,
217
218
  ):
218
219
  """
219
220
  Uploads content to the knowledge base.
@@ -227,6 +228,8 @@ def upload_content_from_bytes(
227
228
  scope_id (str | None): The scope ID. Defaults to None.
228
229
  chat_id (str | None): The chat ID. Defaults to None.
229
230
  skip_ingestion (bool): Whether to skip ingestion. Defaults to False.
231
+ ingestion_config (unique_sdk.Content.IngestionConfig | None): The ingestion configuration. Defaults to None.
232
+ metadata ( dict[str, any] | None): The metadata for the content. Defaults to None.
230
233
 
231
234
  Returns:
232
235
  Content: The uploaded content.
@@ -243,6 +246,7 @@ def upload_content_from_bytes(
243
246
  chat_id=chat_id,
244
247
  skip_ingestion=skip_ingestion,
245
248
  ingestion_config=ingestion_config,
249
+ metadata=metadata,
246
250
  )
247
251
  except Exception as e:
248
252
  logger.error(f"Error while uploading content: {e}")
@@ -259,6 +263,7 @@ def upload_content(
259
263
  chat_id: str | None = None,
260
264
  skip_ingestion: bool = False,
261
265
  ingestion_config: unique_sdk.Content.IngestionConfig | None = None,
266
+ metadata: dict[str, any] | None = None,
262
267
  ):
263
268
  """
264
269
  Uploads content to the knowledge base.
@@ -272,6 +277,8 @@ def upload_content(
272
277
  scope_id (str | None): The scope ID. Defaults to None.
273
278
  chat_id (str | None): The chat ID. Defaults to None.
274
279
  skip_ingestion (bool): Whether to skip ingestion. Defaults to False.
280
+ ingestion_config (unique_sdk.Content.IngestionConfig | None): The ingestion configuration. Defaults to None.
281
+ metadata ( dict[str, any] | None): The metadata for the content. Defaults to None.
275
282
 
276
283
  Returns:
277
284
  Content: The uploaded content.
@@ -288,6 +295,7 @@ def upload_content(
288
295
  chat_id=chat_id,
289
296
  skip_ingestion=skip_ingestion,
290
297
  ingestion_config=ingestion_config,
298
+ metadata=metadata,
291
299
  )
292
300
  except Exception as e:
293
301
  logger.error(f"Error while uploading content: {e}")
@@ -304,6 +312,7 @@ def _trigger_upload_content(
304
312
  chat_id: str | None = None,
305
313
  skip_ingestion: bool = False,
306
314
  ingestion_config: unique_sdk.Content.IngestionConfig | None = None,
315
+ metadata: dict[str, any] | None = None,
307
316
  ):
308
317
  """
309
318
  Uploads content to the knowledge base.
@@ -317,6 +326,8 @@ def _trigger_upload_content(
317
326
  scope_id (str | None): The scope ID. Defaults to None.
318
327
  chat_id (str | None): The chat ID. Defaults to None.
319
328
  skip_ingestion (bool): Whether to skip ingestion. Defaults to False.
329
+ ingestion_config (unique_sdk.Content.IngestionConfig | None): The ingestion configuration. Defaults to None.
330
+ metadata (dict[str, any] | None): The metadata for the content. Defaults to None.
320
331
 
321
332
  Returns:
322
333
  Content: The uploaded content.
@@ -385,6 +396,7 @@ def _trigger_upload_content(
385
396
  "mimeType": mime_type,
386
397
  "byteSize": byte_size,
387
398
  "ingestionConfig": ingestion_config,
399
+ "metadata": metadata,
388
400
  }
389
401
 
390
402
  if chat_id:
@@ -54,6 +54,8 @@ class Content(BaseModel):
54
54
  read_url: str | None = None
55
55
  created_at: datetime | None = None
56
56
  updated_at: datetime | None = None
57
+ metadata: dict[str, any] | None = None
58
+ ingestion_config: dict | None = None
57
59
 
58
60
 
59
61
  class ContentReference(BaseModel):
@@ -367,6 +367,7 @@ class ContentService:
367
367
  chat_id: str | None = None,
368
368
  skip_ingestion: bool = False,
369
369
  ingestion_config: unique_sdk.Content.IngestionConfig | None = None,
370
+ metadata: dict | None = None,
370
371
  ) -> Content:
371
372
  """
372
373
  Uploads content to the knowledge base.
@@ -378,6 +379,8 @@ class ContentService:
378
379
  scope_id (str | None): The scope ID. Defaults to None.
379
380
  chat_id (str | None): The chat ID. Defaults to None.
380
381
  skip_ingestion (bool): Whether to skip ingestion. Defaults to False.
382
+ ingestion_config (unique_sdk.Content.IngestionConfig | None): The ingestion configuration. Defaults to None.
383
+ metadata (dict | None): The metadata to associate with the content. Defaults to None.
381
384
 
382
385
  Returns:
383
386
  Content: The uploaded content.
@@ -393,6 +396,7 @@ class ContentService:
393
396
  chat_id=chat_id,
394
397
  skip_ingestion=skip_ingestion,
395
398
  ingestion_config=ingestion_config,
399
+ metadata=metadata,
396
400
  )
397
401
 
398
402
  def upload_content(
@@ -404,6 +408,7 @@ class ContentService:
404
408
  chat_id: str | None = None,
405
409
  skip_ingestion: bool = False,
406
410
  ingestion_config: unique_sdk.Content.IngestionConfig | None = None,
411
+ metadata: dict[str, any] | None = None,
407
412
  ):
408
413
  """
409
414
  Uploads content to the knowledge base.
@@ -415,6 +420,8 @@ class ContentService:
415
420
  scope_id (str | None): The scope ID. Defaults to None.
416
421
  chat_id (str | None): The chat ID. Defaults to None.
417
422
  skip_ingestion (bool): Whether to skip ingestion. Defaults to False.
423
+ ingestion_config (unique_sdk.Content.IngestionConfig | None): The ingestion configuration. Defaults to None.
424
+ metadata (dict[str, any] | None): The metadata to associate with the content. Defaults to None.
418
425
 
419
426
  Returns:
420
427
  Content: The uploaded content.
@@ -430,6 +437,7 @@ class ContentService:
430
437
  chat_id=chat_id,
431
438
  skip_ingestion=skip_ingestion,
432
439
  ingestion_config=ingestion_config,
440
+ metadata=metadata,
433
441
  )
434
442
 
435
443
  def request_content_by_id(
@@ -17,6 +17,10 @@ class MessagesBuilder:
17
17
  def __init__(self):
18
18
  self.messages: list[LanguageModelMessage] = []
19
19
 
20
+ def append(self, message: LanguageModelMessage) -> Self:
21
+ self.messages.append(message)
22
+ return self
23
+
20
24
  def message_append(self, role: LanguageModelMessageRole, content: str):
21
25
  message = LanguageModelMessage(role=role, content=content)
22
26
  self.messages.append(message)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.7.17
3
+ Version: 0.7.19
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -17,7 +17,7 @@ Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
17
17
  Requires-Dist: regex (>=2024.5.15,<2025.0.0)
18
18
  Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
19
19
  Requires-Dist: typing-extensions (>=4.9.0,<5.0.0)
20
- Requires-Dist: unique-sdk (>=0.9.26,<0.10.0)
20
+ Requires-Dist: unique-sdk (>=0.9.27,<0.10.0)
21
21
  Description-Content-Type: text/markdown
22
22
 
23
23
  # Unique Toolkit
@@ -111,6 +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.19] - 2025-05-20
115
+ - Extend the `MessageBuilder` to allow for appending any `LanguageModelMessage`
116
+
117
+ ## [0.7.18] - 2025-05-20
118
+ - Add the possibility to specify metadata when creating or updating a Content.
119
+
114
120
  ## [0.7.17] - 2025-05-16
115
121
  - Change inheritance hierarchy of events for easier deprecation
116
122
 
@@ -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=imNINvUW_-ejPBT8yPKuL9THdDplfjeKvnK9_EuFlqk,17497
24
- unique_toolkit/content/schemas.py,sha256=zks_Pkki2VhxICJJgHZyc-LPmRuj5dLbw3pgcUT7SW8,2362
25
- unique_toolkit/content/service.py,sha256=JDqlCJc-z-VQOmEvCIA8VcWSNOSuVo3lFetJs257H7A,18842
23
+ unique_toolkit/content/functions.py,sha256=Chf2QcnnWvKvXMF4IUmU-_aUN6nTZIfsbM7ds77olcY,18344
24
+ unique_toolkit/content/schemas.py,sha256=28Cj0R9JzJ4s0qR2Sfunr7luwYjMF2I8TepVxt5ZE2o,2446
25
+ unique_toolkit/content/service.py,sha256=27awBOsYHdfSxwHM1UzCQLnHuo-M49ej3jpFwBLRflM,19438
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
@@ -45,7 +45,7 @@ unique_toolkit/evaluators/hallucination/utils.py,sha256=gO2AOzDQwVTev2_5vDKgJ9A6
45
45
  unique_toolkit/evaluators/output_parser.py,sha256=eI72qkzK1dZyUvnfP2SOAQCGBj_-PwX5wy_aLPMsJMY,883
46
46
  unique_toolkit/evaluators/schemas.py,sha256=Jaue6Uhx75X1CyHKWj8sT3RE1JZXTqoLtfLt2xQNCX8,2507
47
47
  unique_toolkit/language_model/__init__.py,sha256=jWko_vQj48wjnpTtlkg8iNdef0SMI3FN2kGywXRTMzg,1880
48
- unique_toolkit/language_model/builder.py,sha256=aIAXWWUoB5G-HONJiAt3MdRGd4jdP8nA-HYX2D2WlSI,3048
48
+ unique_toolkit/language_model/builder.py,sha256=69WCcmkm2rMP2-YEH_EjHiEp6OzwjwCs8VbhjVJaCe0,3168
49
49
  unique_toolkit/language_model/constants.py,sha256=B-topqW0r83dkC_25DeQfnPk3n53qzIHUCBS7YJ0-1U,119
50
50
  unique_toolkit/language_model/functions.py,sha256=0oSkG4xpbxeaVTJide6g-zunBrsBRuvp7UQlKVbjpSk,7949
51
51
  unique_toolkit/language_model/infos.py,sha256=qPf4Xlanet8jf0apZ6-qxS_6zmDd6p9D40it2TqmF3w,25910
@@ -59,7 +59,7 @@ unique_toolkit/short_term_memory/constants.py,sha256=698CL6-wjup2MvU19RxSmQk3gX7
59
59
  unique_toolkit/short_term_memory/functions.py,sha256=3WiK-xatY5nh4Dr5zlDUye1k3E6kr41RiscwtTplw5k,4484
60
60
  unique_toolkit/short_term_memory/schemas.py,sha256=OhfcXyF6ACdwIXW45sKzjtZX_gkcJs8FEZXcgQTNenw,1406
61
61
  unique_toolkit/short_term_memory/service.py,sha256=vEKFxP1SScPrFniso492fVthWR1sosdFibhiNF3zRvI,8081
62
- unique_toolkit-0.7.17.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
63
- unique_toolkit-0.7.17.dist-info/METADATA,sha256=1s2gtPKoW7K5BT6aAVwh96O-1K8-2d-uEXKXzaO2fLo,22573
64
- unique_toolkit-0.7.17.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
- unique_toolkit-0.7.17.dist-info/RECORD,,
62
+ unique_toolkit-0.7.19.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
63
+ unique_toolkit-0.7.19.dist-info/METADATA,sha256=7P27qJw5oRh6q1WUTcF-Qvik67x3u1H7dSJZVZhWInI,22784
64
+ unique_toolkit-0.7.19.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
+ unique_toolkit-0.7.19.dist-info/RECORD,,