fabricatio 0.3.14.dev2__cp312-cp312-win_amd64.whl → 0.3.14.dev5__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/__init__.py +5 -5
- fabricatio/models/action.py +2 -2
- fabricatio/models/extra/article_base.py +4 -4
- fabricatio/models/extra/article_main.py +3 -3
- fabricatio/models/tool.py +3 -4
- fabricatio/models/usages.py +7 -3
- fabricatio/rust.cp312-win_amd64.pyd +0 -0
- fabricatio/rust.pyi +65 -25
- fabricatio-0.3.14.dev5.data/scripts/tdown.exe +0 -0
- fabricatio-0.3.14.dev5.data/scripts/ttm.exe +0 -0
- {fabricatio-0.3.14.dev2.dist-info → fabricatio-0.3.14.dev5.dist-info}/METADATA +3 -7
- {fabricatio-0.3.14.dev2.dist-info → fabricatio-0.3.14.dev5.dist-info}/RECORD +14 -14
- fabricatio-0.3.14.dev2.data/scripts/tdown.exe +0 -0
- fabricatio-0.3.14.dev2.data/scripts/ttm.exe +0 -0
- {fabricatio-0.3.14.dev2.dist-info → fabricatio-0.3.14.dev5.dist-info}/WHEEL +0 -0
- {fabricatio-0.3.14.dev2.dist-info → fabricatio-0.3.14.dev5.dist-info}/licenses/LICENSE +0 -0
fabricatio/__init__.py
CHANGED
@@ -1,19 +1,17 @@
|
|
1
1
|
"""Fabricatio is a Python library for building llm app using event-based agent structure."""
|
2
2
|
|
3
|
-
from fabricatio import actions, capabilities, parser, toolboxes, workflows
|
3
|
+
from fabricatio import actions, capabilities, fs, models, parser, toolboxes, utils, workflows
|
4
4
|
from fabricatio.journal import logger
|
5
|
-
from fabricatio.models import extra
|
6
5
|
from fabricatio.models.action import Action, WorkFlow
|
7
6
|
from fabricatio.models.role import Role
|
8
7
|
from fabricatio.models.task import Task
|
9
8
|
from fabricatio.models.tool import ToolBox
|
10
|
-
from fabricatio.rust import CONFIG, TEMPLATE_MANAGER,
|
9
|
+
from fabricatio.rust import CONFIG, TEMPLATE_MANAGER, Event
|
11
10
|
|
12
11
|
__all__ = [
|
13
12
|
"CONFIG",
|
14
13
|
"TEMPLATE_MANAGER",
|
15
14
|
"Action",
|
16
|
-
"BibManager",
|
17
15
|
"Event",
|
18
16
|
"Role",
|
19
17
|
"Task",
|
@@ -21,9 +19,11 @@ __all__ = [
|
|
21
19
|
"WorkFlow",
|
22
20
|
"actions",
|
23
21
|
"capabilities",
|
24
|
-
"
|
22
|
+
"fs",
|
25
23
|
"logger",
|
24
|
+
"models",
|
26
25
|
"parser",
|
27
26
|
"toolboxes",
|
27
|
+
"utils",
|
28
28
|
"workflows",
|
29
29
|
]
|
fabricatio/models/action.py
CHANGED
@@ -125,10 +125,10 @@ class WorkFlow(WithBriefing):
|
|
125
125
|
steps: Sequence[Union[Type[Action], Action]] = Field(frozen=True)
|
126
126
|
"""The sequence of actions to be executed, can be action classes or instances."""
|
127
127
|
|
128
|
-
task_input_key: ClassVar[str] =
|
128
|
+
task_input_key: ClassVar[str] = INPUT_KEY
|
129
129
|
"""Key used to store the input task in the context dictionary."""
|
130
130
|
|
131
|
-
task_output_key: ClassVar[str] =
|
131
|
+
task_output_key: ClassVar[str] = OUTPUT_KEY
|
132
132
|
"""Key used to extract the final result from the context dictionary."""
|
133
133
|
|
134
134
|
extra_init_context: Dict[str, Any] = Field(default_factory=dict, frozen=True)
|
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
from abc import ABC
|
4
4
|
from enum import StrEnum
|
5
|
+
from fabricatio.rust import extract_body, replace_thesis_body, split_out_metadata, to_metadata, word_count
|
5
6
|
from pathlib import Path
|
7
|
+
from pydantic import Field
|
6
8
|
from typing import ClassVar, Generator, List, Optional, Self, Tuple, Type
|
7
9
|
|
8
10
|
from fabricatio.capabilities.persist import PersistentAble
|
@@ -21,9 +23,7 @@ from fabricatio.models.generic import (
|
|
21
23
|
Titled,
|
22
24
|
WordCount,
|
23
25
|
)
|
24
|
-
from fabricatio.rust import extract_body, inplace_update, split_out_metadata, to_metadata, word_count
|
25
26
|
from fabricatio.utils import fallback_kwargs, ok
|
26
|
-
from pydantic import Field
|
27
27
|
|
28
28
|
ARTICLE_WRAPPER = "// =-=-=-=-=-=-=-=-=-="
|
29
29
|
|
@@ -275,7 +275,7 @@ class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, FromTypstCode, To
|
|
275
275
|
)
|
276
276
|
|
277
277
|
def iter_dfs_rev(
|
278
|
-
|
278
|
+
self,
|
279
279
|
) -> Generator[ArticleOutlineBase, None, None]:
|
280
280
|
"""Performs a depth-first search (DFS) through the article structure in reverse order.
|
281
281
|
|
@@ -405,7 +405,7 @@ class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, FromTypstCode, To
|
|
405
405
|
"""Update the article file."""
|
406
406
|
file = Path(file)
|
407
407
|
string = safe_text_read(file)
|
408
|
-
if updated :=
|
408
|
+
if updated := replace_thesis_body(string, ARTICLE_WRAPPER, self.to_typst_code()):
|
409
409
|
dump_text(file, updated)
|
410
410
|
logger.success(f"Successfully updated {file.as_posix()}.")
|
411
411
|
else:
|
@@ -27,7 +27,7 @@ from fabricatio.rust import (
|
|
27
27
|
)
|
28
28
|
from pydantic import Field, NonNegativeInt
|
29
29
|
|
30
|
-
PARAGRAPH_SEP = "
|
30
|
+
PARAGRAPH_SEP = "// - - -"
|
31
31
|
|
32
32
|
|
33
33
|
class Paragraph(SketchedAble, WordCount, Described):
|
@@ -50,7 +50,7 @@ class Paragraph(SketchedAble, WordCount, Described):
|
|
50
50
|
@classmethod
|
51
51
|
def from_content(cls, content: str) -> Self:
|
52
52
|
"""Create a Paragraph object from the given content."""
|
53
|
-
return cls(elaboration="", aims=[], expected_word_count=word_count(content), content=content)
|
53
|
+
return cls(elaboration="", aims=[], expected_word_count=word_count(content), content=content.strip())
|
54
54
|
|
55
55
|
@property
|
56
56
|
def exact_wordcount(self) -> int:
|
@@ -103,7 +103,7 @@ class ArticleSubsection(SubSectionBase):
|
|
103
103
|
Returns:
|
104
104
|
str: Typst code snippet for rendering.
|
105
105
|
"""
|
106
|
-
return super().to_typst_code() + PARAGRAPH_SEP.join(p.content for p in self.paragraphs)
|
106
|
+
return super().to_typst_code() + f"\n\n{PARAGRAPH_SEP}\n\n".join(p.content for p in self.paragraphs)
|
107
107
|
|
108
108
|
@classmethod
|
109
109
|
def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
|
fabricatio/models/tool.py
CHANGED
@@ -12,9 +12,9 @@ from typing import Any, Callable, Dict, List, Optional, Self, cast, overload
|
|
12
12
|
|
13
13
|
from fabricatio.decorators import logging_execution_info, use_temp_module
|
14
14
|
from fabricatio.journal import logger
|
15
|
-
from fabricatio.models.generic import WithBriefing
|
15
|
+
from fabricatio.models.generic import Base, WithBriefing
|
16
16
|
from fabricatio.rust import CONFIG
|
17
|
-
from pydantic import
|
17
|
+
from pydantic import Field
|
18
18
|
|
19
19
|
|
20
20
|
class Tool[**P, R](WithBriefing):
|
@@ -181,7 +181,7 @@ class ToolBox(WithBriefing):
|
|
181
181
|
return hash(self.briefing)
|
182
182
|
|
183
183
|
|
184
|
-
class ToolExecutor(
|
184
|
+
class ToolExecutor(Base):
|
185
185
|
"""A class representing a tool executor with a sequence of tools to execute.
|
186
186
|
|
187
187
|
This class manages a sequence of tools and provides methods to inject tools and data into a module, execute the tools,
|
@@ -192,7 +192,6 @@ class ToolExecutor(BaseModel):
|
|
192
192
|
data (Dict[str, Any]): The data that could be used when invoking the tools.
|
193
193
|
"""
|
194
194
|
|
195
|
-
model_config = ConfigDict(use_attribute_docstrings=True)
|
196
195
|
candidates: List[Tool] = Field(default_factory=list, frozen=True)
|
197
196
|
"""The sequence of tools to execute."""
|
198
197
|
|
fabricatio/models/usages.py
CHANGED
@@ -6,7 +6,6 @@ from asyncio import gather
|
|
6
6
|
from typing import Callable, Dict, Iterable, List, Literal, Optional, Self, Sequence, Set, Union, Unpack, overload
|
7
7
|
|
8
8
|
import asyncstdlib
|
9
|
-
import litellm
|
10
9
|
from fabricatio.decorators import logging_exec_time
|
11
10
|
from fabricatio.journal import logger
|
12
11
|
from fabricatio.models.generic import ScopedConfig, WithBriefing
|
@@ -15,7 +14,12 @@ from fabricatio.models.task import Task
|
|
15
14
|
from fabricatio.models.tool import Tool, ToolBox
|
16
15
|
from fabricatio.rust import CONFIG, TEMPLATE_MANAGER
|
17
16
|
from fabricatio.utils import first_available, ok
|
18
|
-
from litellm import
|
17
|
+
from litellm import ( # pyright: ignore [reportPrivateImportUsage]
|
18
|
+
RateLimitError,
|
19
|
+
Router,
|
20
|
+
aembedding,
|
21
|
+
stream_chunk_builder,
|
22
|
+
)
|
19
23
|
from litellm.types.router import Deployment, LiteLLM_Params, ModelInfo
|
20
24
|
from litellm.types.utils import (
|
21
25
|
Choices,
|
@@ -534,7 +538,7 @@ class EmbeddingUsage(LLMUsage, ABC):
|
|
534
538
|
logger.error(err := f"Input text exceeds maximum sequence length {max_len}, got {length}.")
|
535
539
|
raise ValueError(err)
|
536
540
|
|
537
|
-
return await
|
541
|
+
return await aembedding(
|
538
542
|
input=input_text,
|
539
543
|
caching=caching or self.embedding_caching or CONFIG.embedding.caching,
|
540
544
|
dimensions=dimensions or self.embedding_dimensions or CONFIG.embedding.dimensions,
|
Binary file
|
fabricatio/rust.pyi
CHANGED
@@ -12,9 +12,9 @@ Key Features:
|
|
12
12
|
"""
|
13
13
|
|
14
14
|
from enum import StrEnum
|
15
|
+
from pydantic import JsonValue
|
15
16
|
from typing import Any, Dict, List, Literal, Optional, Self, Tuple, Union, overload
|
16
17
|
|
17
|
-
from pydantic import JsonValue
|
18
18
|
|
19
19
|
class TemplateManager:
|
20
20
|
"""Template rendering engine using Handlebars templates.
|
@@ -47,8 +47,10 @@ class TemplateManager:
|
|
47
47
|
|
48
48
|
@overload
|
49
49
|
def render_template(self, name: str, data: Dict[str, Any]) -> str: ...
|
50
|
+
|
50
51
|
@overload
|
51
52
|
def render_template(self, name: str, data: List[Dict[str, Any]]) -> List[str]: ...
|
53
|
+
|
52
54
|
def render_template(self, name: str, data: Dict[str, Any] | List[Dict[str, Any]]) -> str | List[str]:
|
53
55
|
"""Render a template with context data.
|
54
56
|
|
@@ -65,8 +67,10 @@ class TemplateManager:
|
|
65
67
|
|
66
68
|
@overload
|
67
69
|
def render_template_raw(self, template: str, data: Dict[str, Any]) -> str: ...
|
70
|
+
|
68
71
|
@overload
|
69
72
|
def render_template_raw(self, template: str, data: List[Dict[str, Any]]) -> List[str]: ...
|
73
|
+
|
70
74
|
def render_template_raw(self, template: str, data: Dict[str, Any] | List[Dict[str, Any]]) -> str | List[str]:
|
71
75
|
"""Render a template with context data.
|
72
76
|
|
@@ -78,6 +82,7 @@ class TemplateManager:
|
|
78
82
|
Rendered template content as string or list of strings
|
79
83
|
"""
|
80
84
|
|
85
|
+
|
81
86
|
class BibManager:
|
82
87
|
"""BibTeX bibliography manager for parsing and querying citation data."""
|
83
88
|
|
@@ -186,6 +191,7 @@ class BibManager:
|
|
186
191
|
Field value if found, None otherwise
|
187
192
|
"""
|
188
193
|
|
194
|
+
|
189
195
|
def blake3_hash(content: bytes) -> str:
|
190
196
|
"""Calculate the BLAKE3 cryptographic hash of data.
|
191
197
|
|
@@ -196,9 +202,11 @@ def blake3_hash(content: bytes) -> str:
|
|
196
202
|
Hex-encoded BLAKE3 hash string
|
197
203
|
"""
|
198
204
|
|
205
|
+
|
199
206
|
def detect_language(string: str) -> str:
|
200
207
|
"""Detect the language of a given string."""
|
201
208
|
|
209
|
+
|
202
210
|
def split_word_bounds(string: str) -> List[str]:
|
203
211
|
"""Split the string into words based on word boundaries.
|
204
212
|
|
@@ -209,6 +217,7 @@ def split_word_bounds(string: str) -> List[str]:
|
|
209
217
|
A list of words extracted from the string.
|
210
218
|
"""
|
211
219
|
|
220
|
+
|
212
221
|
def split_sentence_bounds(string: str) -> List[str]:
|
213
222
|
"""Split the string into sentences based on sentence boundaries.
|
214
223
|
|
@@ -219,6 +228,7 @@ def split_sentence_bounds(string: str) -> List[str]:
|
|
219
228
|
A list of sentences extracted from the string.
|
220
229
|
"""
|
221
230
|
|
231
|
+
|
222
232
|
def split_into_chunks(string: str, max_chunk_size: int, max_overlapping_rate: float = 0.3) -> List[str]:
|
223
233
|
"""Split the string into chunks of a specified size.
|
224
234
|
|
@@ -231,6 +241,7 @@ def split_into_chunks(string: str, max_chunk_size: int, max_overlapping_rate: fl
|
|
231
241
|
A list of chunks extracted from the string.
|
232
242
|
"""
|
233
243
|
|
244
|
+
|
234
245
|
def word_count(string: str) -> int:
|
235
246
|
"""Count the number of words in the string.
|
236
247
|
|
@@ -241,51 +252,67 @@ def word_count(string: str) -> int:
|
|
241
252
|
The number of words in the string.
|
242
253
|
"""
|
243
254
|
|
255
|
+
|
244
256
|
def is_chinese(string: str) -> bool:
|
245
257
|
"""Check if the given string is in Chinese."""
|
246
258
|
|
259
|
+
|
247
260
|
def is_english(string: str) -> bool:
|
248
261
|
"""Check if the given string is in English."""
|
249
262
|
|
263
|
+
|
250
264
|
def is_japanese(string: str) -> bool:
|
251
265
|
"""Check if the given string is in Japanese."""
|
252
266
|
|
267
|
+
|
253
268
|
def is_korean(string: str) -> bool:
|
254
269
|
"""Check if the given string is in Korean."""
|
255
270
|
|
271
|
+
|
256
272
|
def is_arabic(string: str) -> bool:
|
257
273
|
"""Check if the given string is in Arabic."""
|
258
274
|
|
275
|
+
|
259
276
|
def is_russian(string: str) -> bool:
|
260
277
|
"""Check if the given string is in Russian."""
|
261
278
|
|
279
|
+
|
262
280
|
def is_german(string: str) -> bool:
|
263
281
|
"""Check if the given string is in German."""
|
264
282
|
|
283
|
+
|
265
284
|
def is_french(string: str) -> bool:
|
266
285
|
"""Check if the given string is in French."""
|
267
286
|
|
287
|
+
|
268
288
|
def is_hindi(string: str) -> bool:
|
269
289
|
"""Check if the given string is in Hindi."""
|
270
290
|
|
291
|
+
|
271
292
|
def is_italian(string: str) -> bool:
|
272
293
|
"""Check if the given string is in Italian."""
|
273
294
|
|
295
|
+
|
274
296
|
def is_dutch(string: str) -> bool:
|
275
297
|
"""Check if the given string is in Dutch."""
|
276
298
|
|
299
|
+
|
277
300
|
def is_portuguese(string: str) -> bool:
|
278
301
|
"""Check if the given string is in Portuguese."""
|
279
302
|
|
303
|
+
|
280
304
|
def is_swedish(string: str) -> bool:
|
281
305
|
"""Check if the given string is in Swedish."""
|
282
306
|
|
307
|
+
|
283
308
|
def is_turkish(string: str) -> bool:
|
284
309
|
"""Check if the given string is in Turkish."""
|
285
310
|
|
311
|
+
|
286
312
|
def is_vietnamese(string: str) -> bool:
|
287
313
|
"""Check if the given string is in Vietnamese."""
|
288
314
|
|
315
|
+
|
289
316
|
def tex_to_typst(string: str) -> str:
|
290
317
|
"""Convert TeX to Typst.
|
291
318
|
|
@@ -296,26 +323,19 @@ def tex_to_typst(string: str) -> str:
|
|
296
323
|
The converted Typst string.
|
297
324
|
"""
|
298
325
|
|
299
|
-
def convert_all_inline_tex(string: str) -> str:
|
300
|
-
"""Convert all inline TeX code in the string.
|
301
326
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
Returns:
|
306
|
-
The converted string with inline TeX code replaced.
|
307
|
-
"""
|
308
|
-
|
309
|
-
def convert_all_block_tex(string: str) -> str:
|
310
|
-
"""Convert all block TeX code in the string.
|
327
|
+
def convert_all_tex_math(string: str) -> str:
|
328
|
+
"""Unified function to convert all supported TeX math expressions in a string to Typst format.
|
311
329
|
|
330
|
+
Handles $...$, $$...$$, \\(...\\), and \\[...\\]
|
312
331
|
Args:
|
313
|
-
string: The input string containing
|
332
|
+
string: The input string containing TeX math expressions.
|
314
333
|
|
315
334
|
Returns:
|
316
|
-
The
|
335
|
+
The string with TeX math expressions converted to Typst format.
|
317
336
|
"""
|
318
337
|
|
338
|
+
|
319
339
|
def fix_misplaced_labels(string: str) -> str:
|
320
340
|
"""A func to fix labels in a string.
|
321
341
|
|
@@ -326,6 +346,7 @@ def fix_misplaced_labels(string: str) -> str:
|
|
326
346
|
The fixed string with labels properly placed.
|
327
347
|
"""
|
328
348
|
|
349
|
+
|
329
350
|
def comment(string: str) -> str:
|
330
351
|
"""Add comment to the string.
|
331
352
|
|
@@ -336,6 +357,7 @@ def comment(string: str) -> str:
|
|
336
357
|
The string with each line prefixed by '// '.
|
337
358
|
"""
|
338
359
|
|
360
|
+
|
339
361
|
def uncomment(string: str) -> str:
|
340
362
|
"""Remove comment from the string.
|
341
363
|
|
@@ -346,6 +368,7 @@ def uncomment(string: str) -> str:
|
|
346
368
|
The string with comments (lines starting with '// ' or '//') removed.
|
347
369
|
"""
|
348
370
|
|
371
|
+
|
349
372
|
def split_out_metadata(string: str) -> Tuple[Optional[JsonValue], str]:
|
350
373
|
"""Split out metadata from a string.
|
351
374
|
|
@@ -356,6 +379,7 @@ def split_out_metadata(string: str) -> Tuple[Optional[JsonValue], str]:
|
|
356
379
|
A tuple containing the metadata as a Python object (if parseable) and the remaining string.
|
357
380
|
"""
|
358
381
|
|
382
|
+
|
359
383
|
def to_metadata(data: JsonValue) -> str:
|
360
384
|
"""Convert a Python object to a YAML string.
|
361
385
|
|
@@ -366,13 +390,8 @@ def to_metadata(data: JsonValue) -> str:
|
|
366
390
|
The YAML string representation of the input data.
|
367
391
|
"""
|
368
392
|
|
369
|
-
def convert_to_inline_formula(string: str) -> str:
|
370
|
-
r"""Convert `$...$` to inline formula `\(...\)` and trim spaces."""
|
371
393
|
|
372
|
-
def
|
373
|
-
r"""Convert `$$...$$` to block formula `\[...\]` and trim spaces."""
|
374
|
-
|
375
|
-
def inplace_update(string: str, wrapper: str, new_body: str) -> Optional[str]:
|
394
|
+
def replace_thesis_body(string: str, wrapper: str, new_body: str) -> Optional[str]:
|
376
395
|
"""Replace content between wrapper strings.
|
377
396
|
|
378
397
|
Args:
|
@@ -385,6 +404,7 @@ def inplace_update(string: str, wrapper: str, new_body: str) -> Optional[str]:
|
|
385
404
|
|
386
405
|
"""
|
387
406
|
|
407
|
+
|
388
408
|
def extract_body(string: str, wrapper: str) -> Optional[str]:
|
389
409
|
"""Extract the content between two occurrences of a wrapper string.
|
390
410
|
|
@@ -396,6 +416,7 @@ def extract_body(string: str, wrapper: str) -> Optional[str]:
|
|
396
416
|
The content between the first two occurrences of the wrapper string if found, otherwise None.
|
397
417
|
"""
|
398
418
|
|
419
|
+
|
399
420
|
class LLMConfig:
|
400
421
|
"""LLM configuration structure.
|
401
422
|
|
@@ -447,6 +468,7 @@ class LLMConfig:
|
|
447
468
|
frequency_penalty: Optional[float]
|
448
469
|
"""Penalizes new tokens based on their frequency in text so far (-2.0-2.0)."""
|
449
470
|
|
471
|
+
|
450
472
|
class EmbeddingConfig:
|
451
473
|
"""Embedding configuration structure."""
|
452
474
|
|
@@ -471,6 +493,7 @@ class EmbeddingConfig:
|
|
471
493
|
api_key: Optional[SecretStr]
|
472
494
|
"""The API key."""
|
473
495
|
|
496
|
+
|
474
497
|
class RagConfig:
|
475
498
|
"""RAG (Retrieval Augmented Generation) configuration structure."""
|
476
499
|
|
@@ -486,12 +509,14 @@ class RagConfig:
|
|
486
509
|
milvus_dimensions: Optional[int]
|
487
510
|
"""The dimensions for Milvus vectors."""
|
488
511
|
|
512
|
+
|
489
513
|
class DebugConfig:
|
490
514
|
"""Debug configuration structure."""
|
491
515
|
|
492
516
|
log_level: Optional[str]
|
493
517
|
"""The logging level to use."""
|
494
518
|
|
519
|
+
|
495
520
|
class TemplateManagerConfig:
|
496
521
|
"""Template manager configuration structure."""
|
497
522
|
|
@@ -504,6 +529,7 @@ class TemplateManagerConfig:
|
|
504
529
|
template_suffix: Optional[str]
|
505
530
|
"""The suffix of the templates."""
|
506
531
|
|
532
|
+
|
507
533
|
class TemplateConfig:
|
508
534
|
"""Template configuration structure."""
|
509
535
|
|
@@ -588,6 +614,7 @@ class TemplateConfig:
|
|
588
614
|
chap_summary_template: str
|
589
615
|
"""The name of the chap summary template which will be used to generate a chapter summary."""
|
590
616
|
|
617
|
+
|
591
618
|
class RoutingConfig:
|
592
619
|
"""Routing configuration structure for controlling request dispatching behavior."""
|
593
620
|
|
@@ -603,6 +630,7 @@ class RoutingConfig:
|
|
603
630
|
cooldown_time: Optional[int]
|
604
631
|
"""Time to cooldown a deployment after failure in seconds."""
|
605
632
|
|
633
|
+
|
606
634
|
class GeneralConfig:
|
607
635
|
"""General configuration structure for application-wide settings."""
|
608
636
|
|
@@ -612,6 +640,7 @@ class GeneralConfig:
|
|
612
640
|
use_json_repair: bool
|
613
641
|
"""Whether to automatically repair malformed JSON."""
|
614
642
|
|
643
|
+
|
615
644
|
class ToolBoxConfig:
|
616
645
|
"""Configuration for toolbox functionality."""
|
617
646
|
|
@@ -621,6 +650,7 @@ class ToolBoxConfig:
|
|
621
650
|
data_module_name: str
|
622
651
|
"""The name of the module containing the data."""
|
623
652
|
|
653
|
+
|
624
654
|
class PymitterConfig:
|
625
655
|
"""Pymitter configuration structure for controlling event emission and listener behavior."""
|
626
656
|
|
@@ -633,6 +663,7 @@ class PymitterConfig:
|
|
633
663
|
max_listeners: int
|
634
664
|
"""The maximum number of listeners per event. -1 means unlimited."""
|
635
665
|
|
666
|
+
|
636
667
|
class Config:
|
637
668
|
"""Configuration structure containing all system components."""
|
638
669
|
|
@@ -666,17 +697,22 @@ class Config:
|
|
666
697
|
pymitter: PymitterConfig
|
667
698
|
"""Pymitter configuration."""
|
668
699
|
|
700
|
+
|
669
701
|
CONFIG: Config
|
670
702
|
|
703
|
+
|
671
704
|
class SecretStr:
|
672
705
|
"""A string that should not be exposed."""
|
673
706
|
|
674
707
|
def __init__(self, source: str) -> None: ...
|
708
|
+
|
675
709
|
def get_secret_value(self) -> str:
|
676
710
|
"""Expose the secret string."""
|
677
711
|
|
712
|
+
|
678
713
|
TEMPLATE_MANAGER: TemplateManager
|
679
714
|
|
715
|
+
|
680
716
|
class Event:
|
681
717
|
"""Event class that represents a hierarchical event with segments.
|
682
718
|
|
@@ -788,9 +824,12 @@ class Event:
|
|
788
824
|
"""
|
789
825
|
|
790
826
|
def __hash__(self) -> int: ...
|
827
|
+
|
791
828
|
def __eq__(self, other: object) -> bool: ...
|
829
|
+
|
792
830
|
def __ne__(self, other: object) -> bool: ...
|
793
831
|
|
832
|
+
|
794
833
|
class TaskStatus(StrEnum, str):
|
795
834
|
"""Enumeration of possible task statuses."""
|
796
835
|
|
@@ -809,6 +848,7 @@ class TaskStatus(StrEnum, str):
|
|
809
848
|
Cancelled: TaskStatus
|
810
849
|
"""Task has been cancelled."""
|
811
850
|
|
851
|
+
|
812
852
|
class TEIClient:
|
813
853
|
"""Client for TEI reranking service.
|
814
854
|
|
@@ -824,11 +864,11 @@ class TEIClient:
|
|
824
864
|
"""
|
825
865
|
|
826
866
|
async def arerank(
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
867
|
+
self,
|
868
|
+
query: str,
|
869
|
+
texts: List[str],
|
870
|
+
truncate: bool = False,
|
871
|
+
truncation_direction: Literal["Left", "Right"] = "Left",
|
832
872
|
) -> List[Tuple[int, float]]:
|
833
873
|
"""Rerank texts based on relevance to query.
|
834
874
|
|
Binary file
|
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fabricatio
|
3
|
-
Version: 0.3.14.
|
3
|
+
Version: 0.3.14.dev5
|
4
4
|
Classifier: License :: OSI Approved :: MIT License
|
5
5
|
Classifier: Programming Language :: Rust
|
6
6
|
Classifier: Programming Language :: Python :: 3.12
|
@@ -18,17 +18,13 @@ Requires-Dist: pydantic>=2.10.6
|
|
18
18
|
Requires-Dist: pymitter>=1.0.0
|
19
19
|
Requires-Dist: rich>=13.9.4
|
20
20
|
Requires-Dist: ujson>=5.10.0
|
21
|
-
Requires-Dist: fabricatio[
|
21
|
+
Requires-Dist: fabricatio[ftd,qa,rag,cli] ; extra == 'full'
|
22
22
|
Requires-Dist: pymilvus>=2.5.4 ; extra == 'rag'
|
23
|
-
Requires-Dist: sympy>=1.13.3 ; extra == 'calc'
|
24
|
-
Requires-Dist: matplotlib>=3.10.1 ; extra == 'plot'
|
25
23
|
Requires-Dist: questionary>=2.1.0 ; extra == 'qa'
|
26
24
|
Requires-Dist: magika>=0.6.1 ; extra == 'ftd'
|
27
25
|
Requires-Dist: typer-slim[standard]>=0.15.2 ; extra == 'cli'
|
28
26
|
Provides-Extra: full
|
29
27
|
Provides-Extra: rag
|
30
|
-
Provides-Extra: calc
|
31
|
-
Provides-Extra: plot
|
32
28
|
Provides-Extra: qa
|
33
29
|
Provides-Extra: ftd
|
34
30
|
Provides-Extra: cli
|
@@ -36,7 +32,7 @@ License-File: LICENSE
|
|
36
32
|
Summary: A LLM multi-agent framework.
|
37
33
|
Keywords: ai,agents,multi-agent,llm,pyo3
|
38
34
|
Author-email: Whth <zettainspector@foxmail.com>
|
39
|
-
Requires-Python: >=3.12, <3.
|
35
|
+
Requires-Python: >=3.12, <3.14
|
40
36
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
41
37
|
Project-URL: Homepage, https://github.com/Whth/fabricatio
|
42
38
|
Project-URL: Repository, https://github.com/Whth/fabricatio
|
@@ -1,6 +1,6 @@
|
|
1
|
-
fabricatio-0.3.14.
|
2
|
-
fabricatio-0.3.14.
|
3
|
-
fabricatio-0.3.14.
|
1
|
+
fabricatio-0.3.14.dev5.dist-info/METADATA,sha256=0MBWyxdGQ7HQZrtsF7zXfaTPqwCd3ci7F2_701zlCfs,5116
|
2
|
+
fabricatio-0.3.14.dev5.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
|
3
|
+
fabricatio-0.3.14.dev5.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
|
4
4
|
fabricatio/actions/article.py,sha256=TPS2fOqCymKv2hK2c_WmMRMKNBkvN8M91QkB9ar8-bg,12507
|
5
5
|
fabricatio/actions/article_rag.py,sha256=e1fVh7Jph2zVD0bRAmK2dJ0BVkSEvF-FPfxUKujkn6s,18407
|
6
6
|
fabricatio/actions/fs.py,sha256=gJR14U4ln35nt8Z7OWLVAZpqGaLnED-r1Yi-lX22tkI,959
|
@@ -27,13 +27,13 @@ fabricatio/fs/curd.py,sha256=652nHulbJ3gwt0Z3nywtPMmjhEyglDvEfc3p7ieJNNA,4777
|
|
27
27
|
fabricatio/fs/readers.py,sha256=UXvcJO3UCsxHu9PPkg34Yh55Zi-miv61jD_wZQJgKRs,1751
|
28
28
|
fabricatio/fs/__init__.py,sha256=USoMI_HcIr3Yc77_JQYYsXrsplYPXtFTaNB9YgFfC4s,713
|
29
29
|
fabricatio/journal.py,sha256=mnbdB1Dw-mhEKIgWlPKn7W07ssg-6dmxMXilIGQMFV8,216
|
30
|
-
fabricatio/models/action.py,sha256=
|
30
|
+
fabricatio/models/action.py,sha256=RhjHaEJILiCZux5hzxSZVt_7Evcu3TnFHNuJN8rzgq8,10052
|
31
31
|
fabricatio/models/adv_kwargs_types.py,sha256=IBV3ZcsNLvvEjO_2hBpYg_wLSpNKaMx6Ndam3qXJCw8,2097
|
32
32
|
fabricatio/models/extra/advanced_judge.py,sha256=INUl_41C8jkausDekkjnEmTwNfLCJ23TwFjq2cM23Cw,1092
|
33
33
|
fabricatio/models/extra/aricle_rag.py,sha256=fTxlQyrzyl9bLCC5Zreb71TKaJ7xiHqqyR62HXr2unQ,11935
|
34
|
-
fabricatio/models/extra/article_base.py,sha256=
|
34
|
+
fabricatio/models/extra/article_base.py,sha256=UBNZaauEm3X85Cw-k7pIos129lkI0ocw7bAmRDpiG1k,16783
|
35
35
|
fabricatio/models/extra/article_essence.py,sha256=z3Qz6xVsB9k-K-c4Y2CoKzxZrXaUd4oyt2Mb6hGDYdg,2793
|
36
|
-
fabricatio/models/extra/article_main.py,sha256=
|
36
|
+
fabricatio/models/extra/article_main.py,sha256=nwwcTn-TgCeFNT4vVfE4OCMonwSdvyx1TR-lXPE6Cp4,11268
|
37
37
|
fabricatio/models/extra/article_outline.py,sha256=P0T-1DGCzoNmQ3iQVwSmOul0nwS6qLgr0FF8jDdD7F0,1673
|
38
38
|
fabricatio/models/extra/article_proposal.py,sha256=OQIKoJkmJv0ogYVk7eGK_TOtANVYcBPA_HeV1nuG0Vo,1909
|
39
39
|
fabricatio/models/extra/patches.py,sha256=_WNCxtYzzsVfUxI16vu4IqsLahLYRHdbQN9er9tqhC0,997
|
@@ -45,11 +45,11 @@ fabricatio/models/generic.py,sha256=OJrYClooL2XnyalWTyyLgorycA1d_JNW8VqOYNDJdXc,
|
|
45
45
|
fabricatio/models/kwargs_types.py,sha256=Ik8-Oi_NmwfkvC9B8K4NsoZc_vSWV85xKCSthA1Xv_k,3403
|
46
46
|
fabricatio/models/role.py,sha256=b3zg96YKDsMBqa7SIe9LQHc-IVs2fGWqoQeRQYQIl4o,3856
|
47
47
|
fabricatio/models/task.py,sha256=XZ1l1P-iS02ZF9P8cXv8gEfJKBa17PFPNJ1SbhyhT4Q,11033
|
48
|
-
fabricatio/models/tool.py,sha256=
|
49
|
-
fabricatio/models/usages.py,sha256=
|
48
|
+
fabricatio/models/tool.py,sha256=q2wDtZAebWMZlsFifgmJq8N3XvAhVNMb0aUIKkdruGc,12419
|
49
|
+
fabricatio/models/usages.py,sha256=q2jLqa0vJ7ho9ZUkC-2uPuFpK8uClBLIS6TEEYHUotY,33041
|
50
50
|
fabricatio/parser.py,sha256=dYFri9pDlsiwVpEJ-a5jmVU2nFuKN3uBHC8VsVpdEm8,4642
|
51
51
|
fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
|
-
fabricatio/rust.pyi,sha256=
|
52
|
+
fabricatio/rust.pyi,sha256=zgA4po7lznRxicXPxhRP3mmBY_xyGTnzpkW5D47tS5U,25958
|
53
53
|
fabricatio/toolboxes/arithmetic.py,sha256=WLqhY-Pikv11Y_0SGajwZx3WhsLNpHKf9drzAqOf_nY,1369
|
54
54
|
fabricatio/toolboxes/fs.py,sha256=l4L1CVxJmjw9Ld2XUpIlWfV0_Fu_2Og6d3E13I-S4aE,736
|
55
55
|
fabricatio/toolboxes/__init__.py,sha256=KBJi5OG_pExscdlM7Bnt_UF43j4I3Lv6G71kPVu4KQU,395
|
@@ -57,8 +57,8 @@ fabricatio/utils.py,sha256=WYhFB4tHk6jKmjZgAsYhRmg1ZvBjn4X2y4n7yz25HjE,5454
|
|
57
57
|
fabricatio/workflows/articles.py,sha256=ObYTFUqLUk_CzdmmnX6S7APfxcGmPFqnFr9pdjU7Z4Y,969
|
58
58
|
fabricatio/workflows/rag.py,sha256=-YYp2tlE9Vtfgpg6ROpu6QVO8j8yVSPa6yDzlN3qVxs,520
|
59
59
|
fabricatio/workflows/__init__.py,sha256=5ScFSTA-bvhCesj3U9Mnmi6Law6N1fmh5UKyh58L3u8,51
|
60
|
-
fabricatio/__init__.py,sha256=
|
61
|
-
fabricatio/rust.cp312-win_amd64.pyd,sha256=
|
62
|
-
fabricatio-0.3.14.
|
63
|
-
fabricatio-0.3.14.
|
64
|
-
fabricatio-0.3.14.
|
60
|
+
fabricatio/__init__.py,sha256=w7ObFg6ud4pQuC1DhVyQI9x9dtp05QrcJAEk643iJmc,761
|
61
|
+
fabricatio/rust.cp312-win_amd64.pyd,sha256=fpmxmtf2fPo_tceNOh7JIKjIV1R-s5Pif2wD8Fj7msY,7818752
|
62
|
+
fabricatio-0.3.14.dev5.data/scripts/tdown.exe,sha256=YePgy8GewcQSj78G8EcePrHdBzbm3iJOR74wLQSg5Zs,3449344
|
63
|
+
fabricatio-0.3.14.dev5.data/scripts/ttm.exe,sha256=1YTY-py7QIYYEcsJ6rIz5j3MLbmdHZ3XkZnBiFZ0YnI,2555904
|
64
|
+
fabricatio-0.3.14.dev5.dist-info/RECORD,,
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|