unique_toolkit 0.7.9__py3-none-any.whl → 0.7.11__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.
- unique_toolkit/chat/service.py +277 -95
- unique_toolkit/content/service.py +142 -38
- unique_toolkit/embedding/service.py +60 -8
- unique_toolkit/language_model/infos.py +0 -4
- unique_toolkit/language_model/service.py +114 -10
- unique_toolkit/short_term_memory/service.py +136 -32
- {unique_toolkit-0.7.9.dist-info → unique_toolkit-0.7.11.dist-info}/METADATA +7 -1
- {unique_toolkit-0.7.9.dist-info → unique_toolkit-0.7.11.dist-info}/RECORD +10 -10
- {unique_toolkit-0.7.9.dist-info → unique_toolkit-0.7.11.dist-info}/LICENSE +0 -0
- {unique_toolkit-0.7.9.dist-info → unique_toolkit-0.7.11.dist-info}/WHEEL +0 -0
@@ -34,20 +34,20 @@ class ShortTermMemoryService:
|
|
34
34
|
):
|
35
35
|
self._event = event
|
36
36
|
if event:
|
37
|
-
self.
|
38
|
-
self.
|
37
|
+
self._company_id = event.company_id
|
38
|
+
self._user_id = event.user_id
|
39
39
|
if isinstance(event, (ChatEvent, Event)):
|
40
|
-
self.
|
41
|
-
self.
|
40
|
+
self._chat_id = event.payload.chat_id
|
41
|
+
self._message_id = event.payload.user_message.id
|
42
42
|
else:
|
43
43
|
[company_id, user_id] = validate_required_values([company_id, user_id])
|
44
44
|
assert (
|
45
45
|
chat_id or message_id
|
46
46
|
), "Either chat_id or message_id must be provided"
|
47
|
-
self.
|
48
|
-
self.
|
49
|
-
self.
|
50
|
-
self.
|
47
|
+
self._company_id = company_id
|
48
|
+
self._user_id = user_id
|
49
|
+
self._chat_id = chat_id
|
50
|
+
self._message_id = message_id
|
51
51
|
|
52
52
|
@property
|
53
53
|
@deprecated(
|
@@ -62,6 +62,110 @@ class ShortTermMemoryService:
|
|
62
62
|
"""
|
63
63
|
return self._event
|
64
64
|
|
65
|
+
@property
|
66
|
+
@deprecated(
|
67
|
+
"The company_id property is deprecated and will be removed in a future version."
|
68
|
+
)
|
69
|
+
def company_id(self) -> str | None:
|
70
|
+
"""
|
71
|
+
Get the company identifier (deprecated).
|
72
|
+
|
73
|
+
Returns:
|
74
|
+
str | None: The company identifier.
|
75
|
+
"""
|
76
|
+
return self._company_id
|
77
|
+
|
78
|
+
@company_id.setter
|
79
|
+
@deprecated(
|
80
|
+
"The company_id setter is deprecated and will be removed in a future version."
|
81
|
+
)
|
82
|
+
def company_id(self, value: str | None) -> None:
|
83
|
+
"""
|
84
|
+
Set the company identifier (deprecated).
|
85
|
+
|
86
|
+
Args:
|
87
|
+
value (str | None): The company identifier.
|
88
|
+
"""
|
89
|
+
self._company_id = value
|
90
|
+
|
91
|
+
@property
|
92
|
+
@deprecated(
|
93
|
+
"The user_id property is deprecated and will be removed in a future version."
|
94
|
+
)
|
95
|
+
def user_id(self) -> str | None:
|
96
|
+
"""
|
97
|
+
Get the user identifier (deprecated).
|
98
|
+
|
99
|
+
Returns:
|
100
|
+
str | None: The user identifier.
|
101
|
+
"""
|
102
|
+
return self._user_id
|
103
|
+
|
104
|
+
@user_id.setter
|
105
|
+
@deprecated(
|
106
|
+
"The user_id setter is deprecated and will be removed in a future version."
|
107
|
+
)
|
108
|
+
def user_id(self, value: str | None) -> None:
|
109
|
+
"""
|
110
|
+
Set the user identifier (deprecated).
|
111
|
+
|
112
|
+
Args:
|
113
|
+
value (str | None): The user identifier.
|
114
|
+
"""
|
115
|
+
self._user_id = value
|
116
|
+
|
117
|
+
@property
|
118
|
+
@deprecated(
|
119
|
+
"The chat_id property is deprecated and will be removed in a future version."
|
120
|
+
)
|
121
|
+
def chat_id(self) -> str | None:
|
122
|
+
"""
|
123
|
+
Get the chat identifier (deprecated).
|
124
|
+
|
125
|
+
Returns:
|
126
|
+
str | None: The chat identifier.
|
127
|
+
"""
|
128
|
+
return self._chat_id
|
129
|
+
|
130
|
+
@chat_id.setter
|
131
|
+
@deprecated(
|
132
|
+
"The chat_id setter is deprecated and will be removed in a future version."
|
133
|
+
)
|
134
|
+
def chat_id(self, value: str | None) -> None:
|
135
|
+
"""
|
136
|
+
Set the chat identifier (deprecated).
|
137
|
+
|
138
|
+
Args:
|
139
|
+
value (str | None): The chat identifier.
|
140
|
+
"""
|
141
|
+
self._chat_id = value
|
142
|
+
|
143
|
+
@property
|
144
|
+
@deprecated(
|
145
|
+
"The message_id property is deprecated and will be removed in a future version."
|
146
|
+
)
|
147
|
+
def message_id(self) -> str | None:
|
148
|
+
"""
|
149
|
+
Get the message identifier (deprecated).
|
150
|
+
|
151
|
+
Returns:
|
152
|
+
str | None: The message identifier.
|
153
|
+
"""
|
154
|
+
return self._message_id
|
155
|
+
|
156
|
+
@message_id.setter
|
157
|
+
@deprecated(
|
158
|
+
"The message_id setter is deprecated and will be removed in a future version."
|
159
|
+
)
|
160
|
+
def message_id(self, value: str | None) -> None:
|
161
|
+
"""
|
162
|
+
Set the message identifier (deprecated).
|
163
|
+
|
164
|
+
Args:
|
165
|
+
value (str | None): The message identifier.
|
166
|
+
"""
|
167
|
+
self._message_id = value
|
168
|
+
|
65
169
|
@classmethod
|
66
170
|
@deprecated("Instantiate class directly from event")
|
67
171
|
def from_chat_event(cls, chat_event: Event) -> "ShortTermMemoryService":
|
@@ -87,11 +191,11 @@ class ShortTermMemoryService:
|
|
87
191
|
"""
|
88
192
|
|
89
193
|
return await find_latest_memory_async(
|
90
|
-
user_id=self.
|
91
|
-
company_id=self.
|
194
|
+
user_id=self._user_id,
|
195
|
+
company_id=self._company_id,
|
92
196
|
key=key,
|
93
|
-
chat_id=self.
|
94
|
-
message_id=self.
|
197
|
+
chat_id=self._chat_id,
|
198
|
+
message_id=self._message_id,
|
95
199
|
)
|
96
200
|
|
97
201
|
def find_latest_memory(self, key: str) -> ShortTermMemory:
|
@@ -109,11 +213,11 @@ class ShortTermMemoryService:
|
|
109
213
|
"""
|
110
214
|
|
111
215
|
return find_latest_memory(
|
112
|
-
user_id=self.
|
113
|
-
company_id=self.
|
216
|
+
user_id=self._user_id,
|
217
|
+
company_id=self._company_id,
|
114
218
|
key=key,
|
115
|
-
chat_id=self.
|
116
|
-
message_id=self.
|
219
|
+
chat_id=self._chat_id,
|
220
|
+
message_id=self._message_id,
|
117
221
|
)
|
118
222
|
|
119
223
|
async def create_memory_async(self, key: str, value: str | dict):
|
@@ -132,12 +236,12 @@ class ShortTermMemoryService:
|
|
132
236
|
"""
|
133
237
|
|
134
238
|
return await create_memory_async(
|
135
|
-
user_id=self.
|
136
|
-
company_id=self.
|
239
|
+
user_id=self._user_id,
|
240
|
+
company_id=self._company_id,
|
137
241
|
key=key,
|
138
242
|
value=value,
|
139
|
-
chat_id=self.
|
140
|
-
message_id=self.
|
243
|
+
chat_id=self._chat_id,
|
244
|
+
message_id=self._message_id,
|
141
245
|
)
|
142
246
|
|
143
247
|
def create_memory(self, key: str, value: str | dict):
|
@@ -155,31 +259,31 @@ class ShortTermMemoryService:
|
|
155
259
|
"""
|
156
260
|
|
157
261
|
return create_memory(
|
158
|
-
user_id=self.
|
159
|
-
company_id=self.
|
262
|
+
user_id=self._user_id,
|
263
|
+
company_id=self._company_id,
|
160
264
|
key=key,
|
161
265
|
value=value,
|
162
|
-
chat_id=self.
|
163
|
-
message_id=self.
|
266
|
+
chat_id=self._chat_id,
|
267
|
+
message_id=self._message_id,
|
164
268
|
)
|
165
269
|
|
166
270
|
@deprecated("Use create_memory_async instead")
|
167
271
|
async def set(self, key: str, value: str | dict):
|
168
272
|
return await create_memory_async(
|
169
|
-
user_id=self.
|
170
|
-
company_id=self.
|
273
|
+
user_id=self._user_id,
|
274
|
+
company_id=self._company_id,
|
171
275
|
key=key,
|
172
276
|
value=value,
|
173
|
-
chat_id=self.
|
174
|
-
message_id=self.
|
277
|
+
chat_id=self._chat_id,
|
278
|
+
message_id=self._message_id,
|
175
279
|
)
|
176
280
|
|
177
281
|
@deprecated("Use find_latest_memory_async instead")
|
178
282
|
async def get(self, key: str) -> ShortTermMemory:
|
179
283
|
return await find_latest_memory_async(
|
180
|
-
user_id=self.
|
181
|
-
company_id=self.
|
284
|
+
user_id=self._user_id,
|
285
|
+
company_id=self._company_id,
|
182
286
|
key=key,
|
183
|
-
chat_id=self.
|
184
|
-
message_id=self.
|
287
|
+
chat_id=self._chat_id,
|
288
|
+
message_id=self._message_id,
|
185
289
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_toolkit
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.11
|
4
4
|
Summary:
|
5
5
|
License: Proprietary
|
6
6
|
Author: Martin Fadler
|
@@ -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.11] - 2025-04-28
|
115
|
+
- Removing `STRUCTURED_OUTPUT` capability from `AZURE_GPT_35_TURBO_0125`, `AZURE_GPT_4_TURBO_2024_0409` and `AZURE_GPT_4o_2024_0513`
|
116
|
+
|
117
|
+
## [0.7.10] - 2025-04-22
|
118
|
+
- Deprecate internal variables of services
|
119
|
+
|
114
120
|
## [0.7.9] - 2025-04-17
|
115
121
|
- add `AZURE_GPT_41_2025_0414` as part of the models
|
116
122
|
|
@@ -15,20 +15,20 @@ unique_toolkit/chat/__init__.py,sha256=LRs2G-JTVuci4lbtHTkVUiNcZcSR6uqqfnAyo7af6
|
|
15
15
|
unique_toolkit/chat/constants.py,sha256=05kq6zjqUVB2d6_P7s-90nbljpB3ryxwCI-CAz0r2O4,83
|
16
16
|
unique_toolkit/chat/functions.py,sha256=J9Cmgkhj9bBxZja3ggkSp48af_LPU4Dfi9Sbc_WhhNY,27204
|
17
17
|
unique_toolkit/chat/schemas.py,sha256=MNcGAXjK1K8zOODeMFz3FHVQL5sIBQXRwkr_2hFkG8k,2672
|
18
|
-
unique_toolkit/chat/service.py,sha256=
|
18
|
+
unique_toolkit/chat/service.py,sha256=nDXc9PMnepkFDViCAvno-HSQDBaeuG2p8FaHF0TG_9w,34302
|
19
19
|
unique_toolkit/chat/state.py,sha256=Cjgwv_2vhDFbV69xxsn7SefhaoIAEqLx3ferdVFCnOg,1445
|
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
23
|
unique_toolkit/content/functions.py,sha256=yB87wrbtmHzr3jGJUHetmuhy-7RVtnqG2IQ6gqFAun8,17093
|
24
24
|
unique_toolkit/content/schemas.py,sha256=zks_Pkki2VhxICJJgHZyc-LPmRuj5dLbw3pgcUT7SW8,2362
|
25
|
-
unique_toolkit/content/service.py,sha256=
|
25
|
+
unique_toolkit/content/service.py,sha256=A9M8C9fI73nfzsAqVAfJuMHGyneYZxATJxT3uTMgDs0,18578
|
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
|
29
29
|
unique_toolkit/embedding/functions.py,sha256=3qp-BfuMAbnp8YB04rh3xH8vsJuCBPizoy-JeaBFtoQ,1944
|
30
30
|
unique_toolkit/embedding/schemas.py,sha256=1GvKCaSk4jixzVQ2PKq8yDqwGEVY_hWclYtoAr6CC2g,96
|
31
|
-
unique_toolkit/embedding/service.py,sha256=
|
31
|
+
unique_toolkit/embedding/service.py,sha256=ptwNNe2ji7FGqAb5VayedrB9T5b1T00XABwYtgvlGO8,4076
|
32
32
|
unique_toolkit/embedding/utils.py,sha256=v86lo__bCJbxZBQ3OcLu5SuwT6NbFfWlcq8iyk6BuzQ,279
|
33
33
|
unique_toolkit/evaluators/__init__.py,sha256=3Rfpnowm7MUXHWmeU4UV4s_3Hk-sw3V20oBwQCYlejQ,50
|
34
34
|
unique_toolkit/evaluators/config.py,sha256=iYiBi7M6u5MG9nVgpxl9dKfoS4j72stA6Hl-MQHmYp8,1056
|
@@ -48,17 +48,17 @@ unique_toolkit/language_model/__init__.py,sha256=jWko_vQj48wjnpTtlkg8iNdef0SMI3F
|
|
48
48
|
unique_toolkit/language_model/builder.py,sha256=aIAXWWUoB5G-HONJiAt3MdRGd4jdP8nA-HYX2D2WlSI,3048
|
49
49
|
unique_toolkit/language_model/constants.py,sha256=B-topqW0r83dkC_25DeQfnPk3n53qzIHUCBS7YJ0-1U,119
|
50
50
|
unique_toolkit/language_model/functions.py,sha256=I5jHhHsKoq7GwEQyTrM8LXB2n_6dvMAk7UklenjuHSY,7945
|
51
|
-
unique_toolkit/language_model/infos.py,sha256=
|
51
|
+
unique_toolkit/language_model/infos.py,sha256=CwdyoHhq645DC2-Y2jwkHS3m5umjmpmb1EQJ70zOdjg,18967
|
52
52
|
unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
|
53
53
|
unique_toolkit/language_model/schemas.py,sha256=rrwzUgKANFOrdehCULW8Hh03uRW3tsE5dXpWqxmClfg,8618
|
54
|
-
unique_toolkit/language_model/service.py,sha256=
|
54
|
+
unique_toolkit/language_model/service.py,sha256=FUf-HTKNslrMAh8qFMco_ZpP-N0t_iAFWK3juldoUe8,8343
|
55
55
|
unique_toolkit/language_model/utils.py,sha256=bPQ4l6_YO71w-zaIPanUUmtbXC1_hCvLK0tAFc3VCRc,1902
|
56
56
|
unique_toolkit/short_term_memory/__init__.py,sha256=2mI3AUrffgH7Yt-xS57EGqnHf7jnn6xquoKEhJqk3Wg,185
|
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=
|
61
|
-
unique_toolkit-0.7.
|
62
|
-
unique_toolkit-0.7.
|
63
|
-
unique_toolkit-0.7.
|
64
|
-
unique_toolkit-0.7.
|
60
|
+
unique_toolkit/short_term_memory/service.py,sha256=vEKFxP1SScPrFniso492fVthWR1sosdFibhiNF3zRvI,8081
|
61
|
+
unique_toolkit-0.7.11.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
62
|
+
unique_toolkit-0.7.11.dist-info/METADATA,sha256=OLYyH8X2yEgAkauCTWjsCJvIiI6JjmJnElRSeqS-Pn8,21641
|
63
|
+
unique_toolkit-0.7.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
64
|
+
unique_toolkit-0.7.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|