unique_toolkit 0.5.11__tar.gz → 0.5.13__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 (33) hide show
  1. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/CHANGELOG.md +9 -0
  2. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/PKG-INFO +11 -1
  3. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/pyproject.toml +2 -1
  4. unique_toolkit-0.5.13/unique_toolkit/_common/_time_utils.py +5 -0
  5. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/app/schemas.py +2 -0
  6. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/chat/service.py +7 -4
  7. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/language_model/schemas.py +5 -1
  8. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/LICENSE +0 -0
  9. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/README.md +0 -0
  10. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/__init__.py +0 -0
  11. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/_common/_base_service.py +0 -0
  12. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/app/__init__.py +0 -0
  13. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/app/init_logging.py +0 -0
  14. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/app/init_sdk.py +0 -0
  15. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/app/performance/async_tasks.py +0 -0
  16. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/app/performance/async_wrapper.py +0 -0
  17. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/app/verification.py +0 -0
  18. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/chat/__init__.py +0 -0
  19. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/chat/schemas.py +0 -0
  20. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/chat/state.py +0 -0
  21. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/chat/utils.py +0 -0
  22. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/content/__init__.py +0 -0
  23. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/content/schemas.py +0 -0
  24. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/content/service.py +0 -0
  25. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/content/utils.py +0 -0
  26. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/embedding/__init__.py +0 -0
  27. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/embedding/schemas.py +0 -0
  28. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/embedding/service.py +0 -0
  29. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/embedding/utils.py +0 -0
  30. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/language_model/__init__.py +0 -0
  31. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/language_model/infos.py +0 -0
  32. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/unique_toolkit/language_model/service.py +0 -0
  33. {unique_toolkit-0.5.11 → unique_toolkit-0.5.13}/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.13] - 2024-08-19
9
+ - Added `items` to `LanguageModelToolParameterProperty` schema to add support for parameters with list types.
10
+ - Added `returns` to `LanguageModelTool` schema to describe the return types of tool calls.
11
+
12
+
13
+ ## [0.5.12] - 2024-08-7
14
+ - added `completedAt` datetime to `unique_sdk.Message.modify` and `unique_sdk.Message.modify_async`
15
+ - added `original_text` and `language` to `EventUserMessage`
16
+
8
17
  ## [0.5.11] - 2024-08-6
9
18
  - made all domain specific functions and classes directly importable from `unique_toolkit.[DOMAIN_NAME]`
10
19
  - renamed `RerankerConfig` to `ContentRerankerConfig`
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.5.11
3
+ Version: 0.5.13
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.12
13
13
  Requires-Dist: numpy (>=1.26.4,<2.0.0)
14
14
  Requires-Dist: pydantic (>=2.8.2,<3.0.0)
15
15
  Requires-Dist: pyhumps (>=3.8.0,<4.0.0)
16
+ Requires-Dist: pytest-mock (>=3.14.0,<4.0.0)
16
17
  Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
17
18
  Requires-Dist: regex (>=2024.5.15,<2025.0.0)
18
19
  Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
@@ -100,6 +101,15 @@ All notable changes to this project will be documented in this file.
100
101
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
101
102
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
102
103
 
104
+ ## [0.5.13] - 2024-08-19
105
+ - Added `items` to `LanguageModelToolParameterProperty` schema to add support for parameters with list types.
106
+ - Added `returns` to `LanguageModelTool` schema to describe the return types of tool calls.
107
+
108
+
109
+ ## [0.5.12] - 2024-08-7
110
+ - added `completedAt` datetime to `unique_sdk.Message.modify` and `unique_sdk.Message.modify_async`
111
+ - added `original_text` and `language` to `EventUserMessage`
112
+
103
113
  ## [0.5.11] - 2024-08-6
104
114
  - made all domain specific functions and classes directly importable from `unique_toolkit.[DOMAIN_NAME]`
