unique_toolkit 0.5.32__tar.gz → 0.5.35__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 (47) hide show
  1. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/CHANGELOG.md +9 -0
  2. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/PKG-INFO +10 -1
  3. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/pyproject.toml +1 -1
  4. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/app/schemas.py +1 -0
  5. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/content/service.py +15 -12
  6. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/language_model/schemas.py +5 -0
  7. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/LICENSE +0 -0
  8. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/README.md +0 -0
  9. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/__init__.py +0 -0
  10. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/_common/_base_service.py +0 -0
  11. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/_common/_time_utils.py +0 -0
  12. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/_common/exception.py +0 -0
  13. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/_common/validators.py +0 -0
  14. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/app/__init__.py +0 -0
  15. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/app/init_logging.py +0 -0
  16. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/app/init_sdk.py +0 -0
  17. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/app/performance/async_tasks.py +0 -0
  18. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/app/performance/async_wrapper.py +0 -0
  19. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/app/verification.py +0 -0
  20. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/chat/__init__.py +0 -0
  21. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/chat/schemas.py +0 -0
  22. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/chat/service.py +0 -0
  23. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/chat/state.py +0 -0
  24. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/chat/utils.py +0 -0
  25. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/content/__init__.py +0 -0
  26. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/content/schemas.py +0 -0
  27. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/content/utils.py +0 -0
  28. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/embedding/__init__.py +0 -0
  29. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/embedding/schemas.py +0 -0
  30. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/embedding/service.py +0 -0
  31. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/embedding/utils.py +0 -0
  32. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/config.py +0 -0
  33. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/context_relevancy/constants.py +0 -0
  34. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/context_relevancy/prompts.py +0 -0
  35. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/context_relevancy/service.py +0 -0
  36. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/context_relevancy/utils.py +0 -0
  37. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/exception.py +0 -0
  38. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/hallucination/constants.py +0 -0
  39. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/hallucination/prompts.py +0 -0
  40. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/hallucination/service.py +0 -0
  41. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/hallucination/utils.py +0 -0
  42. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/output_parser.py +0 -0
  43. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/evaluators/schemas.py +0 -0
  44. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/language_model/__init__.py +0 -0
  45. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/language_model/infos.py +0 -0
  46. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/language_model/service.py +0 -0
  47. {unique_toolkit-0.5.32 → unique_toolkit-0.5.35}/unique_toolkit/language_model/utils.py +0 -0
@@ -5,6 +5,15 @@ 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.5.35] - 2024-11-18
9
+ - Add the possibilty to upload files without triggering ingestion by setting `skip_ingestion` to `True` in `ContentService.upload_content`
10
+
11
+ ## [0.5.34] - 2024-11-15
12
+ - Add `content_id_to_translate` to `EventAdditionalParameters`
13
+
14
+ ## [0.5.33] - 2024-10-30
15
+ - Force randomizing tool_call_id. This is helpful to better identify the tool_calls.
16
+
8
17
  ## [0.5.32] - 2024-10-30
9
18
  - Extending `LanguageModelName` with GPT-4o-2024-0806. This model is invoked using `AZURE_GPT_4o_2024_0806`.
10
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.5.32
3
+ Version: 0.5.35
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Martin Fadler
@@ -100,6 +100,15 @@ All notable changes to this project will be documented in this file.
100
100
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
101
101
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
102
102
 
103
+ ## [0.5.35] - 2024-11-18
104
+ - Add the possibilty to upload files without triggering ingestion by setting `skip_ingestion` to `True` in `ContentService.upload_content`
105
+
106
+ ## [0.5.34] - 2024-11-15
107
+ - Add `content_id_to_translate` to `EventAdditionalParameters`
108
+
109
+ ## [0.5.33] - 2024-10-30
110
+ - Force randomizing tool_call_id. This is helpful to better identify the tool_calls.
111
+
103
112
  ## [0.5.32] - 2024-10-30
