unique_toolkit 0.5.54__py3-none-any.whl → 0.6.0__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/_common/validate_required_values.py +21 -0
- unique_toolkit/app/__init__.py +20 -0
- unique_toolkit/app/schemas.py +73 -7
- unique_toolkit/chat/__init__.py +5 -4
- unique_toolkit/chat/constants.py +3 -0
- unique_toolkit/chat/functions.py +661 -0
- unique_toolkit/chat/schemas.py +11 -11
- unique_toolkit/chat/service.py +273 -430
- unique_toolkit/content/__init__.py +1 -0
- unique_toolkit/content/constants.py +2 -0
- unique_toolkit/content/functions.py +475 -0
- unique_toolkit/content/service.py +163 -300
- unique_toolkit/content/utils.py +32 -0
- unique_toolkit/embedding/__init__.py +3 -0
- unique_toolkit/embedding/constants.py +2 -0
- unique_toolkit/embedding/functions.py +79 -0
- unique_toolkit/embedding/service.py +47 -34
- unique_toolkit/evaluators/__init__.py +1 -0
- unique_toolkit/evaluators/constants.py +1 -0
- unique_toolkit/evaluators/context_relevancy/constants.py +3 -3
- unique_toolkit/evaluators/context_relevancy/utils.py +5 -2
- unique_toolkit/evaluators/hallucination/utils.py +2 -1
- unique_toolkit/language_model/__init__.py +1 -0
- unique_toolkit/language_model/constants.py +4 -0
- unique_toolkit/language_model/functions.py +362 -0
- unique_toolkit/language_model/service.py +246 -293
- unique_toolkit/short_term_memory/__init__.py +5 -0
- unique_toolkit/short_term_memory/constants.py +1 -0
- unique_toolkit/short_term_memory/functions.py +175 -0
- unique_toolkit/short_term_memory/service.py +153 -27
- {unique_toolkit-0.5.54.dist-info → unique_toolkit-0.6.0.dist-info}/METADATA +36 -7
- unique_toolkit-0.6.0.dist-info/RECORD +64 -0
- unique_toolkit-0.5.54.dist-info/RECORD +0 -50
- {unique_toolkit-0.5.54.dist-info → unique_toolkit-0.6.0.dist-info}/LICENSE +0 -0
- {unique_toolkit-0.5.54.dist-info → unique_toolkit-0.6.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,175 @@
|
|
1
|
+
import json
|
2
|
+
import logging
|
3
|
+
|
4
|
+
import unique_sdk
|
5
|
+
|
6
|
+
from unique_toolkit.short_term_memory.constants import DOMAIN_NAME
|
7
|
+
from unique_toolkit.short_term_memory.schemas import ShortTermMemory
|
8
|
+
|
9
|
+
logger = logging.getLogger(f"toolkit.{DOMAIN_NAME}.{__name__}")
|
10
|
+
|
11
|
+
|
12
|
+
async def find_latest_memory_async(
|
13
|
+
user_id: str,
|
14
|
+
company_id: str,
|
15
|
+
key: str,
|
16
|
+
chat_id: str | None = None,
|
17
|
+
message_id: str | None = None,
|
18
|
+
) -> ShortTermMemory:
|
19
|
+
"""
|
20
|
+
Find the latest short term memory asynchronously.
|
21
|
+
|
22
|
+
Args:
|
23
|
+
user_id (str): The user ID.
|
24
|
+
company_id (str): The company ID.
|
25
|
+
key (str): The key.
|
26
|
+
chat_id (str | None): The chat ID.
|
27
|
+
message_id (str | None): The message ID.
|
28
|
+
|
29
|
+
Returns:
|
30
|
+
ShortTermMemory: The latest short term memory.
|
31
|
+
|
32
|
+
Raises:
|
33
|
+
Exception: If an error occurs.
|
34
|
+
"""
|
35
|
+
try:
|
36
|
+
logger.info("Finding latest short term memory")
|
37
|
+
stm = await unique_sdk.ShortTermMemory.find_latest_async(
|
38
|
+
user_id=user_id,
|
39
|
+
company_id=company_id,
|
40
|
+
memoryName=key,
|
41
|
+
chatId=chat_id,
|
42
|
+
messageId=message_id,
|
43
|
+
)
|
44
|
+
return ShortTermMemory(**stm)
|
45
|
+
except Exception as e:
|
46
|
+
logger.error(f"Error finding latest short term memory: {e}")
|
47
|
+
raise e
|
48
|
+
|
49
|
+
|
50
|
+
def find_latest_memory(
|
51
|
+
user_id: str,
|
52
|
+
company_id: str,
|
53
|
+
key: str,
|
54
|
+
chat_id: str | None = None,
|
55
|
+
message_id: str | None = None,
|
56
|
+
) -> ShortTermMemory:
|
57
|
+
"""
|
58
|
+
Find the latest short term memory.
|
59
|
+
|
60
|
+
Args:
|
61
|
+
user_id (str): The user ID.
|
62
|
+
company_id (str): The company ID.
|
63
|
+
key (str): The key.
|
64
|
+
chat_id (str | None): The chat ID.
|
65
|
+
message_id (str | None): The message ID.
|
66
|
+
|
67
|
+
Returns:
|
68
|
+
ShortTermMemory: The latest short term memory.
|
69
|
+
|
70
|
+
Raises:
|
71
|
+
Exception: If an error occurs.
|
72
|
+
"""
|
73
|
+
try:
|
74
|
+
logger.info("Finding latest short term memory")
|
75
|
+
stm = unique_sdk.ShortTermMemory.find_latest(
|
76
|
+
user_id=user_id,
|
77
|
+
company_id=company_id,
|
78
|
+
memoryName=key,
|
79
|
+
chatId=chat_id,
|
80
|
+
messageId=message_id,
|
81
|
+
)
|
82
|
+
return ShortTermMemory(**stm)
|
83
|
+
except Exception as e:
|
84
|
+
logger.error(f"Error finding latest short term memory: {e}")
|
85
|
+
raise e
|
86
|
+
|
87
|
+
|
88
|
+
async def create_memory_async(
|
89
|
+
user_id: str,
|
90
|
+
company_id: str,
|
91
|
+
key: str,
|
92
|
+
value: str | dict,
|
93
|
+
chat_id: str | None = None,
|
94
|
+
message_id: str | None = None,
|
95
|
+
):
|
96
|
+
"""
|
97
|
+
Create a short term memory asynchronously.
|
98
|
+
|
99
|
+
Args:
|
100
|
+
user_id (str): The user ID.
|
101
|
+
company_id (str): The company ID.
|
102
|
+
key (str): The key.
|
103
|
+
value (str | dict): The value.
|
104
|
+
chat_id (str | None): The chat ID.
|
105
|
+
message_id (str | None): The message ID.
|
106
|
+
|
107
|
+
Returns:
|
108
|
+
ShortTermMemory: The created short term memory.
|
109
|
+
|
110
|
+
Raises:
|
111
|
+
Exception: If an error occurs.
|
112
|
+
"""
|
113
|
+
|
114
|
+
if isinstance(value, dict):
|
115
|
+
value = json.dumps(value)
|
116
|
+
|
117
|
+
try:
|
118
|
+
logger.info("Creating short term memory")
|
119
|
+
stm = await unique_sdk.ShortTermMemory.create_async(
|
120
|
+
user_id=user_id,
|
121
|
+
company_id=company_id,
|
122
|
+
memoryName=key,
|
123
|
+
chatId=chat_id,
|
124
|
+
messageId=message_id,
|
125
|
+
data=value,
|
126
|
+
)
|
127
|
+
return ShortTermMemory(**stm)
|
128
|
+
except Exception as e:
|
129
|
+
logger.error(f"Error creating short term memory: {e}")
|
130
|
+
raise e
|
131
|
+
|
132
|
+
|
133
|
+
def create_memory(
|
134
|
+
user_id: str,
|
135
|
+
company_id: str,
|
136
|
+
key: str,
|
137
|
+
value: str | dict,
|
138
|
+
chat_id: str | None = None,
|
139
|
+
message_id: str | None = None,
|
140
|
+
):
|
141
|
+
"""
|
142
|
+
Create a short term memory.
|
143
|
+
|
144
|
+
Args:
|
145
|
+
user_id (str): The user ID.
|
146
|
+
company_id (str): The company ID.
|
147
|
+
key (str): The key.
|
148
|
+
value (str | dict): The value.
|
149
|
+
chat_id (str | None): The chat ID.
|
150
|
+
message_id (str | None): The message ID.
|
151
|
+
|
152
|
+
Returns:
|
153
|
+
ShortTermMemory: The created short term memory.
|
154
|
+
|
155
|
+
Raises:
|
156
|
+
Exception: If an error occurs.
|
157
|
+
"""
|
158
|
+
|
159
|
+
if isinstance(value, dict):
|
160
|
+
value = json.dumps(value)
|
161
|
+
|
162
|
+
try:
|
163
|
+
logger.info("Creating short term memory")
|
164
|
+
stm = unique_sdk.ShortTermMemory.create(
|
165
|
+
user_id=user_id,
|
166
|
+
company_id=company_id,
|
167
|
+
memoryName=key,
|
168
|
+
chatId=chat_id,
|
169
|
+
messageId=message_id,
|
170
|
+
data=value,
|
171
|
+
)
|
172
|
+
return ShortTermMemory(**stm)
|
173
|
+
except Exception as e:
|
174
|
+
logger.error(f"Error creating short term memory: {e}")
|
175
|
+
raise e
|
@@ -1,29 +1,69 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
from unique_sdk.api_resources._short_term_memory import (
|
4
|
-
ShortTermMemory as ShortTermMemoryAPI,
|
5
|
-
)
|
1
|
+
from typing_extensions import deprecated
|
6
2
|
|
3
|
+
from unique_toolkit._common.validate_required_values import validate_required_values
|
7
4
|
from unique_toolkit.app import Event
|
5
|
+
from unique_toolkit.app.schemas import BaseEvent, ChatEvent
|
6
|
+
from unique_toolkit.short_term_memory.functions import (
|
7
|
+
create_memory,
|
8
|
+
create_memory_async,
|
9
|
+
find_latest_memory,
|
10
|
+
find_latest_memory_async,
|
11
|
+
)
|
8
12
|
|
9
13
|
from .schemas import ShortTermMemory
|
10
14
|
|
11
15
|
|
12
16
|
class ShortTermMemoryService:
|
17
|
+
"""
|
18
|
+
Provides methods to manage short term memory.
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
user_id (str | None): The user ID.
|
22
|
+
company_id (str | None): The company ID.
|
23
|
+
chat_id (str | None): The chat ID.
|
24
|
+
message_id (str | None): The message ID.
|
25
|
+
"""
|
26
|
+
|
13
27
|
def __init__(
|
14
28
|
self,
|
15
|
-
|
16
|
-
|
17
|
-
|
29
|
+
event: Event | BaseEvent | None = None,
|
30
|
+
user_id: str | None = None,
|
31
|
+
company_id: str | None = None,
|
32
|
+
chat_id: str | None = None,
|
18
33
|
message_id: str | None = None,
|
19
34
|
):
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
35
|
+
self._event = event
|
36
|
+
if event:
|
37
|
+
self.company_id = event.company_id
|
38
|
+
self.user_id = event.user_id
|
39
|
+
if isinstance(event, (ChatEvent, Event)):
|
40
|
+
self.chat_id = event.payload.chat_id
|
41
|
+
self.message_id = event.payload.user_message.id
|
42
|
+
else:
|
43
|
+
[company_id, user_id] = validate_required_values([company_id, user_id])
|
44
|
+
assert (
|
45
|
+
chat_id or message_id
|
46
|
+
), "Either chat_id or message_id must be provided"
|
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
|
+
|
52
|
+
@property
|
53
|
+
@deprecated(
|
54
|
+
"The event property is deprecated and will be removed in a future version."
|
55
|
+
)
|
56
|
+
def event(self) -> Event | BaseEvent | None:
|
57
|
+
"""
|
58
|
+
Get the event object (deprecated).
|
59
|
+
|
60
|
+
Returns:
|
61
|
+
Event | BaseEvent | None: The event object.
|
62
|
+
"""
|
63
|
+
return self._event
|
25
64
|
|
26
65
|
@classmethod
|
66
|
+
@deprecated("Instantiate class directly from event")
|
27
67
|
def from_chat_event(cls, chat_event: Event) -> "ShortTermMemoryService":
|
28
68
|
return cls(
|
29
69
|
user_id=chat_event.user_id,
|
@@ -32,26 +72,112 @@ class ShortTermMemoryService:
|
|
32
72
|
message_id=chat_event.payload.user_message.id,
|
33
73
|
)
|
34
74
|
|
35
|
-
async def
|
36
|
-
|
75
|
+
async def find_latest_memory_async(self, key: str) -> ShortTermMemory:
|
76
|
+
"""
|
77
|
+
Find the latest short term memory.
|
78
|
+
|
79
|
+
Args:
|
80
|
+
key (str): The key.
|
81
|
+
|
82
|
+
Returns:
|
83
|
+
ShortTermMemory: The latest short term memory.
|
84
|
+
|
85
|
+
Raises:
|
86
|
+
Exception: If an error occurs.
|
87
|
+
"""
|
88
|
+
|
89
|
+
return await find_latest_memory_async(
|
90
|
+
user_id=self.user_id,
|
91
|
+
company_id=self.company_id,
|
92
|
+
key=key,
|
93
|
+
chat_id=self.chat_id,
|
94
|
+
message_id=self.message_id,
|
95
|
+
)
|
96
|
+
|
97
|
+
def find_latest_memory(self, key: str) -> ShortTermMemory:
|
98
|
+
"""
|
99
|
+
Find the latest short term memory.
|
100
|
+
|
101
|
+
Args:
|
102
|
+
key (str): The key.
|
103
|
+
|
104
|
+
Returns:
|
105
|
+
ShortTermMemory: The latest short term memory.
|
106
|
+
|
107
|
+
Raises:
|
108
|
+
Exception: If an error occurs.
|
109
|
+
"""
|
110
|
+
|
111
|
+
return find_latest_memory(
|
37
112
|
user_id=self.user_id,
|
38
113
|
company_id=self.company_id,
|
39
|
-
|
40
|
-
|
41
|
-
|
114
|
+
key=key,
|
115
|
+
chat_id=self.chat_id,
|
116
|
+
message_id=self.message_id,
|
42
117
|
)
|
43
118
|
|
44
|
-
|
119
|
+
async def create_memory_async(self, key: str, value: str | dict):
|
120
|
+
"""
|
121
|
+
Create a short term memory.
|
45
122
|
|
123
|
+
Args:
|
124
|
+
key (str): The key.
|
125
|
+
value (str | dict): The value.
|
126
|
+
|
127
|
+
Returns:
|
128
|
+
ShortTermMemory: The created short term memory.
|
129
|
+
|
130
|
+
Raises:
|
131
|
+
Exception: If an error occurs.
|
132
|
+
"""
|
133
|
+
|
134
|
+
return await create_memory_async(
|
135
|
+
user_id=self.user_id,
|
136
|
+
company_id=self.company_id,
|
137
|
+
key=key,
|
138
|
+
value=value,
|
139
|
+
)
|
140
|
+
|
141
|
+
def create_memory(self, key: str, value: str | dict):
|
142
|
+
"""
|
143
|
+
Create a short term memory.
|
144
|
+
|
145
|
+
Args:
|
146
|
+
key (str): The key.
|
147
|
+
value (str | dict): The value.
|
148
|
+
Returns:
|
149
|
+
ShortTermMemory: The created short term memory.
|
150
|
+
|
151
|
+
Raises:
|
152
|
+
Exception: If an error occurs.
|
153
|
+
"""
|
154
|
+
|
155
|
+
return create_memory(
|
156
|
+
user_id=self.user_id,
|
157
|
+
company_id=self.company_id,
|
158
|
+
key=key,
|
159
|
+
value=value,
|
160
|
+
chat_id=self.chat_id,
|
161
|
+
message_id=self.message_id,
|
162
|
+
)
|
163
|
+
|
164
|
+
@deprecated("Use create_memory_async instead")
|
46
165
|
async def set(self, key: str, value: str | dict):
|
47
|
-
|
48
|
-
|
49
|
-
|
166
|
+
return await create_memory_async(
|
167
|
+
user_id=self.user_id,
|
168
|
+
company_id=self.company_id,
|
169
|
+
key=key,
|
170
|
+
value=value,
|
171
|
+
chat_id=self.chat_id,
|
172
|
+
message_id=self.message_id,
|
173
|
+
)
|
174
|
+
|
175
|
+
@deprecated("Use find_latest_memory_async instead")
|
176
|
+
async def get(self, key: str) -> ShortTermMemory:
|
177
|
+
return await find_latest_memory_async(
|
50
178
|
user_id=self.user_id,
|
51
179
|
company_id=self.company_id,
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
data=value,
|
180
|
+
key=key,
|
181
|
+
chat_id=self.chat_id,
|
182
|
+
message_id=self.message_id,
|
56
183
|
)
|
57
|
-
return ShortTermMemory(**stm)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_toolkit
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.0
|
4
4
|
Summary:
|
5
5
|
License: Proprietary
|
6
6
|
Author: Martin Fadler
|
@@ -29,10 +29,9 @@ The Toolkit is structured along the following domains:
|
|
29
29
|
- `unique_toolkit.content`
|
30
30
|
- `unique_toolkit.embedding`
|
31
31
|
- `unique_toolkit.language_model`
|
32
|
+
- `unique_toolkit.short_term_memory`
|
32
33
|
|
33
|
-
Each domain comprises a service class (in `service.py`) which encapsulates the basic functionalities to interact with the domain entities, the schemas
|
34
|
-
(in `schemas.py`) used in the service and required for interacting with the service functions, utility functions (in `utils.py`) which give additional
|
35
|
-
functionality to interact with the domain entities (all domains except embedding) and other domain specific functionalities which are explained in the respective domain documentation.
|
34
|
+
Each domain comprises a set of functions (in `functions.py`) and a service class (in `service.py`) which encapsulates the basic functionalities to interact with the domain entities, the schemas (in `schemas.py`) used in the service and required for interacting with the service functions, utility functions (in `utils.py`) which give additional functionality to interact with the domain entities (all domains except embedding) and other domain specific functionalities which are explained in the respective domain documentation.
|
36
35
|
|
37
36
|
In addition, the `unique_toolkit.app` module provides functions to initialize apps that interact with the Unique platform. It also includes some utility functions to run async tasks in parallel (async webserver and app implementation required).
|
38
37
|
|
@@ -55,14 +54,16 @@ The `unique_toolkit.app` module encompasses functions for initializing and secur
|
|
55
54
|
|
56
55
|
The `unique_toolkit.chat` module encompasses all chat related functionality.
|
57
56
|
|
58
|
-
- `
|
59
|
-
- `
|
57
|
+
- `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
|
58
|
+
- `service.py` comprises the ChatService and provides an interface to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
|
59
|
+
- `schemas.py` comprises all relevant schemas, e.g., ChatMessage, used in the ChatService.
|
60
60
|
- `utils.py` comprises utility functions to use and convert ChatMessage objects in assistants, e.g., convert_chat_history_to_injectable_string converts the chat history to a string that can be injected into a prompt.
|
61
61
|
|
62
62
|
## Content
|
63
63
|
|
64
64
|
The `unique_toolkit.content` module encompasses all content related functionality. Content can be any type of textual data that is stored in the Knowledgebase on the Unique platform. During the ingestion of the content, the content is parsed, split in chunks, indexed, and stored in the database.
|
65
65
|
|
66
|
+
- `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
|
66
67
|
- `service.py` comprises the ContentService and provides an interface to interact with the content, e.g., search content, search content chunks, upload and download content.
|
67
68
|
- `schemas.py` comprises all relevant schemas, e.g., Content and ContentChunk, used in the ContentService.
|
68
69
|
- `utils.py` comprise utility functions to manipulate Content and ContentChunk objects, e.g., sort_content_chunks and merge_content_chunks.
|
@@ -71,6 +72,7 @@ The `unique_toolkit.content` module encompasses all content related functionalit
|
|
71
72
|
|
72
73
|
The `unique_toolkit.embedding` module encompasses all embedding related functionality. Embeddings are used to represent textual data in a high-dimensional space. The embeddings can be used to calculate the similarity between two texts, for instance.
|
73
74
|
|
75
|
+
- `functions.py` comprises the functions to embed text and calculate the similarity between two texts.
|
74
76
|
- `service.py` encompasses the EmbeddingService and provides an interface to interact with the embeddings, e.g., embed text and calculate the similarity between two texts.
|
75
77
|
- `schemas.py` comprises all relevant schemas, e.g., Embeddings, used in the EmbeddingService.
|
76
78
|
|
@@ -80,10 +82,19 @@ The `unique_toolkit.language_model` module encompasses all language model relate
|
|
80
82
|
Unique platform.
|
81
83
|
|
82
84
|
- `infos.py` comprises the information on all language models deployed through the Unique platform. We recommend to use the LanguageModel class, initialized with the LanguageModelName, e.g., LanguageModel(LanguageModelName.AZURE_GPT_35_TURBO_0125) to get the information on the specific language model like the name, version, token limits or retirement date.
|
85
|
+
- `functions.py` comprises the functions to complete and stream complete to chat.
|
83
86
|
- `service.py` comprises the LanguageModelService and provides an interface to interact with the language models, e.g., complete or stream_complete.
|
84
87
|
- `schemas.py` comprises all relevant schemas, e.g., LanguageModelResponse, used in the LanguageModelService.
|
85
88
|
- `utils.py` comprises utility functions to parse the output of the language model, e.g., convert_string_to_json finds and parses the last json object in a string.
|
86
89
|
|
90
|
+
## Short Term Memory
|
91
|
+
|
92
|
+
The `unique_toolkit.short_term_memory` module encompasses all short term memory related functionality.
|
93
|
+
|
94
|
+
- `functions.py` comprises the functions to manage and load the chat history and interact with the chat ui, e.g., creating a new assistant message.
|
95
|
+
- `service.py` comprises the ShortTermMemoryService and provides an interface to interact with the short term memory, e.g., create memory.
|
96
|
+
- `schemas.py` comprises all relevant schemas, e.g., ShortTermMemory, used in the ShortTermMemoryService.
|
97
|
+
|
87
98
|
# Development instructions
|
88
99
|
|
89
100
|
1. Install poetry on your system (through `brew` or `pipx`).
|
@@ -100,6 +111,24 @@ All notable changes to this project will be documented in this file.
|
|
100
111
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
101
112
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
102
113
|
|
114
|
+
## [0.6.0] - 2025-02-21
|
115
|
+
- make for each domain, its base functionality accessible from `functions.py`
|
116
|
+
- make it possible to instantiate the domain services directly from different event types, inhereted from common `BaseEvent`
|
117
|
+
- extend the functionalities in the ShortTermMemoryService by adding the `find_latest_memory` and `create_memory` functions for sync and async usage
|
118
|
+
- remove logger dependency from service classes
|
119
|
+
- marked deprecated:
|
120
|
+
- `from_chat_event` in ShortTermMemoryService, use `ShortTermMemoryService(event=event)` instead
|
121
|
+
- `complete_async_util` in LanguageModelService, use `functions.complete_async` instead
|
122
|
+
- `stream_complete_async` in LanguageModelService, use `stream_complete_to_chat_async` instead
|
123
|
+
- `stream_complete` in LanguageModelService, use `stream_complete_to_chat` instead
|
124
|
+
- `Event` and nested schemas in `app`, use `ChatEvent` and `ChatEventUserMessage`, `ChatEventAssistantMessage` and `ChatEventToolMessage` instead
|
125
|
+
|
126
|
+
## [0.5.56] - 2025-02-19
|
127
|
+
- Add `MessageAssessment` title field and change label values
|
128
|
+
|
129
|
+
## [0.5.55] - 2025-02-18
|
130
|
+
- Log `contentId` for better debugging
|
131
|
+
|
103
132
|
## [0.5.54] - 2025-02-10
|
104
133
|
- Add `created_at`, `completed_at`, `updated_at` and `gpt_request` to `ChatMessage` schema.
|
105
134
|
|
@@ -127,7 +156,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
127
156
|
- Move tool_calls to assistant message as not needed anywhere else.
|
128
157
|
|
129
158
|
## [0.5.46] - 2025-01-07
|
130
|
-
- Added `AZURE_GPT_35_TURBO_0125` as new model into toolkit.
|
159
|
+
- Added `AZURE_GPT_35_TURBO_0125` as new model into toolkit.
|
131
160
|
|
132
161
|
## [0.5.45] - 2025-01-03
|
133
162
|
- Added `ShortTermMemoryService` class to handle short term memory.
|
@@ -0,0 +1,64 @@
|
|
1
|
+
unique_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
unique_toolkit/_common/_base_service.py,sha256=S8H0rAebx7GsOldA7xInLp3aQJt9yEPDQdsGSFRJsGg,276
|
3
|
+
unique_toolkit/_common/_time_utils.py,sha256=ztmTovTvr-3w71Ns2VwXC65OKUUh-sQlzbHdKTQWm-w,135
|
4
|
+
unique_toolkit/_common/exception.py,sha256=caQIE1btsQnpKCHqL2cgWUSbHup06enQu_Pt7uGUTTE,727
|
5
|
+
unique_toolkit/_common/validate_required_values.py,sha256=Y_M1ub9gIKP9qZ45F6Zq3ZHtuIqhmOjl8Z2Vd3avg8w,588
|
6
|
+
unique_toolkit/_common/validators.py,sha256=w5lzvRxl0sBTvv0CXLF9UwtJyKmmS2lez0KXaqapgBE,258
|
7
|
+
unique_toolkit/app/__init__.py,sha256=jgwWfu27U911kZE1yRq920ZULGLAQGycD3222YxUvsY,1182
|
8
|
+
unique_toolkit/app/init_logging.py,sha256=Sh26SRxOj8i8dzobKhYha2lLrkrMTHfB1V4jR3h23gQ,678
|
9
|
+
unique_toolkit/app/init_sdk.py,sha256=Nv4Now4pMfM0AgRhbtatLpm_39rKxn0WmRLwmPhRl-8,1285
|
10
|
+
unique_toolkit/app/performance/async_tasks.py,sha256=H0l3OAcosLwNHZ8d2pd-Di4wHIXfclEvagi5kfqLFPA,1941
|
11
|
+
unique_toolkit/app/performance/async_wrapper.py,sha256=yVVcRDkcdyfjsxro-N29SBvi-7773wnfDplef6-y8xw,1077
|
12
|
+
unique_toolkit/app/schemas.py,sha256=hPOh5xLNNWgWVIkdrj6ZHYaGz0cTV-5Kv7OQHOaUgV8,3201
|
13
|
+
unique_toolkit/app/verification.py,sha256=mffa6wm0i4hJbwzofePrkaia46xumMzECwQ0T3eKAx0,1929
|
14
|
+
unique_toolkit/chat/__init__.py,sha256=LRs2G-JTVuci4lbtHTkVUiNcZcSR6uqqfnAyo7af6nY,619
|
15
|
+
unique_toolkit/chat/constants.py,sha256=05kq6zjqUVB2d6_P7s-90nbljpB3ryxwCI-CAz0r2O4,83
|
16
|
+
unique_toolkit/chat/functions.py,sha256=CtlvrwYWUQ7_wSQyAXf8jnARv0P-Ffh1gx2JJzISvvI,22231
|
17
|
+
unique_toolkit/chat/schemas.py,sha256=MNcGAXjK1K8zOODeMFz3FHVQL5sIBQXRwkr_2hFkG8k,2672
|
18
|
+
unique_toolkit/chat/service.py,sha256=abBHpPonQYA408c_Z-WNmnROzMmYNUL55D6ek3iDubI,22048
|
19
|
+
unique_toolkit/chat/state.py,sha256=Cjgwv_2vhDFbV69xxsn7SefhaoIAEqLx3ferdVFCnOg,1445
|
20
|
+
unique_toolkit/chat/utils.py,sha256=ihm-wQykBWhB4liR3LnwPVPt_qGW6ETq21Mw4HY0THE,854
|
21
|
+
unique_toolkit/content/__init__.py,sha256=EdJg_A_7loEtCQf4cah3QARQreJx6pdz89Rm96YbMVg,940
|
22
|
+
unique_toolkit/content/constants.py,sha256=1iy4Y67xobl5VTnJB6SxSyuoBWbdLl9244xfVMUZi5o,60
|
23
|
+
unique_toolkit/content/functions.py,sha256=0589SVNyePI-8uOc-mfWHLZr7hgSqeTpz-O9Y64KWfg,15096
|
24
|
+
unique_toolkit/content/schemas.py,sha256=zks_Pkki2VhxICJJgHZyc-LPmRuj5dLbw3pgcUT7SW8,2362
|
25
|
+
unique_toolkit/content/service.py,sha256=5_4ao-K4VtF5P_dkenh8dP94Ce7Yq2ro_dPBSKNZAc4,12412
|
26
|
+
unique_toolkit/content/utils.py,sha256=GUVPrkZfMoAj4MRoBs5BD_7vSuLZTZx69hyWzYFrI50,7747
|
27
|
+
unique_toolkit/embedding/__init__.py,sha256=uUyzjonPvuDCYsvXCIt7ErQXopLggpzX-MEQd3_e2kE,250
|
28
|
+
unique_toolkit/embedding/constants.py,sha256=Lj8-Lcy1FvuC31PM9Exq7vaFuxQV4pEI1huUMFX-J2M,52
|
29
|
+
unique_toolkit/embedding/functions.py,sha256=3qp-BfuMAbnp8YB04rh3xH8vsJuCBPizoy-JeaBFtoQ,1944
|
30
|
+
unique_toolkit/embedding/schemas.py,sha256=1GvKCaSk4jixzVQ2PKq8yDqwGEVY_hWclYtoAr6CC2g,96
|
31
|
+
unique_toolkit/embedding/service.py,sha256=sCMKeFjwNrWYQic1UUW2c1jnhjRQLcDYfsBgxmR70sY,2697
|
32
|
+
unique_toolkit/embedding/utils.py,sha256=v86lo__bCJbxZBQ3OcLu5SuwT6NbFfWlcq8iyk6BuzQ,279
|
33
|
+
unique_toolkit/evaluators/__init__.py,sha256=3Rfpnowm7MUXHWmeU4UV4s_3Hk-sw3V20oBwQCYlejQ,50
|
34
|
+
unique_toolkit/evaluators/config.py,sha256=JRSHJvIjioXDMgd9hodK10J-52j3LMgJFvG0Vy7ePa8,1056
|
35
|
+
unique_toolkit/evaluators/constants.py,sha256=1oI93jsh0R_TjX_8OenliiiywVe3vTooSnaMqtq6R18,27
|
36
|
+
unique_toolkit/evaluators/context_relevancy/constants.py,sha256=jqrXqGZevlgWFnU4fqGKxjCT5oQXYVMAO4Uu44AAKmo,1126
|
37
|
+
unique_toolkit/evaluators/context_relevancy/prompts.py,sha256=gTlWP7fDuxhrXhCYNCqXMbCey_DalZMdi5l-a6RHgk0,713
|
38
|
+
unique_toolkit/evaluators/context_relevancy/service.py,sha256=9hzdMuF4A4T97-3X3zcXgrDISLn1bleZ6tTL1bHa9dQ,1722
|
39
|
+
unique_toolkit/evaluators/context_relevancy/utils.py,sha256=E9ljdRNbwYlx04fQDLvgF4SwxvlTJT0vE328PlUF6KA,5191
|
40
|
+
unique_toolkit/evaluators/exception.py,sha256=7lcVbCyoN4Md1chNJDFxpUYyWbVrcr9dcc3TxWykJTc,115
|
41
|
+
unique_toolkit/evaluators/hallucination/constants.py,sha256=DEycXlxY9h01D0iF3aU5LIdPrDJ-5OkF0VdXDLn_tSs,1440
|
42
|
+
unique_toolkit/evaluators/hallucination/prompts.py,sha256=9yCpO_WGLDvYfPWKL1VuRA-jt0P_-A-qvLUOmuv-Nks,3320
|
43
|
+
unique_toolkit/evaluators/hallucination/service.py,sha256=k8qro5Lw4Ak58m4HYp3G4HPLIaexeFySIIVvW6fAdeA,2408
|
44
|
+
unique_toolkit/evaluators/hallucination/utils.py,sha256=4KTJH8low_fBzOcuVlcHB2FRrtIiN8TR6uuU8EGwjJM,7668
|
45
|
+
unique_toolkit/evaluators/output_parser.py,sha256=eI72qkzK1dZyUvnfP2SOAQCGBj_-PwX5wy_aLPMsJMY,883
|
46
|
+
unique_toolkit/evaluators/schemas.py,sha256=Jaue6Uhx75X1CyHKWj8sT3RE1JZXTqoLtfLt2xQNCX8,2507
|
47
|
+
unique_toolkit/language_model/__init__.py,sha256=jWko_vQj48wjnpTtlkg8iNdef0SMI3FN2kGywXRTMzg,1880
|
48
|
+
unique_toolkit/language_model/builder.py,sha256=nsRqWO_2dgFehK5CgtqR5aqXgYUU0QL6mR0lALPrQXM,1898
|
49
|
+
unique_toolkit/language_model/constants.py,sha256=B-topqW0r83dkC_25DeQfnPk3n53qzIHUCBS7YJ0-1U,119
|
50
|
+
unique_toolkit/language_model/functions.py,sha256=Gvf7nYwfNvkER59KVGursOvvZj5uYBFgxQyG9fHRBJQ,12677
|
51
|
+
unique_toolkit/language_model/infos.py,sha256=NgoV05ausVWMqrYqgH6i3s7tYG7mejupROIF_bwEGZo,13050
|
52
|
+
unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
|
53
|
+
unique_toolkit/language_model/schemas.py,sha256=87511yupvea-U6sfKWfelETevNMVPevhj7mEqX5FszU,7461
|
54
|
+
unique_toolkit/language_model/service.py,sha256=IQamCLVL-k4-YifgGpwhvlPwZ81EQRpBI6eMK176ciU,12967
|
55
|
+
unique_toolkit/language_model/utils.py,sha256=bPQ4l6_YO71w-zaIPanUUmtbXC1_hCvLK0tAFc3VCRc,1902
|
56
|
+
unique_toolkit/short_term_memory/__init__.py,sha256=2mI3AUrffgH7Yt-xS57EGqnHf7jnn6xquoKEhJqk3Wg,185
|
57
|
+
unique_toolkit/short_term_memory/constants.py,sha256=698CL6-wjup2MvU19RxSmQk3gX7aqW_OOpZB7sbz_Xg,34
|
58
|
+
unique_toolkit/short_term_memory/functions.py,sha256=3WiK-xatY5nh4Dr5zlDUye1k3E6kr41RiscwtTplw5k,4484
|
59
|
+
unique_toolkit/short_term_memory/schemas.py,sha256=OhfcXyF6ACdwIXW45sKzjtZX_gkcJs8FEZXcgQTNenw,1406
|
60
|
+
unique_toolkit/short_term_memory/service.py,sha256=gdsVzoNqTXmLoBR_-p_lJlZDBo8L7Cr5EKchTNVJg1Q,5233
|
61
|
+
unique_toolkit-0.6.0.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
62
|
+
unique_toolkit-0.6.0.dist-info/METADATA,sha256=glSKhyn4h1sfvzWEDmJ1WBYYtXVwCs823B5HACP_ZJY,18600
|
63
|
+
unique_toolkit-0.6.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
64
|
+
unique_toolkit-0.6.0.dist-info/RECORD,,
|
@@ -1,50 +0,0 @@
|
|
1
|
-
unique_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
unique_toolkit/_common/_base_service.py,sha256=S8H0rAebx7GsOldA7xInLp3aQJt9yEPDQdsGSFRJsGg,276
|
3
|
-
unique_toolkit/_common/_time_utils.py,sha256=ztmTovTvr-3w71Ns2VwXC65OKUUh-sQlzbHdKTQWm-w,135
|
4
|
-
unique_toolkit/_common/exception.py,sha256=caQIE1btsQnpKCHqL2cgWUSbHup06enQu_Pt7uGUTTE,727
|
5
|
-
unique_toolkit/_common/validators.py,sha256=w5lzvRxl0sBTvv0CXLF9UwtJyKmmS2lez0KXaqapgBE,258
|
6
|
-
unique_toolkit/app/__init__.py,sha256=sZyGrz74jBlAjv6OcHgcp6VtP6-AKKpaVYjakr1Xk60,735
|
7
|
-
unique_toolkit/app/init_logging.py,sha256=Sh26SRxOj8i8dzobKhYha2lLrkrMTHfB1V4jR3h23gQ,678
|
8
|
-
unique_toolkit/app/init_sdk.py,sha256=Nv4Now4pMfM0AgRhbtatLpm_39rKxn0WmRLwmPhRl-8,1285
|
9
|
-
unique_toolkit/app/performance/async_tasks.py,sha256=H0l3OAcosLwNHZ8d2pd-Di4wHIXfclEvagi5kfqLFPA,1941
|
10
|
-
unique_toolkit/app/performance/async_wrapper.py,sha256=yVVcRDkcdyfjsxro-N29SBvi-7773wnfDplef6-y8xw,1077
|
11
|
-
unique_toolkit/app/schemas.py,sha256=6RY7Ex-B3pOnFILlitHEi9sqJvupbpdxlN9xt33qRsM,1571
|
12
|
-
unique_toolkit/app/verification.py,sha256=mffa6wm0i4hJbwzofePrkaia46xumMzECwQ0T3eKAx0,1929
|
13
|
-
unique_toolkit/chat/__init__.py,sha256=4xS-Mcv7Oqdhprw1JEqD3nwGFflla4R2o7RNJyA5Wek,537
|
14
|
-
unique_toolkit/chat/schemas.py,sha256=PJ9Am-RKxUEo6o1jQ_DV100rt8rZD59GhWTPRgZuDow,2665
|
15
|
-
unique_toolkit/chat/service.py,sha256=9sQbfwgb2GoUuDL3xoG-7P9oOEj-TAssZleXwSZ3HiY,28121
|
16
|
-
unique_toolkit/chat/state.py,sha256=Cjgwv_2vhDFbV69xxsn7SefhaoIAEqLx3ferdVFCnOg,1445
|
17
|
-
unique_toolkit/chat/utils.py,sha256=ihm-wQykBWhB4liR3LnwPVPt_qGW6ETq21Mw4HY0THE,854
|
18
|
-
unique_toolkit/content/__init__.py,sha256=MSH2sxjQyKD2Sef92fzE5Dt9SihdzivB6yliSwJfTmQ,890
|
19
|
-
unique_toolkit/content/schemas.py,sha256=zks_Pkki2VhxICJJgHZyc-LPmRuj5dLbw3pgcUT7SW8,2362
|
20
|
-
unique_toolkit/content/service.py,sha256=rznSUyOuB4nbo6bFworzFv86kzo6TVT4Nc8GMAeAJB4,17711
|
21
|
-
unique_toolkit/content/utils.py,sha256=Lake671plRsqNvO3pN_rmyVcpwbdED_KQpLcCnc4lv4,6902
|
22
|
-
unique_toolkit/embedding/__init__.py,sha256=dr8M9jvslQTxPpxgaGwzxY0FildiWf-DidN_cahPAWw,191
|
23
|
-
unique_toolkit/embedding/schemas.py,sha256=1GvKCaSk4jixzVQ2PKq8yDqwGEVY_hWclYtoAr6CC2g,96
|
24
|
-
unique_toolkit/embedding/service.py,sha256=Iiw-sbdkjuWlWMfLM9qyC4GNTJOotQAaVjkYvh5Su4Y,2370
|
25
|
-
unique_toolkit/embedding/utils.py,sha256=v86lo__bCJbxZBQ3OcLu5SuwT6NbFfWlcq8iyk6BuzQ,279
|
26
|
-
unique_toolkit/evaluators/config.py,sha256=JRSHJvIjioXDMgd9hodK10J-52j3LMgJFvG0Vy7ePa8,1056
|
27
|
-
unique_toolkit/evaluators/context_relevancy/constants.py,sha256=YErC92sqsY31cmBUG3dFQw78mUjbcpjMG7TLfYuLYmw,1051
|
28
|
-
unique_toolkit/evaluators/context_relevancy/prompts.py,sha256=gTlWP7fDuxhrXhCYNCqXMbCey_DalZMdi5l-a6RHgk0,713
|
29
|
-
unique_toolkit/evaluators/context_relevancy/service.py,sha256=9hzdMuF4A4T97-3X3zcXgrDISLn1bleZ6tTL1bHa9dQ,1722
|
30
|
-
unique_toolkit/evaluators/context_relevancy/utils.py,sha256=DCFaoxZT_qDMKirjy3hTo1DIE7HpZ7-XR5P-rHuAoHQ,5137
|
31
|
-
unique_toolkit/evaluators/exception.py,sha256=7lcVbCyoN4Md1chNJDFxpUYyWbVrcr9dcc3TxWykJTc,115
|
32
|
-
unique_toolkit/evaluators/hallucination/constants.py,sha256=DEycXlxY9h01D0iF3aU5LIdPrDJ-5OkF0VdXDLn_tSs,1440
|
33
|
-
unique_toolkit/evaluators/hallucination/prompts.py,sha256=9yCpO_WGLDvYfPWKL1VuRA-jt0P_-A-qvLUOmuv-Nks,3320
|
34
|
-
unique_toolkit/evaluators/hallucination/service.py,sha256=k8qro5Lw4Ak58m4HYp3G4HPLIaexeFySIIVvW6fAdeA,2408
|
35
|
-
unique_toolkit/evaluators/hallucination/utils.py,sha256=507BsX1mFTEne1-LdRCNMgBj-IXSFvBj1t3BPe1UkGs,7639
|
36
|
-
unique_toolkit/evaluators/output_parser.py,sha256=eI72qkzK1dZyUvnfP2SOAQCGBj_-PwX5wy_aLPMsJMY,883
|
37
|
-
unique_toolkit/evaluators/schemas.py,sha256=Jaue6Uhx75X1CyHKWj8sT3RE1JZXTqoLtfLt2xQNCX8,2507
|
38
|
-
unique_toolkit/language_model/__init__.py,sha256=hgk5yiFF4SpIcE2QSoki9YknFxmcKnq2LCJ1cK9de9I,1830
|
39
|
-
unique_toolkit/language_model/builder.py,sha256=nsRqWO_2dgFehK5CgtqR5aqXgYUU0QL6mR0lALPrQXM,1898
|
40
|
-
unique_toolkit/language_model/infos.py,sha256=NgoV05ausVWMqrYqgH6i3s7tYG7mejupROIF_bwEGZo,13050
|
41
|
-
unique_toolkit/language_model/prompt.py,sha256=JSawaLjQg3VR-E2fK8engFyJnNdk21zaO8pPIodzN4Q,3991
|
42
|
-
unique_toolkit/language_model/schemas.py,sha256=87511yupvea-U6sfKWfelETevNMVPevhj7mEqX5FszU,7461
|
43
|
-
unique_toolkit/language_model/service.py,sha256=m4B4YD4wxfU8HNo_stqbfnlKXziYBAwqtny4kRtywks,17837
|
44
|
-
unique_toolkit/language_model/utils.py,sha256=bPQ4l6_YO71w-zaIPanUUmtbXC1_hCvLK0tAFc3VCRc,1902
|
45
|
-
unique_toolkit/short_term_memory/schemas.py,sha256=OhfcXyF6ACdwIXW45sKzjtZX_gkcJs8FEZXcgQTNenw,1406
|
46
|
-
unique_toolkit/short_term_memory/service.py,sha256=Jd9P72-VvJy7hnqNrjmrmB5BHmsKuOpTiT0Jr-dBbsQ,1682
|
47
|
-
unique_toolkit-0.5.54.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
48
|
-
unique_toolkit-0.5.54.dist-info/METADATA,sha256=fBDEMTvpTOsZcFG_BLkmTj9tv3O7fVNY67Gr7BIxFwM,16475
|
49
|
-
unique_toolkit-0.5.54.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
50
|
-
unique_toolkit-0.5.54.dist-info/RECORD,,
|
File without changes
|
File without changes
|