unique_toolkit 0.5.21__py3-none-any.whl → 0.5.22__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.
@@ -39,6 +39,9 @@ from .schemas import (
39
39
  from .schemas import (
40
40
  LanguageModelTool as LanguageModelTool,
41
41
  )
42
+ from .schemas import (
43
+ LanguageModelToolMessage as LanguageModelToolMessage,
44
+ )
42
45
  from .schemas import (
43
46
  LanguageModelToolParameterProperty as LanguageModelToolParameterProperty,
44
47
  )
@@ -17,6 +17,7 @@ class LanguageModelMessageRole(StrEnum):
17
17
  USER = "user"
18
18
  SYSTEM = "system"
19
19
  ASSISTANT = "assistant"
20
+ TOOL = "tool"
20
21
 
21
22
 
22
23
  class LanguageModelFunction(BaseModel):
@@ -72,6 +73,14 @@ class LanguageModelAssistantMessage(LanguageModelMessage):
72
73
  return LanguageModelMessageRole.ASSISTANT
73
74
 
74
75
 
76
+ class LanguageModelToolMessage(LanguageModelMessage):
77
+ role: LanguageModelMessageRole = LanguageModelMessageRole.TOOL
78
+
79
+ @field_validator("role", mode="before")
80
+ def set_role(cls, value):
81
+ return LanguageModelMessageRole.TOOL
82
+
83
+
75
84
  class LanguageModelMessages(RootModel):
76
85
  root: list[LanguageModelMessage]
77
86
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 0.5.21
3
+ Version: 0.5.22
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -100,8 +100,11 @@ 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.22] - 2024-09-17
104
+ - Add `LanguageModelToolMessage` as additional `LanguageModelMessage`
105
+
103
106
  ## [0.5.21] - 2024-09-16
104
- - Add `tool` as new role `ChatMessage`, as well as `tool_calls` and `tool_call_id` as additional parameters
107
+ - Add `tool` as new role to `ChatMessage`, as well as `tool_calls` and `tool_call_id` as additional parameters
105
108
 
106
109
  ## [0.5.20] - 2024-09-16
107
110
  - `LanguageModelService` now supports complete_util_async that can be called without instantiating the class, currently being used in the Hallucination service and evaluation API
@@ -21,12 +21,12 @@ unique_toolkit/embedding/__init__.py,sha256=dr8M9jvslQTxPpxgaGwzxY0FildiWf-DidN_
21
21
  unique_toolkit/embedding/schemas.py,sha256=1GvKCaSk4jixzVQ2PKq8yDqwGEVY_hWclYtoAr6CC2g,96
22
22
  unique_toolkit/embedding/service.py,sha256=Iiw-sbdkjuWlWMfLM9qyC4GNTJOotQAaVjkYvh5Su4Y,2370
23
23
  unique_toolkit/embedding/utils.py,sha256=v86lo__bCJbxZBQ3OcLu5SuwT6NbFfWlcq8iyk6BuzQ,279
24
- unique_toolkit/language_model/__init__.py,sha256=QgU_uwpVh1URQyVs6l-6Am4UwmEEhuGXNic3dUZ0FCc,1701
24
+ unique_toolkit/language_model/__init__.py,sha256=YuhyczGPj6w9xX-sOVUhmozvzIFxcckHFEkeMBecr5s,1784
25
25
  unique_toolkit/language_model/infos.py,sha256=ETAUV0YTs6BjwuiTdhKz247CtL0W8Jwo3-c0ZQ2HdXs,9962
26
- unique_toolkit/language_model/schemas.py,sha256=DGZL6j63txkq5rdCn1uuVQIyLOyZt9t8J4f8JzhZENg,4607
26
+ unique_toolkit/language_model/schemas.py,sha256=sLpE29Ks0zEfhZUQrYOt1Cak2xzQcr9fpTXFDHkfURA,4868
27
27
  unique_toolkit/language_model/service.py,sha256=CvVo5CBa5Ia_fQD3DtJRsVChybuUfGFV5ml2_78_p1I,13395
28
28
  unique_toolkit/language_model/utils.py,sha256=WBPj1XKkDgxy_-T8HCZvsfkkSzj_1w4UZzNmyvdbBLY,1081
29
- unique_toolkit-0.5.21.dist-info/LICENSE,sha256=bIeCWCYuoUU_MzNdg48-ubJSVm7qxakaRbzTiJ5uxrs,1065
30
- unique_toolkit-0.5.21.dist-info/METADATA,sha256=H0uDtak7X3iObJFeImnvuSuMo7EgX_M09eMNknMOTqw,11242
31
- unique_toolkit-0.5.21.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
- unique_toolkit-0.5.21.dist-info/RECORD,,
29
+ unique_toolkit-0.5.22.dist-info/LICENSE,sha256=bIeCWCYuoUU_MzNdg48-ubJSVm7qxakaRbzTiJ5uxrs,1065
30
+ unique_toolkit-0.5.22.dist-info/METADATA,sha256=Ic20qPiV5WMEWyvebx9GXvJCIkSZjJOax2EhwqACo6o,11341
31
+ unique_toolkit-0.5.22.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
+ unique_toolkit-0.5.22.dist-info/RECORD,,