fabricatio 0.2.6.dev5__tar.gz → 0.2.6.dev7__tar.gz
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-0.2.6.dev5 → fabricatio-0.2.6.dev7}/PKG-INFO +1 -1
- fabricatio-0.2.6.dev7/examples/extract_and_inject/.gitignore +2 -0
- fabricatio-0.2.6.dev7/examples/extract_and_inject/extract_and_inject.py +53 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/extract_article/extract.py +5 -2
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/pyproject.toml +1 -1
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/actions/article.py +7 -4
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/capabilities/rag.py +6 -6
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/config.py +5 -5
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/action.py +1 -2
- fabricatio-0.2.6.dev7/python/fabricatio/models/extra.py +658 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/kwargs_types.py +17 -6
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/role.py +1 -2
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/usages.py +58 -27
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/utils.py +21 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/parser.py +1 -0
- fabricatio-0.2.6.dev7/templates.tar.gz +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/uv.lock +1 -1
- fabricatio-0.2.6.dev5/examples/extract_and_review/.gitignore +0 -1
- fabricatio-0.2.6.dev5/examples/extract_and_review/extract_and_review.py +0 -43
- fabricatio-0.2.6.dev5/python/fabricatio/capabilities/covalidate.py +0 -160
- fabricatio-0.2.6.dev5/python/fabricatio/models/extra.py +0 -171
- fabricatio-0.2.6.dev5/templates.tar.gz +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/.github/workflows/build-package.yaml +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/.github/workflows/ruff.yaml +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/.github/workflows/tests.yaml +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/.gitignore +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/.python-version +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/Cargo.lock +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/Cargo.toml +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/LICENSE +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/Makefile +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/README.md +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/correct/correct.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/correct/correct_loop.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/llm_usages/llm_usage.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/make_a_rating/rating.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/make_diary/commits.json +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/make_diary/diary.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/minor/hello_fabricatio.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/minor/write_a_poem.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/propose_task/propose.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/reviewer/review.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/search_bibtex/.gitignore +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/search_bibtex/search.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/simple_chat/chat.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/simple_rag/simple_rag.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/task_handle/handle_task.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/write_outline/.gitignore +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/write_outline/write_outline.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/examples/write_outline/write_outline_corrected.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/__init__.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/_rust.pyi +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/_rust_instances.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/actions/output.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/actions/rag.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/capabilities/correct.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/capabilities/propose.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/capabilities/rating.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/capabilities/review.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/capabilities/task.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/core.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/decorators.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/fs/__init__.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/fs/curd.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/fs/readers.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/journal.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/events.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/generic.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/task.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/models/tool.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/py.typed +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/toolboxes/__init__.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/toolboxes/arithmetic.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/toolboxes/fs.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/workflows/articles.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/python/fabricatio/workflows/rag.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/src/bib_tools.rs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/src/hash.rs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/src/hbs_helpers.rs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/src/lib.rs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/src/templates.rs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/claude-xml.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/clean-up-code.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/co_validation.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/correct.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/create_json_obj.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/dependencies.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/document-the-code.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/draft_rating_criteria.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/draft_rating_manual.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/draft_rating_weights_klee.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/draft_tool_usage_code.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/extract_criteria_from_reasons.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/extract_reasons_from_examples.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/fix-bugs.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/generic_string.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/improve-performance.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/liststr.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/make_choice.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/make_judgment.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/pathstr.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/rate_fine_grind.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/refactor.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/refined_query.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/retrieved_display.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/review_string.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/task_briefing.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/web-ctf-solver.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/write-git-commit.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/write-github-pull-request.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/templates/built-in/write-github-readme.hbs +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_config.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_models/test_action.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_models/test_advanced.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_models/test_generic.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_models/test_role.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_models/test_task.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_models/test_tool.py +0 -0
- {fabricatio-0.2.6.dev5 → fabricatio-0.2.6.dev7}/tests/test_models/test_usages.py +0 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
"""Example of proposing a task to a role."""
|
2
|
+
|
3
|
+
import asyncio
|
4
|
+
from pathlib import Path
|
5
|
+
from typing import List
|
6
|
+
|
7
|
+
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
8
|
+
from fabricatio.actions.article import ExtractArticleEssence
|
9
|
+
from fabricatio.actions.rag import InjectToDB
|
10
|
+
from fabricatio.fs.curd import dump_text, gather_files
|
11
|
+
from fabricatio.models.extra import ArticleEssence
|
12
|
+
from pydantic import HttpUrl
|
13
|
+
|
14
|
+
|
15
|
+
class SaveToFS(Action):
|
16
|
+
"""Save to file system."""
|
17
|
+
|
18
|
+
async def _execute(self, to_inject: List[ArticleEssence], output_dir: Path, **_) -> None:
|
19
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
20
|
+
for i, e in enumerate(to_inject):
|
21
|
+
dump_text(output_dir / f"{i}.json", e.display())
|
22
|
+
|
23
|
+
|
24
|
+
async def main() -> None:
|
25
|
+
"""Main function."""
|
26
|
+
role = Role(
|
27
|
+
name="Researcher",
|
28
|
+
description="Extract article essence",
|
29
|
+
llm_api_endpoint=HttpUrl("https://dashscope.aliyuncs.com/compatible-mode/v1"),
|
30
|
+
llm_model="deepseek-r1-distill-llama-70b",
|
31
|
+
registry={
|
32
|
+
Event.quick_instantiate("article"): WorkFlow(
|
33
|
+
name="extract",
|
34
|
+
steps=(ExtractArticleEssence(output_key="to_inject"), InjectToDB(output_key="task_output")),
|
35
|
+
extra_init_context={"collection_name": "article_essence", "output_dir": Path("output")},
|
36
|
+
)
|
37
|
+
},
|
38
|
+
)
|
39
|
+
|
40
|
+
task: Task[str] = await role.propose_task(
|
41
|
+
"Extract the essence of the article from the files in './bpdf_out'",
|
42
|
+
)
|
43
|
+
|
44
|
+
col_name = await task.override_dependencies(gather_files("bpdf_out", "md")).delegate("article")
|
45
|
+
|
46
|
+
if col_name is None:
|
47
|
+
logger.error("No essence found")
|
48
|
+
return
|
49
|
+
logger.success(f"Injected to collection: {col_name}")
|
50
|
+
|
51
|
+
|
52
|
+
if __name__ == "__main__":
|
53
|
+
asyncio.run(main())
|
@@ -1,11 +1,14 @@
|
|
1
1
|
"""Example of proposing a task to a role."""
|
2
2
|
|
3
3
|
import asyncio
|
4
|
-
from typing import List
|
4
|
+
from typing import TYPE_CHECKING, List
|
5
5
|
|
6
|
-
from fabricatio import
|
6
|
+
from fabricatio import Event, Role, Task, WorkFlow, logger
|
7
7
|
from fabricatio.actions.article import ExtractArticleEssence
|
8
8
|
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
from fabricatio.models.extra import ArticleEssence
|
11
|
+
|
9
12
|
|
10
13
|
async def main() -> None:
|
11
14
|
"""Main function."""
|
@@ -93,10 +93,11 @@ class CorrectProposal(Action):
|
|
93
93
|
f"{task_input.briefing}\nExtract the path of file, which contains the article briefing that I need to read."
|
94
94
|
)
|
95
95
|
|
96
|
-
rprint(article_proposal.display())
|
97
96
|
ret = None
|
98
97
|
while await confirm("Do you want to correct the Proposal?").ask_async():
|
99
|
-
|
98
|
+
rprint(article_proposal.display())
|
99
|
+
while not (topic := await text("What is the topic of the proposal reviewing?").ask_async()):
|
100
|
+
...
|
100
101
|
ret = await self.correct_obj(
|
101
102
|
article_proposal,
|
102
103
|
safe_text_read(input_path),
|
@@ -115,11 +116,13 @@ class CorrectOutline(Action):
|
|
115
116
|
self,
|
116
117
|
article_outline: ArticleOutline,
|
117
118
|
article_proposal: ArticleProposal,
|
119
|
+
|
118
120
|
**_,
|
119
121
|
) -> Optional[str]:
|
120
|
-
rprint(article_outline.finalized_dump())
|
121
122
|
ret = None
|
122
123
|
while await confirm("Do you want to correct the outline?").ask_async():
|
123
|
-
|
124
|
+
rprint(article_outline.finalized_dump())
|
125
|
+
while not (topic := await text("What is the topic of the outline reviewing?").ask_async()):
|
126
|
+
...
|
124
127
|
ret = await self.correct_obj(article_outline, article_proposal.display(), topic=topic)
|
125
128
|
return ret or article_outline
|
@@ -15,13 +15,13 @@ from fabricatio.config import configs
|
|
15
15
|
from fabricatio.journal import logger
|
16
16
|
from fabricatio.models.kwargs_types import (
|
17
17
|
ChooseKwargs,
|
18
|
-
|
18
|
+
CollectionConfigKwargs,
|
19
19
|
EmbeddingKwargs,
|
20
20
|
FetchKwargs,
|
21
21
|
LLMKwargs,
|
22
22
|
)
|
23
23
|
from fabricatio.models.usages import EmbeddingUsage
|
24
|
-
from fabricatio.models.utils import MilvusData
|
24
|
+
from fabricatio.models.utils import MilvusData, ok
|
25
25
|
from more_itertools.recipes import flatten, unique
|
26
26
|
from pydantic import Field, PrivateAttr
|
27
27
|
|
@@ -60,7 +60,7 @@ class RAG(EmbeddingUsage):
|
|
60
60
|
) -> Self:
|
61
61
|
"""Initialize the Milvus client."""
|
62
62
|
self._client = create_client(
|
63
|
-
uri=milvus_uri or (self.milvus_uri or configs.rag.milvus_uri).unicode_string(),
|
63
|
+
uri=milvus_uri or ok(self.milvus_uri or configs.rag.milvus_uri).unicode_string(),
|
64
64
|
token=milvus_token
|
65
65
|
or (token.get_secret_value() if (token := (self.milvus_token or configs.rag.milvus_token)) else ""),
|
66
66
|
timeout=milvus_timeout or self.milvus_timeout,
|
@@ -102,14 +102,14 @@ class RAG(EmbeddingUsage):
|
|
102
102
|
]
|
103
103
|
|
104
104
|
def view(
|
105
|
-
self, collection_name: Optional[str], create: bool = False, **kwargs: Unpack[
|
105
|
+
self, collection_name: Optional[str], create: bool = False, **kwargs: Unpack[CollectionConfigKwargs]
|
106
106
|
) -> Self:
|
107
107
|
"""View the specified collection.
|
108
108
|
|
109
109
|
Args:
|
110
110
|
collection_name (str): The name of the collection.
|
111
111
|
create (bool): Whether to create the collection if it does not exist.
|
112
|
-
**kwargs (Unpack[
|
112
|
+
**kwargs (Unpack[CollectionConfigKwargs]): Additional keyword arguments for collection configuration.
|
113
113
|
"""
|
114
114
|
if create and collection_name and self.client.has_collection(collection_name):
|
115
115
|
kwargs["dimension"] = kwargs.get("dimension") or self.milvus_dimensions or configs.rag.milvus_dimensions
|
@@ -315,7 +315,7 @@ class RAG(EmbeddingUsage):
|
|
315
315
|
**kwargs,
|
316
316
|
)
|
317
317
|
|
318
|
-
async def arefined_query(self, question: List[str] | str, **kwargs: Unpack[ChooseKwargs]) -> List[str]:
|
318
|
+
async def arefined_query(self, question: List[str] | str, **kwargs: Unpack[ChooseKwargs]) -> Optional[List[str]]:
|
319
319
|
"""Refines the given question using a template.
|
320
320
|
|
321
321
|
Args:
|
@@ -66,7 +66,7 @@ class LLMConfig(BaseModel):
|
|
66
66
|
temperature: Optional[NonNegativeFloat] = Field(default=1.0)
|
67
67
|
"""The temperature of the LLM model. Controls randomness in generation. Set to 1.0 as per request."""
|
68
68
|
|
69
|
-
stop_sign: Optional[str | List[str]] = Field(default=
|
69
|
+
stop_sign: Optional[str | List[str]] = Field(default=None)
|
70
70
|
"""The stop sign of the LLM model. No default stop sign specified."""
|
71
71
|
|
72
72
|
top_p: Optional[NonNegativeFloat] = Field(default=0.35)
|
@@ -78,7 +78,7 @@ class LLMConfig(BaseModel):
|
|
78
78
|
stream: Optional[bool] = Field(default=False)
|
79
79
|
"""Whether to stream the LLM model's response. Default is False."""
|
80
80
|
|
81
|
-
max_tokens: Optional[PositiveInt] = Field(default=
|
81
|
+
max_tokens: Optional[PositiveInt] = Field(default=None)
|
82
82
|
"""The maximum number of tokens to generate. Set to 8192 as per request."""
|
83
83
|
|
84
84
|
rpm: Optional[PositiveInt] = Field(default=100)
|
@@ -148,13 +148,13 @@ class DebugConfig(BaseModel):
|
|
148
148
|
log_level: Literal["DEBUG", "INFO", "SUCCESS", "WARNING", "ERROR", "CRITICAL"] = Field(default="INFO")
|
149
149
|
"""The log level of the application."""
|
150
150
|
|
151
|
-
log_file: FilePath = Field(default=Path(rf"{ROAMING_DIR}\fabricatio.log"))
|
151
|
+
log_file: FilePath = Field(default=Path(rf"{ROAMING_DIR}\fabricatio.log"), frozen=True)
|
152
152
|
"""The log file of the application."""
|
153
153
|
|
154
|
-
rotation: int = Field(default=1)
|
154
|
+
rotation: int = Field(default=1, frozen=True)
|
155
155
|
"""The rotation of the log file. in weeks."""
|
156
156
|
|
157
|
-
retention: int = Field(default=2)
|
157
|
+
retention: int = Field(default=2, frozen=True)
|
158
158
|
"""The retention of the log file. in weeks."""
|
159
159
|
|
160
160
|
streaming_visible: bool = Field(default=False)
|
@@ -10,7 +10,6 @@ from asyncio import Queue, create_task
|
|
10
10
|
from typing import Any, Dict, Self, Tuple, Type, Union, final
|
11
11
|
|
12
12
|
from fabricatio.capabilities.correct import Correct
|
13
|
-
from fabricatio.capabilities.covalidate import CoValidate
|
14
13
|
from fabricatio.capabilities.task import HandleTask, ProposeTask
|
15
14
|
from fabricatio.journal import logger
|
16
15
|
from fabricatio.models.generic import WithBriefing
|
@@ -19,7 +18,7 @@ from fabricatio.models.usages import ToolBoxUsage
|
|
19
18
|
from pydantic import Field, PrivateAttr
|
20
19
|
|
21
20
|
|
22
|
-
class Action(HandleTask, ProposeTask, Correct
|
21
|
+
class Action(HandleTask, ProposeTask, Correct):
|
23
22
|
"""Class that represents an action to be executed in a workflow.
|
24
23
|
|
25
24
|
Actions are the atomic units of work in a workflow. Each action performs
|