105
115
  - renamed `RerankerConfig` to `ContentRerankerConfig`
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_toolkit"
3
- version = "0.5.11"
3
+ version = "0.5.13"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -21,6 +21,7 @@ python-dotenv = "^1.0.1"
21
21
  regex = "^2024.5.15"
22
22
  tiktoken = "^0.7.0"
23
23
  unique-sdk = "^0.9.4"
24
+ pytest-mock = "^3.14.0"
24
25
 
25
26
 
26
27
  [tool.poetry.group.dev.dependencies]
@@ -0,0 +1,5 @@
1
+ from datetime import datetime
2
+
3
+
4
+ def get_datetime_now(format: str = "%Y-%m-%d %H:%M:%S.%f"):
5
+ return datetime.now().strftime(format)
@@ -21,7 +21,9 @@ class EventUserMessage(BaseModel):
21
21
 
22
22
  id: str
23
23
  text: str
24
+ original_text: str
24
25
  created_at: str
26
+ language: str
25
27
 
26
28
 
27
29
  class EventAssistantMessage(BaseModel):
@@ -5,6 +5,7 @@ from typing import Optional
5
5
  import unique_sdk
6
6
  from unique_sdk._list_object import ListObject
7
7
 
8
+ from unique_toolkit._common import _time_utils
8
9
  from unique_toolkit._common._base_service import BaseService
9
10
  from unique_toolkit.app.schemas import Event
10
11
  from unique_toolkit.chat.schemas import ChatMessage, ChatMessageRole
@@ -55,11 +56,12 @@ class ChatService(BaseService):
55
56
  message = unique_sdk.Message.modify(
56
57
  user_id=self.event.user_id,
57
58
  company_id=self.event.company_id,
58
- id=message_id, # type: ignore
59
+ id=message_id,
59
60
  chatId=self.event.payload.chat_id,
60
61
  text=content,
61
- references=self._map_references(references), # type: ignore
62
+ references=self._map_references(references),
62
63
  debugInfo=debug_info or {},
64
+ completedAt=_time_utils.get_datetime_now(), # type: ignore
63
65
  )
64
66
  except Exception as e:
65
67
  self.logger.error(f"Failed to modify assistant message: {e}")
@@ -94,11 +96,12 @@ class ChatService(BaseService):
94
96
  message = await unique_sdk.Message.modify_async(
95
97
  user_id=self.event.user_id,
96
98
  company_id=self.event.company_id,
97
- id=message_id, # type: ignore
99
+ id=message_id,
98
100
  chatId=self.event.payload.chat_id,
99
101
  text=content,
100
- references=self._map_references(references), # type: ignore
102
+ references=self._map_references(references),
101
103
  debugInfo=debug_info or {},
104
+ completedAt=_time_utils.get_datetime_now(), # type: ignore
102
105
  )
103
106
  except Exception as e:
104
107
  self.logger.error(f"Failed to modify assistant message: {e}")
@@ -1,6 +1,6 @@
1
1
  import json
2
2
  from enum import StrEnum
3
- from typing import Any, Optional
3
+ from typing import Any, Optional, Self
4
4
 
5
5
  from humps import camelize
6
6
  from pydantic import BaseModel, ConfigDict, RootModel, field_validator, model_validator
@@ -154,6 +154,7 @@ class LanguageModelToolParameterProperty(BaseModel):
154
154
  type: str
155
155
  description: str
156
156
  enum: Optional[list[Any]] = None
157
+ items: Optional[Self] = None
157
158
 
158
159
 
159
160
  class LanguageModelToolParameters(BaseModel):
@@ -166,3 +167,6 @@ class LanguageModelTool(BaseModel):
166
167
  name: str
167
168
  description: str
168
169
  parameters: LanguageModelToolParameters
170
+ returns: LanguageModelToolParameterProperty | LanguageModelToolParameters | None = (
171
+ None
172
+ )
File without changes