unique_toolkit 0.5.32__py3-none-any.whl → 0.5.35__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/app/schemas.py +1 -0
- unique_toolkit/content/service.py +15 -12
- unique_toolkit/language_model/schemas.py +5 -0
- {unique_toolkit-0.5.32.dist-info → unique_toolkit-0.5.35.dist-info}/METADATA +10 -1
- {unique_toolkit-0.5.32.dist-info → unique_toolkit-0.5.35.dist-info}/RECORD +7 -7
- {unique_toolkit-0.5.32.dist-info → unique_toolkit-0.5.35.dist-info}/LICENSE +0 -0
- {unique_toolkit-0.5.32.dist-info → unique_toolkit-0.5.35.dist-info}/WHEEL +0 -0
unique_toolkit/app/schemas.py
CHANGED
@@ -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 = {}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_toolkit
|
3
|
-
Version: 0.5.
|
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
|
|
@@ -8,7 +8,7 @@ unique_toolkit/app/init_logging.py,sha256=Sh26SRxOj8i8dzobKhYha2lLrkrMTHfB1V4jR3
|
|
8
8
|
unique_toolkit/app/init_sdk.py,sha256=Nv4Now4pMfM0AgRhbtatLpm_39rKxn0WmRLwmPhRl-8,1285
|
9
9
|
unique_toolkit/app/performance/async_tasks.py,sha256=H0l3OAcosLwNHZ8d2pd-Di4wHIXfclEvagi5kfqLFPA,1941
|
10
10
|
unique_toolkit/app/performance/async_wrapper.py,sha256=yVVcRDkcdyfjsxro-N29SBvi-7773wnfDplef6-y8xw,1077
|
11
|
-
unique_toolkit/app/schemas.py,sha256=
|
11
|
+
unique_toolkit/app/schemas.py,sha256=6RY7Ex-B3pOnFILlitHEi9sqJvupbpdxlN9xt33qRsM,1571
|
12
12
|
unique_toolkit/app/verification.py,sha256=UZqTHg3PX_QxMjeLH_BVBYoMVqMnMpeMoqvyTBKDqj8,1996
|
13
13
|
unique_toolkit/chat/__init__.py,sha256=1prdTVfLOf6NgU-Aa1VIO-XiR6OYuRm51LaVRfKDCqc,267
|
14
14
|
unique_toolkit/chat/schemas.py,sha256=IHOnb3pWlRlSPoEUWBTl6LK8YeMdlg2iXi9ghyBeiLw,1495
|
@@ -17,7 +17,7 @@ unique_toolkit/chat/state.py,sha256=Cjgwv_2vhDFbV69xxsn7SefhaoIAEqLx3ferdVFCnOg,
|
|
17
17
|
unique_toolkit/chat/utils.py,sha256=ihm-wQykBWhB4liR3LnwPVPt_qGW6ETq21Mw4HY0THE,854
|
18
18
|
unique_toolkit/content/__init__.py,sha256=MSH2sxjQyKD2Sef92fzE5Dt9SihdzivB6yliSwJfTmQ,890
|
19
19
|
unique_toolkit/content/schemas.py,sha256=zks_Pkki2VhxICJJgHZyc-LPmRuj5dLbw3pgcUT7SW8,2362
|
20
|
-
unique_toolkit/content/service.py,sha256=
|
20
|
+
unique_toolkit/content/service.py,sha256=YClD-johtUe8rjeWgsUo-HUGgNEBhk_74Go1iMJ2oak,14282
|
21
21
|
unique_toolkit/content/utils.py,sha256=Lake671plRsqNvO3pN_rmyVcpwbdED_KQpLcCnc4lv4,6902
|
22
22
|
unique_toolkit/embedding/__init__.py,sha256=dr8M9jvslQTxPpxgaGwzxY0FildiWf-DidN_cahPAWw,191
|
23
23
|
unique_toolkit/embedding/schemas.py,sha256=1GvKCaSk4jixzVQ2PKq8yDqwGEVY_hWclYtoAr6CC2g,96
|
@@ -37,10 +37,10 @@ unique_toolkit/evaluators/output_parser.py,sha256=eI72qkzK1dZyUvnfP2SOAQCGBj_-Pw
|
|
37
37
|
unique_toolkit/evaluators/schemas.py,sha256=Jaue6Uhx75X1CyHKWj8sT3RE1JZXTqoLtfLt2xQNCX8,2507
|
38
38
|
unique_toolkit/language_model/__init__.py,sha256=YuhyczGPj6w9xX-sOVUhmozvzIFxcckHFEkeMBecr5s,1784
|
39
39
|
unique_toolkit/language_model/infos.py,sha256=kQK6F3r8xTN7oT6b39J7rxW-Y4iPXjx_Fr9bCOVQdm0,12509
|
40
|
-
unique_toolkit/language_model/schemas.py,sha256=
|
40
|
+
unique_toolkit/language_model/schemas.py,sha256=0pMLM1cCplw1OlM-eLqldZtYMObGr7tjHKXSHQP7hwE,6216
|
41
41
|
unique_toolkit/language_model/service.py,sha256=s5X6EStyYumiYqlD9gkW4GANif18d9QZOMysmUSfv8M,13433
|
42
42
|
unique_toolkit/language_model/utils.py,sha256=WBPj1XKkDgxy_-T8HCZvsfkkSzj_1w4UZzNmyvdbBLY,1081
|
43
|
-
unique_toolkit-0.5.
|
44
|
-
unique_toolkit-0.5.
|
45
|
-
unique_toolkit-0.5.
|
46
|
-
unique_toolkit-0.5.
|
43
|
+
unique_toolkit-0.5.35.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
|
44
|
+
unique_toolkit-0.5.35.dist-info/METADATA,sha256=2FdoeyNYUy50Szp_YldFsdkaqluyWwC6cuqIn8kS5Tg,13444
|
45
|
+
unique_toolkit-0.5.35.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
46
|
+
unique_toolkit-0.5.35.dist-info/RECORD,,
|
File without changes
|
File without changes
|