fabricatio 0.4.0.dev5__tar.gz → 0.4.1.dev1__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.4.0.dev5 → fabricatio-0.4.1.dev1}/.github/workflows/build-package.yaml +1 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/Makefile +2 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/PKG-INFO +1 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_and_inject/article_rag.py +1 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_and_inject/ask.py +5 -4
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_and_inject/chunk_article.py +6 -5
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_and_inject/extract_and_inject.py +13 -11
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_article/extract.py +2 -2
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/llm_usages/llm_usage.py +2 -3
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/make_a_rating/rating.py +7 -7
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/minor/write_a_poem.py +1 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/propose_task/propose.py +6 -5
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/reviewer/censor.py +1 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/reviewer/review.py +2 -1
- fabricatio-0.4.1.dev1/examples/search_bibtex/search.py +14 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/simple_rag/simple_rag.py +3 -2
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/task_handle/handle_task.py +3 -2
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_outline/write_outline.py +3 -4
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_outline/write_outline_corrected.py +1 -2
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/pyproject.toml +1 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/actions/__init__.py +17 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/capabilities/__init__.py +4 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/models/__init__.py +8 -0
- fabricatio-0.4.1.dev1/python/fabricatio/workflows/__init__.py +13 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/subpackages.py +25 -3
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/uv.lock +1 -1
- fabricatio-0.4.0.dev5/examples/search_bibtex/search.py +0 -11
- fabricatio-0.4.0.dev5/python/fabricatio/workflows/__init__.py +0 -1
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/.github/workflows/ruff.yaml +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/.github/workflows/tests.yaml +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/.gitignore +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/Cargo.lock +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/Cargo.toml +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/LICENSE +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/README.md +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/correct/correct.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/correct/correct_loop.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_and_inject/.gitignore +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/make_diary/commits.json +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/make_diary/diary.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/minor/hello_fabricatio.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/propose_task/.gitignore +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/rules/.gitignore +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/rules/draft_ruleset.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/search_bibtex/.gitignore +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/simple_chat/chat.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_article/.gitignore +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_article/article_rag.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_article/post_process.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_article/write_article.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_outline/.gitignore +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/LICENSE +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/README.md +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/pyproject.toml +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/python/fabricatio_actions/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/python/fabricatio_actions/actions/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/python/fabricatio_actions/actions/fs.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/python/fabricatio_actions/actions/output.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/python/fabricatio_actions/models/generic.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-actions/python/fabricatio_actions/py.typed +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/LICENSE +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/README.md +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/pyproject.toml +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/python/fabricatio_improve/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/correct.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/review.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/python/fabricatio_improve/models/improve.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/python/fabricatio_improve/models/kwargs_types.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/python/fabricatio_improve/models/problem.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-improve/python/fabricatio_improve/py.typed +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-judge/LICENSE +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-judge/README.md +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-judge/pyproject.toml +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-judge/python/fabricatio_judge/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-judge/python/fabricatio_judge/capabilities/advanced_judge.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-judge/python/fabricatio_judge/models/advanced_judge.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-judge/python/fabricatio_judge/py.typed +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/LICENSE +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/README.md +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/pyproject.toml +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/actions/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/actions/rules.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/censor.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/check.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/kwargs_types.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/patch.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/models/rule.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/packages/fabricatio-rule/python/fabricatio_rule/py.typed +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/py.typed +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/toolboxes/__init__.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/toolboxes/arithmetic.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/python/fabricatio/toolboxes/fs.py +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/src/lib.rs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/as_prompt.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/chap_summary.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/check_string.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/claude-xml.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/clean-up-code.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/co_validation.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/create_json_obj.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/dependencies.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/document-the-code.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/draft_rating_criteria.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/draft_rating_manual.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/draft_rating_weights_klee.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/draft_tool_usage_code.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/extract.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/extract_criteria_from_reasons.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/extract_reasons_from_examples.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/fix-bugs.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/fix_troubled_obj.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/fix_troubled_string.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/generic_string.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/improve-performance.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/liststr.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/make_choice.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/make_judgment.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/pathstr.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/rate_fine_grind.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/refactor.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/refined_query.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/research_content_summary.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/retrieved_display.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/review_string.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/rule_requirement.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/ruleset_requirement_breakdown.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/task_briefing.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/web-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/write-git-commit.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/write-github-pull-request.hbs +0 -0
- {fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/write-github-readme.hbs +0 -0
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
import asyncio
|
4
4
|
|
5
|
-
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
6
|
-
from fabricatio.capabilities.rag import RAG
|
7
|
-
from fabricatio.models.extra.aricle_rag import ArticleChunk
|
8
|
-
from fabricatio.utils import ok
|
9
5
|
from questionary import text
|
10
6
|
|
7
|
+
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
8
|
+
from fabricatio.capabilities import RAG
|
9
|
+
from fabricatio.models import ArticleChunk
|
10
|
+
from fabricatio_core.utils import ok
|
11
|
+
|
11
12
|
|
12
13
|
class Talk(Action, RAG):
|
13
14
|
"""Action that says hello to the world."""
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_and_inject/chunk_article.py
RENAMED
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
import asyncio
|
4
4
|
|
5
|
-
from
|
6
|
-
|
7
|
-
from fabricatio
|
8
|
-
from fabricatio.
|
9
|
-
from
|
5
|
+
from fabricatio_typst.rust import BibManager
|
6
|
+
|
7
|
+
from fabricatio import Event, Role, Task, WorkFlow, logger
|
8
|
+
from fabricatio.actions import ChunkArticle, InjectToDB
|
9
|
+
from fabricatio_core.fs import gather_files
|
10
|
+
from fabricatio_core.utils import ok
|
10
11
|
|
11
12
|
|
12
13
|
async def main() -> None:
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/extract_and_inject/extract_and_inject.py
RENAMED
@@ -3,26 +3,28 @@
|
|
3
3
|
import asyncio
|
4
4
|
from typing import Optional
|
5
5
|
|
6
|
-
from
|
7
|
-
from fabricatio.actions.article import ExtractArticleEssence, FixArticleEssence
|
8
|
-
from fabricatio.actions.output import PersistentAll
|
9
|
-
from fabricatio.actions.rag import InjectToDB
|
10
|
-
from fabricatio.fs import safe_text_read
|
11
|
-
from fabricatio.fs.curd import gather_files
|
6
|
+
from fabricatio_typst.rust import BibManager
|
12
7
|
from litellm.utils import token_counter
|
13
8
|
|
9
|
+
from fabricatio import Event, Role, Task, WorkFlow, logger
|
10
|
+
from fabricatio.actions import ExtractArticleEssence, FixArticleEssence, InjectToDB, PersistentAll
|
11
|
+
from fabricatio_core.fs import safe_text_read
|
12
|
+
from fabricatio_core.fs.curd import gather_files
|
13
|
+
|
14
14
|
MAX_TOKEN = 64000
|
15
15
|
|
16
16
|
|
17
|
-
def _reader(path:str)->Optional[str]:
|
18
|
-
string=safe_text_read(path)
|
19
|
-
string=string.split("References\n")[0]
|
20
|
-
string=string.split("参考文献\n")[0]
|
21
|
-
if (leng:=token_counter(text=string))> MAX_TOKEN:
|
17
|
+
def _reader(path: str) -> Optional[str]:
|
18
|
+
string = safe_text_read(path)
|
19
|
+
string = string.split("References\n")[0]
|
20
|
+
string = string.split("参考文献\n")[0]
|
21
|
+
if (leng := token_counter(text=string)) > MAX_TOKEN:
|
22
22
|
logger.warning(f'{path} is too long, got {leng} tokens, skip.')
|
23
23
|
return None
|
24
24
|
logger.info(f'Read {path} get {leng} tokens.')
|
25
25
|
return string
|
26
|
+
|
27
|
+
|
26
28
|
async def main() -> None:
|
27
29
|
"""Main function."""
|
28
30
|
Role(
|
@@ -4,10 +4,10 @@ import asyncio
|
|
4
4
|
from typing import TYPE_CHECKING, List
|
5
5
|
|
6
6
|
from fabricatio import Event, Role, Task, WorkFlow, logger
|
7
|
-
from fabricatio.actions
|
7
|
+
from fabricatio.actions import ExtractArticleEssence
|
8
8
|
|
9
9
|
if TYPE_CHECKING:
|
10
|
-
from fabricatio.models
|
10
|
+
from fabricatio.models import ArticleEssence
|
11
11
|
|
12
12
|
|
13
13
|
async def main() -> None:
|
@@ -2,9 +2,8 @@
|
|
2
2
|
|
3
3
|
import asyncio
|
4
4
|
|
5
|
-
from fabricatio import Action, Event, Role, Task, WorkFlow
|
6
|
-
from
|
7
|
-
from fabricatio.parser import PythonCapture
|
5
|
+
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
6
|
+
from fabricatio_core.parser import PythonCapture
|
8
7
|
|
9
8
|
|
10
9
|
class WriteCode(Action):
|
@@ -4,10 +4,10 @@ import asyncio
|
|
4
4
|
from typing import Dict, List, Set, Unpack
|
5
5
|
|
6
6
|
import ujson
|
7
|
-
|
8
|
-
from fabricatio
|
9
|
-
from fabricatio.
|
10
|
-
from
|
7
|
+
|
8
|
+
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
9
|
+
from fabricatio.capabilities import Rating
|
10
|
+
from fabricatio_core.parser import JsonCapture
|
11
11
|
|
12
12
|
|
13
13
|
class Rate(Action, Rating):
|
@@ -33,9 +33,9 @@ class WhatToRate(Action):
|
|
33
33
|
async def _execute(self, task_input: Task, rate_topic: str, **cxt: Unpack) -> List[str]:
|
34
34
|
def _validate(resp: str) -> List[str] | None:
|
35
35
|
if (
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
(cap := JsonCapture.convert_with(resp, ujson.loads)) is not None
|
37
|
+
and isinstance(cap, list)
|
38
|
+
and all(isinstance(i, str) for i in cap)
|
39
39
|
):
|
40
40
|
return cap
|
41
41
|
return None
|
@@ -4,11 +4,11 @@ import asyncio
|
|
4
4
|
from typing import Any
|
5
5
|
|
6
6
|
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
7
|
-
from fabricatio.actions
|
8
|
-
from fabricatio.capabilities
|
9
|
-
from fabricatio.
|
10
|
-
from
|
11
|
-
from
|
7
|
+
from fabricatio.actions import PersistentAll
|
8
|
+
from fabricatio.capabilities import Propose
|
9
|
+
from fabricatio.models import ArticleOutline
|
10
|
+
from fabricatio_core.fs import safe_text_read
|
11
|
+
from fabricatio_core.utils import ok
|
12
12
|
|
13
13
|
|
14
14
|
class ProposeObj(Action, Propose):
|
@@ -24,6 +24,7 @@ class ProposeObj(Action, Propose):
|
|
24
24
|
f"Note the heading shall not contain any heading numbers.",
|
25
25
|
)
|
26
26
|
|
27
|
+
|
27
28
|
async def main() -> None:
|
28
29
|
"""Main function."""
|
29
30
|
Role(
|
@@ -3,12 +3,13 @@
|
|
3
3
|
import asyncio
|
4
4
|
|
5
5
|
from fabricatio import Role, logger
|
6
|
-
from fabricatio.capabilities
|
6
|
+
from fabricatio.capabilities import Review
|
7
7
|
|
8
8
|
|
9
9
|
class Reviewer(Role, Review):
|
10
10
|
"""Reviewer role."""
|
11
11
|
|
12
|
+
|
12
13
|
async def main() -> None:
|
13
14
|
"""Main function."""
|
14
15
|
role = Reviewer(
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"""Example of using BibManager."""
|
2
|
+
from fabricatio_typst.rust import BibManager
|
3
|
+
|
4
|
+
from fabricatio import logger
|
5
|
+
|
6
|
+
b = BibManager("Exported Items.bib")
|
7
|
+
logger.success(
|
8
|
+
b.get_cite_key_by_title(
|
9
|
+
"A Negative Selection Immune System Inspired Methodology for Fault Diagnosis of Wind Turbines"))
|
10
|
+
logger.success(
|
11
|
+
b.get_cite_key_fuzzy(
|
12
|
+
"System Inspired Methodology for Fault"
|
13
|
+
)
|
14
|
+
)
|
@@ -2,10 +2,11 @@
|
|
2
2
|
|
3
3
|
import asyncio
|
4
4
|
|
5
|
-
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
6
|
-
from fabricatio.capabilities.rag import RAG
|
7
5
|
from questionary import text
|
8
6
|
|
7
|
+
from fabricatio import Action, Event, Role, Task, WorkFlow, logger
|
8
|
+
from fabricatio.capabilities import RAG
|
9
|
+
|
9
10
|
|
10
11
|
class Talk(Action, RAG):
|
11
12
|
"""Action that says hello to the world."""
|
@@ -3,10 +3,11 @@
|
|
3
3
|
import asyncio
|
4
4
|
from typing import Any, Set, Unpack
|
5
5
|
|
6
|
-
from fabricatio import Action, Event, Role, Task, ToolBox, WorkFlow, logger, toolboxes
|
7
|
-
from fabricatio.parser import PythonCapture
|
8
6
|
from pydantic import Field
|
9
7
|
|
8
|
+
from fabricatio import Action, Event, Role, Task, ToolBox, WorkFlow, logger, toolboxes
|
9
|
+
from fabricatio_core.parser import PythonCapture
|
10
|
+
|
10
11
|
|
11
12
|
class WriteCode(Action):
|
12
13
|
"""Action that says hello to the world."""
|
@@ -2,10 +2,9 @@
|
|
2
2
|
|
3
3
|
import asyncio
|
4
4
|
|
5
|
-
from fabricatio import Event, Role, logger
|
6
|
-
from fabricatio.
|
7
|
-
from
|
8
|
-
from fabricatio.workflows.articles import WriteOutlineCorrectedWorkFlow
|
5
|
+
from fabricatio import Event, Role, Task, logger
|
6
|
+
from fabricatio.workflows import WriteOutlineCorrectedWorkFlow
|
7
|
+
from fabricatio_core.utils import ok
|
9
8
|
|
10
9
|
|
11
10
|
async def main() -> None:
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/examples/write_outline/write_outline_corrected.py
RENAMED
@@ -3,8 +3,7 @@
|
|
3
3
|
import asyncio
|
4
4
|
|
5
5
|
from fabricatio import Event, Role, WorkFlow, logger
|
6
|
-
from fabricatio.actions
|
7
|
-
from fabricatio.actions.output import DumpFinalizedOutput
|
6
|
+
from fabricatio.actions import DumpFinalizedOutput, GenerateArticleProposal, GenerateInitialOutline
|
8
7
|
|
9
8
|
|
10
9
|
async def main() -> None:
|
@@ -6,6 +6,7 @@ if find_spec("fabricatio_typst"):
|
|
6
6
|
from fabricatio_typst.actions.article import (
|
7
7
|
ExtractArticleEssence,
|
8
8
|
ExtractOutlineFromRaw,
|
9
|
+
FixArticleEssence,
|
9
10
|
GenerateArticle,
|
10
11
|
GenerateArticleProposal,
|
11
12
|
GenerateInitialOutline,
|
@@ -16,6 +17,7 @@ if find_spec("fabricatio_typst"):
|
|
16
17
|
__all__ += [
|
17
18
|
"ExtractArticleEssence",
|
18
19
|
"ExtractOutlineFromRaw",
|
20
|
+
"FixArticleEssence",
|
19
21
|
"GenerateArticle",
|
20
22
|
"GenerateArticleProposal",
|
21
23
|
"GenerateInitialOutline",
|
@@ -25,14 +27,28 @@ if find_spec("fabricatio_typst"):
|
|
25
27
|
]
|
26
28
|
|
27
29
|
if find_spec("fabricatio_rag"):
|
28
|
-
from fabricatio_typst.actions.article_rag import
|
30
|
+
from fabricatio_typst.actions.article_rag import (
|
31
|
+
ArticleConsultRAG,
|
32
|
+
ChunkArticle,
|
33
|
+
TweakArticleRAG,
|
34
|
+
WriteArticleContentRAG,
|
35
|
+
)
|
29
36
|
|
30
37
|
__all__ += [
|
31
38
|
|
32
39
|
"ArticleConsultRAG",
|
40
|
+
"ChunkArticle",
|
33
41
|
"TweakArticleRAG",
|
34
42
|
"WriteArticleContentRAG"
|
43
|
+
|
35
44
|
]
|
45
|
+
if find_spec("fabricatio_rag"):
|
46
|
+
from fabricatio_rag.actions.rag import InjectToDB, RAGTalk
|
47
|
+
|
48
|
+
__all__ += [
|
49
|
+
"InjectToDB",
|
50
|
+
"RAGTalk"
|
51
|
+
]
|
36
52
|
|
37
53
|
if find_spec("fabricatio_actions"):
|
38
54
|
from fabricatio_actions.actions.output import (
|
@@ -31,8 +31,11 @@ if find_spec("fabricatio_rule"):
|
|
31
31
|
|
32
32
|
if find_spec("fabricatio_improve"):
|
33
33
|
from fabricatio_improve.capabilities.correct import Correct
|
34
|
+
from fabricatio_improve.capabilities.review import Review
|
34
35
|
|
35
|
-
__all__ += ["Correct"
|
36
|
+
__all__ += ["Correct",
|
37
|
+
"Review",
|
38
|
+
]
|
36
39
|
|
37
40
|
if find_spec():
|
38
41
|
from fabricatio_judge.capabilities.advanced_judge import AdvancedJudge
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"""A module containing some builtin workflows."""
|
2
|
+
|
3
|
+
__all__ = []
|
4
|
+
|
5
|
+
from importlib.util import find_spec
|
6
|
+
|
7
|
+
if find_spec("fabricatio_typst"):
|
8
|
+
from fabricatio_typst.workflows.articles import WriteOutlineCorrectedWorkFlow
|
9
|
+
|
10
|
+
__all__ += [
|
11
|
+
|
12
|
+
"WriteOutlineCorrectedWorkFlow"
|
13
|
+
]
|
@@ -15,6 +15,7 @@ from typing import Any, Dict, List, Optional
|
|
15
15
|
# --- Configuration ---
|
16
16
|
DEFAULT_ROOT_DIR = Path("packages").resolve()
|
17
17
|
DEFAULT_DIST_DIR = Path("dist").resolve()
|
18
|
+
DEFAULT_DATA_DIR = Path("extra")
|
18
19
|
|
19
20
|
# --- Logging Setup ---
|
20
21
|
# Configure logging for clear and informative output
|
@@ -171,15 +172,36 @@ class Project:
|
|
171
172
|
if not self.pyversion:
|
172
173
|
logger.error(f"Python version (--pyversion) is required for Maturin project '{self.name}'.")
|
173
174
|
return []
|
174
|
-
|
175
175
|
develop_command = [
|
176
176
|
"uvx", "-p", self.pyversion, "--project", self.entry_path.as_posix(), "maturin", "develop", "--uv",
|
177
177
|
"-r",
|
178
|
+
|
179
|
+
]
|
180
|
+
|
181
|
+
# cargo build --workspace --bins -r -Z unstable-options --artifact-dir
|
182
|
+
scripts_dir = self.entry_path / DEFAULT_DATA_DIR / "scripts"
|
183
|
+
cargo_bins = [
|
184
|
+
"cargo", "build", "--workspace", "--bins", "-r", "-Z", "unstable-options", "--artifact-dir",
|
185
|
+
scripts_dir.as_posix()
|
186
|
+
|
178
187
|
]
|
179
188
|
|
189
|
+
clean = []
|
190
|
+
|
191
|
+
clean.append(
|
192
|
+
[
|
193
|
+
"rm", (scripts_dir / "*.pdb").as_posix(), "||", "true"
|
194
|
+
]
|
195
|
+
)
|
196
|
+
clean.append(
|
197
|
+
[
|
198
|
+
"rm", (scripts_dir / "*.drawf").as_posix(), "||", "true"
|
199
|
+
]
|
200
|
+
)
|
201
|
+
|
180
202
|
if self.dev_mode:
|
181
203
|
logger.info(f"Dev mode enabled for Maturin project '{self.name}'. Only running develop command.")
|
182
|
-
return [develop_command]
|
204
|
+
return [cargo_bins, *clean, develop_command]
|
183
205
|
|
184
206
|
build_sdist_command = [
|
185
207
|
"uvx",
|
@@ -192,7 +214,7 @@ class Project:
|
|
192
214
|
"-o",
|
193
215
|
resolved_dist_dir,
|
194
216
|
]
|
195
|
-
return [develop_command, build_sdist_command]
|
217
|
+
return [cargo_bins, *clean, develop_command, build_sdist_command]
|
196
218
|
|
197
219
|
# Default to 'uv build' for other backends or if backend is not 'maturin'
|
198
220
|
# This covers standard Python packages (setuptools, hatchling, etc.)
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"""Example of using BibManager."""
|
2
|
-
from fabricatio import BibManager, logger
|
3
|
-
|
4
|
-
b = BibManager("Exported Items.bib")
|
5
|
-
logger.success(
|
6
|
-
b.get_cite_key_by_title("A Negative Selection Immune System Inspired Methodology for Fault Diagnosis of Wind Turbines"))
|
7
|
-
logger.success(
|
8
|
-
b.get_cite_key_fuzzy(
|
9
|
-
"System Inspired Methodology for Fault"
|
10
|
-
)
|
11
|
-
)
|
@@ -1 +0,0 @@
|
|
1
|
-
"""A module containing some builtin workflows."""
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/cryptography-ctf-solver.hbs
RENAMED
File without changes
|
File without changes
|
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/draft_rating_criteria.hbs
RENAMED
File without changes
|
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/draft_rating_weights_klee.hbs
RENAMED
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/draft_tool_usage_code.hbs
RENAMED
File without changes
|
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/extract_criteria_from_reasons.hbs
RENAMED
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/extract_reasons_from_examples.hbs
RENAMED
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/find-security-vulnerabilities.hbs
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/research_content_summary.hbs
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/ruleset_requirement_breakdown.hbs
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{fabricatio-0.4.0.dev5 → fabricatio-0.4.1.dev1}/templates/built-in/write-github-pull-request.hbs
RENAMED
File without changes
|
File without changes
|