fabricatio 0.2.7.dev4__cp312-cp312-win_amd64.whl → 0.2.8.dev0__cp312-cp312-win_amd64.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.
- fabricatio/_rust.cp312-win_amd64.pyd +0 -0
- fabricatio/actions/article.py +97 -73
- fabricatio/actions/output.py +36 -1
- fabricatio/capabilities/correct.py +26 -6
- fabricatio/models/action.py +2 -0
- fabricatio/models/extra/article_base.py +279 -89
- fabricatio/models/extra/article_main.py +35 -126
- fabricatio/models/extra/article_outline.py +6 -155
- fabricatio/models/extra/article_proposal.py +12 -14
- fabricatio/models/generic.py +71 -20
- fabricatio/models/usages.py +5 -1
- fabricatio-0.2.8.dev0.data/scripts/tdown.exe +0 -0
- {fabricatio-0.2.7.dev4.dist-info → fabricatio-0.2.8.dev0.dist-info}/METADATA +1 -1
- {fabricatio-0.2.7.dev4.dist-info → fabricatio-0.2.8.dev0.dist-info}/RECORD +16 -16
- fabricatio-0.2.7.dev4.data/scripts/tdown.exe +0 -0
- {fabricatio-0.2.7.dev4.dist-info → fabricatio-0.2.8.dev0.dist-info}/WHEEL +0 -0
- {fabricatio-0.2.7.dev4.dist-info → fabricatio-0.2.8.dev0.dist-info}/licenses/LICENSE +0 -0
fabricatio/models/usages.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
"""This module contains classes that manage the usage of language models and tools in tasks."""
|
2
2
|
|
3
|
+
import traceback
|
3
4
|
from asyncio import gather
|
4
5
|
from typing import Callable, Dict, Iterable, List, Optional, Self, Sequence, Set, Type, Union, Unpack, overload
|
5
6
|
|
@@ -38,6 +39,8 @@ ROUTER = Router(
|
|
38
39
|
allowed_fails=configs.routing.allowed_fails,
|
39
40
|
retry_after=configs.routing.retry_after,
|
40
41
|
cooldown_time=configs.routing.cooldown_time,
|
42
|
+
cache_responses=configs.cache.enabled,
|
43
|
+
cache_kwargs=configs.cache.params,
|
41
44
|
)
|
42
45
|
|
43
46
|
|
@@ -135,7 +138,7 @@ class LLMUsage(ScopedConfig):
|
|
135
138
|
List[Choices | StreamingChoices]: A list of choices or streaming choices from the model response.
|
136
139
|
"""
|
137
140
|
resp = await self.aquery(
|
138
|
-
messages=Messages().add_system_message(system_message).add_user_message(question),
|
141
|
+
messages=Messages().add_system_message(system_message).add_user_message(question).as_list(),
|
139
142
|
n=n,
|
140
143
|
**kwargs,
|
141
144
|
)
|
@@ -324,6 +327,7 @@ class LLMUsage(ScopedConfig):
|
|
324
327
|
continue
|
325
328
|
except Exception as e: # noqa: BLE001
|
326
329
|
logger.error(f"Error during validation: \n{e}")
|
330
|
+
logger.debug(traceback.format_exc())
|
327
331
|
break
|
328
332
|
if not kwargs.get("no_cache"):
|
329
333
|
kwargs["no_cache"] = True
|
Binary file
|
@@ -1,11 +1,11 @@
|
|
1
|
-
fabricatio-0.2.
|
2
|
-
fabricatio-0.2.
|
3
|
-
fabricatio-0.2.
|
4
|
-
fabricatio/actions/article.py,sha256=
|
1
|
+
fabricatio-0.2.8.dev0.dist-info/METADATA,sha256=coMH1ZINCPxofmsl4UlmFGMsJRrE_Xx_9fzKOQcKSTY,5259
|
2
|
+
fabricatio-0.2.8.dev0.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
|
3
|
+
fabricatio-0.2.8.dev0.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
|
4
|
+
fabricatio/actions/article.py,sha256=2e96lVsk2WR9VsjRc3mE8cOUvEgdhE36kL4x_WxdJWk,8313
|
5
5
|
fabricatio/actions/article_rag.py,sha256=PiOFxI6VTmLXm3BK-01g_KH1mTE9uOtnA-CwUjt16AU,1456
|
6
|
-
fabricatio/actions/output.py,sha256=
|
6
|
+
fabricatio/actions/output.py,sha256=eHI4EH5n1nOt6MqQ00b7UWTjIqO8FerNakem_45d5qk,2315
|
7
7
|
fabricatio/actions/rag.py,sha256=QBdzEM8MloM_ahx5pTBZAETm9_631lTe_0ih_he_Iuo,2759
|
8
|
-
fabricatio/capabilities/correct.py,sha256=
|
8
|
+
fabricatio/capabilities/correct.py,sha256=2093ggHkY8vQW8fl7VwXC8u39oW1xsfjxDjGoQ5puOA,7269
|
9
9
|
fabricatio/capabilities/propose.py,sha256=y3kge5g6bb8HYuV8e9h4MdqOMTlsfAIZpqE_cagWPTY,1593
|
10
10
|
fabricatio/capabilities/rag.py,sha256=XVvfH6rcog-moj1WCgwtR-l0-NdbFR6-fMQFLG7_asY,17690
|
11
11
|
fabricatio/capabilities/rating.py,sha256=yEPqL5_DqVMj_AH9cMvKsHdMnSbvm8dN6PaKHLsJUPQ,14904
|
@@ -18,19 +18,19 @@ fabricatio/fs/curd.py,sha256=N6l2MncjrFfnXBRtteRouXp5Rjy8EAKC_i29_G-zz98,4618
|
|
18
18
|
fabricatio/fs/readers.py,sha256=EZKN_AZdrp8DggJECP53QHw3uHeSDf-AwCAA_V7fNKU,1202
|
19
19
|
fabricatio/fs/__init__.py,sha256=PCf0s_9KDjVfNw7AfPoJzGt3jMq4gJOfbcT4pb0D0ZY,588
|
20
20
|
fabricatio/journal.py,sha256=stnEP88aUBA_GmU9gfTF2EZI8FS2OyMLGaMSTgK4QgA,476
|
21
|
-
fabricatio/models/action.py,sha256=
|
21
|
+
fabricatio/models/action.py,sha256=FcgZPneEFQTgK2eEvafo2FvnGnqM5G8HytPddqHrq8A,8880
|
22
22
|
fabricatio/models/events.py,sha256=QvlnS8FEELg6KNabcJMeh2GV_y0ZBzKOPphcteKYWYU,4183
|
23
|
-
fabricatio/models/extra/article_base.py,sha256=
|
23
|
+
fabricatio/models/extra/article_base.py,sha256=SwFiSyGHU7n5cD1B3eN2UjrZjW_pXgYI4zelxsdcTCI,15270
|
24
24
|
fabricatio/models/extra/article_essence.py,sha256=DUESuK4CGgkRvIMoJCv4l8MNp5MawRYoNOtLCrFRPXY,9229
|
25
|
-
fabricatio/models/extra/article_main.py,sha256=
|
26
|
-
fabricatio/models/extra/article_outline.py,sha256=
|
27
|
-
fabricatio/models/extra/article_proposal.py,sha256=
|
28
|
-
fabricatio/models/generic.py,sha256=
|
25
|
+
fabricatio/models/extra/article_main.py,sha256=S-Bu91KYQB7Ep5yMTUBmpI54RFjq_emM8MoIFyVEROQ,7721
|
26
|
+
fabricatio/models/extra/article_outline.py,sha256=pIsO5bOSV-SUeWWdhkfkVpcr9RPOHgYmsceHsrXs67M,1145
|
27
|
+
fabricatio/models/extra/article_proposal.py,sha256=DWn3MQUNQlXj9Fcm3xSONyxARz8goAroJUA6pWvBhHw,1398
|
28
|
+
fabricatio/models/generic.py,sha256=nyfhgaIEsSvbDvcHrjULEgseBKRzZx2t21lfncwCsq4,19225
|
29
29
|
fabricatio/models/kwargs_types.py,sha256=chJ-rHaeBVRUPuORHuGR3DdNxxTUrotz0eflPEh4l4w,5474
|
30
30
|
fabricatio/models/role.py,sha256=mmQbJ6GKr2Gx3wtjEz8d-vYoXs09ffcEkT_eCXaDd3E,2782
|
31
31
|
fabricatio/models/task.py,sha256=8NaR7ojQWyM740EDTqt9stwHKdrD6axCRpLKo0QzS-I,10492
|
32
32
|
fabricatio/models/tool.py,sha256=kD0eB7OxO9geZOxO6JIKvCBeG-KOpRAkfRZqK_WGfW4,7105
|
33
|
-
fabricatio/models/usages.py,sha256=
|
33
|
+
fabricatio/models/usages.py,sha256=BZXHdm198wMOaYvCqL7wBcSzAHUMS4mYeD_VCi08mmY,31736
|
34
34
|
fabricatio/models/utils.py,sha256=yjxPZ6N7QGpGwkI_Vb28Ud3EhkdlB-tyfGRHAZMcGxs,5872
|
35
35
|
fabricatio/parser.py,sha256=9Jzw-yV6uKbFvf6sPna-XHdziVGVBZWvPctgX_6ODL8,6251
|
36
36
|
fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -42,6 +42,6 @@ fabricatio/workflows/rag.py,sha256=-YYp2tlE9Vtfgpg6ROpu6QVO8j8yVSPa6yDzlN3qVxs,5
|
|
42
42
|
fabricatio/_rust.pyi,sha256=dGTGV7viu3YAGl1cRKIWrdHPc1hlwk3_hbaDaswxdVo,3831
|
43
43
|
fabricatio/_rust_instances.py,sha256=2GwF8aVfYNemRI2feBzH1CZfBGno-XJJE5imJokGEYw,314
|
44
44
|
fabricatio/__init__.py,sha256=SzBYsRhZeL77jLtfJEjmoHOSwHwUGyvMATX6xfndLDM,1135
|
45
|
-
fabricatio/_rust.cp312-win_amd64.pyd,sha256=
|
46
|
-
fabricatio-0.2.
|
47
|
-
fabricatio-0.2.
|
45
|
+
fabricatio/_rust.cp312-win_amd64.pyd,sha256=1wV10H3_yuAX2eZTIXTI1mhpTASH3dN491GXUBLKtDE,1830912
|
46
|
+
fabricatio-0.2.8.dev0.data/scripts/tdown.exe,sha256=fEInXr-uYE9QwK0N2CINOHDjc22Odu_DY9Dk2JPDIg8,3399680
|
47
|
+
fabricatio-0.2.8.dev0.dist-info/RECORD,,
|
Binary file
|
File without changes
|
File without changes
|