104
113
  - Extending `LanguageModelName` with GPT-4o-2024-0806. This model is invoked using `AZURE_GPT_4o_2024_0806`.
105
114
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_toolkit"
3
- version = "0.5.32"
3
+ version = "0.5.35"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -37,6 +37,7 @@ class EventAdditionalParameters(BaseModel):
37
37
  model_config = model_config
38
38
 
39
39
  translate_to_language: Optional[str] = None
40
+ content_id_to_translate: Optional[str] = None
40
41
 
41
42
 
42
43
  class EventPayload(BaseModel):
@@ -242,6 +242,7 @@ class ContentService(BaseService):
242
242
  mime_type: str,
243
243
  scope_id: Optional[str] = None,
244
244
  chat_id: Optional[str] = None,
245
+ skip_ingestion: Optional[bool] = False,
245
246
  ):
246
247
  """
247
248
  Uploads content to the knowledge base.
@@ -264,6 +265,7 @@ class ContentService(BaseService):
264
265
  mime_type=mime_type,
265
266
  scope_id=scope_id,
266
267
  chat_id=chat_id,
268
+ skip_ingestion=skip_ingestion,
267
269
  )
268
270
  except Exception as e:
269
271
  self.logger.error(f"Error while uploading content: {e}")
@@ -276,6 +278,7 @@ class ContentService(BaseService):
276
278
  mime_type: str,
277
279
  scope_id: Optional[str] = None,
278
280
  chat_id: Optional[str] = None,
281
+ skip_ingestion: Optional[bool] = False,
279
282
  ):
280
283
  if not chat_id and not scope_id:
281
284
  raise ValueError("chat_id or scope_id must be provided")
@@ -318,16 +321,21 @@ class ContentService(BaseService):
318
321
  self.logger.error(error_msg)
319
322
  raise ValueError(error_msg)
320
323
 
324
+ input_dict = {
325
+ "key": content_name,
326
+ "title": content_name,
327
+ "mimeType": mime_type,
328
+ "byteSize": byte_size,
329
+ }
330
+
331
+ if skip_ingestion:
332
+ input_dict["ingestionConfig"] = {"uniqueIngestionMode": "SKIP_INGESTION"}
333
+
321
334
  if chat_id:
322
335
  unique_sdk.Content.upsert(
323
336
  user_id=self.event.user_id,
324
337
  company_id=self.event.company_id,
325
- input={
326
- "key": content_name,
327
- "title": content_name,
328
- "mimeType": mime_type,
329
- "byteSize": byte_size,
330
- },
338
+ input=input_dict,
331
339
  fileUrl=read_url,
332
340
  chatId=chat_id,
333
341
  ) # type: ignore
@@ -335,12 +343,7 @@ class ContentService(BaseService):
335
343
  unique_sdk.Content.upsert(
336
344
  user_id=self.event.user_id,
337
345
  company_id=self.event.company_id,
338
- input={
339
- "key": content_name,
340
- "title": content_name,
341
- "mimeType": mime_type,
342
- "byteSize": byte_size,
343
- },
346
+ input=input_dict,
344
347
  fileUrl=read_url,
345
348
  scopeId=scope_id,
346
349
  ) # type: ignore
@@ -1,6 +1,7 @@
1
1
  import json
2
2
  from enum import StrEnum
3
3
  from typing import Any, Optional, Self
4
+ from uuid import uuid4
4
5
 
5
6
  from humps import camelize
6
7
  from pydantic import (
@@ -41,6 +42,10 @@ class LanguageModelFunction(BaseModel):
41
42
  return json.loads(value)
42
43
  return value
43
44
 
45
+ @field_validator("id", mode="before")
46
+ def randomize_id(cls, value):
47
+ return uuid4().hex
48
+
44
49
  @model_serializer()
45
50
  def serialize_model(self):
46
51
  seralization = {}
File without changes