fabricatio 0.2.6.dev4__cp39-cp39-win_amd64.whl → 0.2.6.dev6__cp39-cp39-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.cp39-win_amd64.pyd +0 -0
- fabricatio/actions/article.py +7 -4
- fabricatio/capabilities/rag.py +3 -3
- fabricatio/capabilities/task.py +2 -2
- fabricatio/config.py +21 -18
- fabricatio/models/action.py +100 -40
- fabricatio/models/extra.py +220 -52
- fabricatio/models/kwargs_types.py +1 -0
- fabricatio/models/role.py +30 -6
- fabricatio/models/usages.py +63 -31
- fabricatio/models/utils.py +21 -0
- fabricatio/parser.py +1 -0
- {fabricatio-0.2.6.dev4.data → fabricatio-0.2.6.dev6.data}/scripts/tdown.exe +0 -0
- {fabricatio-0.2.6.dev4.dist-info → fabricatio-0.2.6.dev6.dist-info}/METADATA +1 -1
- {fabricatio-0.2.6.dev4.dist-info → fabricatio-0.2.6.dev6.dist-info}/RECORD +17 -17
- {fabricatio-0.2.6.dev4.dist-info → fabricatio-0.2.6.dev6.dist-info}/WHEEL +1 -1
- {fabricatio-0.2.6.dev4.dist-info → fabricatio-0.2.6.dev6.dist-info}/licenses/LICENSE +0 -0
fabricatio/models/extra.py
CHANGED
@@ -7,157 +7,325 @@ from pydantic import Field
|
|
7
7
|
|
8
8
|
|
9
9
|
class Equation(Base):
|
10
|
-
"""
|
10
|
+
"""Mathematical formalism specification for research contributions.
|
11
|
+
|
12
|
+
Encodes equations with dual representation: semantic meaning and typeset-ready notation.
|
13
|
+
"""
|
11
14
|
|
12
15
|
description: str
|
13
|
-
"""
|
16
|
+
"""Equation significance structured in three elements:
|
17
|
+
1. Physical/conceptual meaning
|
18
|
+
2. Role in technical workflow
|
19
|
+
3. Relationship to paper's core contribution
|
20
|
+
Example: 'Defines constrained search space dimensionality reduction. Used in architecture optimization phase (Section 3.2). Enables 40% parameter reduction.'"""
|
14
21
|
|
15
22
|
latex_code: str
|
16
|
-
"""
|
23
|
+
"""LaTeX representation following academic typesetting standards:
|
24
|
+
- Must use equation environment
|
25
|
+
- Multiline equations aligned at '='
|
26
|
+
- Unit annotations where applicable
|
27
|
+
Example: r'\begin{equation} \\mathcal{L}_{NAS} = \alpha \\|\theta\\|_2 + \beta H(p) \\end{equation}'"""
|
17
28
|
|
18
29
|
|
19
30
|
class Figure(Base):
|
20
|
-
"""
|
31
|
+
"""Visual component specification for technical communication.
|
32
|
+
|
33
|
+
Combines graphical assets with structured academic captioning.
|
34
|
+
"""
|
21
35
|
|
22
36
|
description: str
|
23
|
-
"""
|
37
|
+
"""Figure interpretation guide containing:
|
38
|
+
1. Key visual elements mapping
|
39
|
+
2. Data representation methodology
|
40
|
+
3. Connection to research findings
|
41
|
+
Example: 'Architecture search space topology (left) vs. convergence curves (right). Demonstrates NAS efficiency gains through constrained search.'"""
|
24
42
|
|
25
43
|
figure_caption: str
|
26
|
-
"""
|
44
|
+
"""Complete caption following Nature-style guidelines:
|
45
|
+
1. Brief overview statement (首句总结)
|
46
|
+
2. Technical detail layer
|
47
|
+
3. Result implication
|
48
|
+
Example: 'Figure 3: Differentiable NAS framework. (a) Search space topology with constrained dimensions. (b) Training convergence across language pairs. Dashed lines indicate baseline methods.'"""
|
27
49
|
|
28
50
|
figure_path: str
|
29
|
-
"""
|
51
|
+
"""Filesystem path to high-resolution vector graphic (PDF/EPS/SVG).
|
52
|
+
Strict validation requirements:
|
53
|
+
- Absolute path under /assets/figures/
|
54
|
+
- Naming convention: fig[chapter]-[section]_[description].pdf
|
55
|
+
Example: '/assets/figures/fig3-2_nas_convergence.pdf'"""
|
30
56
|
|
31
57
|
|
32
58
|
class Highlightings(Base):
|
33
|
-
"""
|
59
|
+
"""Technical showcase aggregator for research artifacts.
|
60
|
+
|
61
|
+
Curates core scientific components with machine-parseable annotations.
|
62
|
+
"""
|
34
63
|
|
35
|
-
# Academic Achievements Showcase
|
36
64
|
highlighted_equations: List[Equation] = Field(default_factory=list)
|
37
|
-
"""
|
65
|
+
"""3-5 pivotal equations representing theoretical contributions.
|
66
|
+
Each must:
|
67
|
+
- Use $$ wrapping for display math
|
68
|
+
- Contain at least one novel operator/symbol
|
69
|
+
- Reference in Methods/Results sections
|
70
|
+
Example: Equation describing proposed loss function"""
|
38
71
|
|
39
72
|
highlighted_algorithms: List[str] = Field(default_factory=list)
|
40
|
-
"""
|
73
|
+
"""Algorithm pseudocode following ACM style:
|
74
|
+
1. Numbered steps with bold keywords
|
75
|
+
2. Complexity analysis subsection
|
76
|
+
3. Novel components marked with ※
|
77
|
+
Example:
|
78
|
+
'Algorithm 1: Constrained NAS
|
79
|
+
1. Initialize search space with §3.1 constraints ※
|
80
|
+
2. While not converged:
|
81
|
+
a. Compute gradient ▽θ
|
82
|
+
b. Update architecture parameters...'"""
|
41
83
|
|
42
84
|
highlighted_figures: List[Figure] = Field(default_factory=list)
|
43
|
-
"""
|
85
|
+
"""4-6 key figures demonstrating:
|
86
|
+
1. Framework overview (1 required)
|
87
|
+
2. Quantitative results (2-3 required)
|
88
|
+
3. Ablation studies (1 optional)
|
89
|
+
Each must appear in Results/Discussion chapters."""
|
44
90
|
|
45
91
|
highlighted_tables: List[str] = Field(default_factory=list)
|
46
|
-
"""
|
92
|
+
"""Critical data presentations using booktabs format:
|
93
|
+
- Minimum 3 comparison baselines
|
94
|
+
- Statistical significance markers (*/†/‡)
|
95
|
+
- Standard deviation in parentheses
|
96
|
+
Example:
|
97
|
+
\begin{tabular}{lcc}
|
98
|
+
\toprule
|
99
|
+
Method & BLEU & Δ Params \\
|
100
|
+
\\midrule
|
101
|
+
Ours & 32.4 & -41\\%† \\
|
102
|
+
\bottomrule
|
103
|
+
\\end{tabular}"""
|
47
104
|
|
48
105
|
|
49
106
|
class ArticleEssence(ProposedAble, Display, PrepareVectorization):
|
50
|
-
"""
|
107
|
+
"""Semantic fingerprint of academic paper for structured analysis.
|
108
|
+
|
109
|
+
Encodes research artifacts with dual human-machine interpretability.
|
110
|
+
"""
|
51
111
|
|
52
|
-
# Basic Metadata
|
53
112
|
title: str = Field(...)
|
54
|
-
"""
|
113
|
+
"""Complete title with technical specificity (12-18 words).
|
114
|
+
Must contain:
|
115
|
+
1. Methodology focus
|
116
|
+
2. Application domain
|
117
|
+
3. Performance metric
|
118
|
+
Example: 'EfficientViT: Multi-Scale Linear Attention for High-Resolution Dense Prediction'"""
|
55
119
|
|
56
120
|
authors: List[str]
|
57
|
-
"""
|
121
|
+
"""Author list with institutional annotations.
|
122
|
+
Format: [First Last¹, First Last²]
|
123
|
+
Superscripts mapping to affiliations.
|
124
|
+
Example: ['Yuanhao Zhou¹', 'Lei Chen²']"""
|
58
125
|
|
59
126
|
keywords: List[str]
|
60
|
-
"""
|
127
|
+
"""5-8 ACM CCS concepts in camel case.
|
128
|
+
Example: ['Computing methodologies~Neural networks', 'Hardware~Emerging technologies']"""
|
61
129
|
|
62
130
|
publication_year: int
|
63
|
-
"""
|
131
|
+
"""Publication timestamp in ISO 8601 (YYYY format).
|
132
|
+
Constraint: 2017 ≤ year ≤ current_year"""
|
64
133
|
|
65
|
-
# Core Content Elements
|
66
134
|
highlightings: Highlightings = Field(default_factory=Highlightings)
|
67
|
-
"""
|
135
|
+
"""Technical highlight reel containing:
|
136
|
+
- Core equations (Theory)
|
137
|
+
- Key algorithms (Implementation)
|
138
|
+
- Critical figures (Results)
|
139
|
+
- Benchmark tables (Evaluation)"""
|
68
140
|
|
69
141
|
domain: List[str]
|
70
|
-
"""
|
142
|
+
"""Primary research domains from ACM CCS 2023 taxonomy.
|
143
|
+
Exactly 2-3 categories required.
|
144
|
+
Example: ['Computing methodologies → Machine learning']"""
|
71
145
|
|
72
146
|
abstract: str = Field(...)
|
73
|
-
"""
|
147
|
+
"""Three-paragraph structured abstract:
|
148
|
+
Paragraph 1: Problem & Motivation (2-3 sentences)
|
149
|
+
Paragraph 2: Methodology & Innovations (3-4 sentences)
|
150
|
+
Paragraph 3: Results & Impact (2-3 sentences)
|
151
|
+
Total length: 150-250 words"""
|
74
152
|
|
75
153
|
core_contributions: List[str]
|
76
|
-
"""
|
154
|
+
"""3-5 technical contributions using CRediT taxonomy verbs.
|
155
|
+
Each item starts with action verb.
|
156
|
+
Example:
|
157
|
+
- 'Developed constrained NAS framework'
|
158
|
+
- 'Established cross-lingual transfer metrics'"""
|
77
159
|
|
78
160
|
technical_novelty: List[str]
|
79
|
-
"""
|
161
|
+
"""Patent-style claims with technical specificity.
|
162
|
+
Format: 'A [system/method] comprising [novel components]...'
|
163
|
+
Example:
|
164
|
+
'A neural architecture search system comprising:
|
165
|
+
a differentiable constrained search space;
|
166
|
+
multi-lingual transferability predictors...'"""
|
80
167
|
|
81
|
-
# Academic Discussion Dimensions
|
82
168
|
research_problems: List[str]
|
83
|
-
"""
|
169
|
+
"""Problem statements as how/why questions.
|
170
|
+
Example:
|
171
|
+
- 'How to reduce NAS computational overhead while maintaining search diversity?'
|
172
|
+
- 'Why do existing architectures fail in low-resource cross-lingual transfer?'"""
|
84
173
|
|
85
174
|
limitations: List[str]
|
86
|
-
"""
|
175
|
+
"""Technical limitations analysis containing:
|
176
|
+
1. Constraint source (data/method/theory)
|
177
|
+
2. Impact quantification
|
178
|
+
3. Mitigation pathway
|
179
|
+
Example:
|
180
|
+
'Methodology constraint: Single-objective optimization (affects 5% edge cases),
|
181
|
+
mitigated through future multi-task extension'"""
|
87
182
|
|
88
183
|
future_work: List[str]
|
89
|
-
"""
|
184
|
+
"""Research roadmap items with 3 horizons:
|
185
|
+
1. Immediate extensions (1 year)
|
186
|
+
2. Mid-term directions (2-3 years)
|
187
|
+
3. Long-term vision (5+ years)
|
188
|
+
Example:
|
189
|
+
'Short-term: Adapt framework for vision transformers (ongoing with CVPR submission)'"""
|
90
190
|
|
91
191
|
impact_analysis: List[str]
|
92
|
-
"""
|
192
|
+
"""Bibliometric impact projections:
|
193
|
+
- Expected citation counts (next 3 years)
|
194
|
+
- Target application domains
|
195
|
+
- Standard adoption potential
|
196
|
+
Example:
|
197
|
+
'Predicted 150+ citations via integration into MMEngine (Alibaba OpenMMLab)'"""
|
93
198
|
|
94
199
|
def _prepare_vectorization_inner(self) -> str:
|
95
200
|
return self.model_dump_json()
|
96
201
|
|
97
202
|
|
98
203
|
class ArticleProposal(ProposedAble, Display):
|
99
|
-
"""Structured
|
204
|
+
"""Structured proposal for academic paper development with core research elements.
|
205
|
+
|
206
|
+
Guides LLM in generating comprehensive research proposals with clearly defined components.
|
207
|
+
"""
|
100
208
|
|
101
209
|
title: str = Field(...)
|
102
|
-
"""
|
210
|
+
"""Paper title in academic style (Title Case, 8-15 words). Example: 'Exploring Neural Architecture Search for Low-Resource Machine Translation'"""
|
103
211
|
|
104
212
|
focused_problem: List[str] = Field(default_factory=list)
|
105
|
-
"""
|
213
|
+
"""Specific research problem(s) or question(s) addressed (list of 1-3 concise statements).
|
214
|
+
Example: ['NAS computational overhead in low-resource settings', 'Architecture transferability across language pairs']"""
|
215
|
+
|
106
216
|
research_aim: List[str] = Field(default_factory=list)
|
107
|
-
"""
|
217
|
+
"""Primary research objectives (list of 2-4 measurable goals).
|
218
|
+
Example: ['Develop parameter-efficient NAS framework', 'Establish cross-lingual architecture transfer metrics']"""
|
219
|
+
|
108
220
|
research_methods: List[str] = Field(default_factory=list)
|
109
|
-
"""
|
221
|
+
"""Methodological components (list of techniques/tools).
|
222
|
+
Example: ['Differentiable architecture search', 'Transformer-based search space', 'Multi-lingual perplexity evaluation']"""
|
110
223
|
|
111
224
|
|
112
225
|
class ArticleSubsectionOutline(Base):
|
113
|
-
"""
|
226
|
+
"""Atomic content unit within academic paper sections.
|
227
|
+
|
228
|
+
Provides structured content specification for LLM-generated subsections.
|
229
|
+
"""
|
114
230
|
|
115
231
|
title: str = Field(...)
|
116
|
-
"""
|
232
|
+
"""Subsection title reflecting specific content focus (Title Case, 3-8 words).
|
233
|
+
Example: 'Differentiable Search Space Design'"""
|
117
234
|
|
118
235
|
description: str = Field(...)
|
119
|
-
"""
|
236
|
+
"""Content specification with three required elements:
|
237
|
+
1. Core technical content
|
238
|
+
2. Structural purpose in section
|
239
|
+
3. Research significance
|
240
|
+
Example: 'Introduces continuous relaxation method for search space, enabling gradient-based optimization. Forms technical foundation for Section 3. Critical for reducing search complexity.'"""
|
120
241
|
|
121
242
|
|
122
243
|
class ArticleSectionOutline(Base):
|
123
|
-
"""
|
244
|
+
"""Primary organizational unit within paper chapters.
|
245
|
+
|
246
|
+
Defines section-level structure with nested subsections for hierarchical content organization.
|
247
|
+
"""
|
124
248
|
|
125
249
|
title: str = Field(...)
|
126
|
-
"""
|
250
|
+
"""Section title indicating methodological phase or conceptual component (Title Case).
|
251
|
+
Example: 'Architecture Search Methodology'"""
|
252
|
+
|
127
253
|
description: str = Field(...)
|
128
|
-
"""
|
254
|
+
"""Functional description covering:
|
255
|
+
1. Section's research stage
|
256
|
+
2. Key contributions
|
257
|
+
3. Flow relationship with adjacent sections
|
258
|
+
Example: 'Presents core NAS framework building on literature from Section 2. Introduces novel constrained search space. Leads to implementation details in Section 4.'"""
|
259
|
+
|
129
260
|
subsections: List[ArticleSubsectionOutline]
|
130
|
-
"""
|
261
|
+
"""Ordered sequence of 3-5 subsections implementing IMRaD structure within section. Maintains logical flow from problem statement to technical solution."""
|
131
262
|
|
132
263
|
|
133
264
|
class ArticleChapterOutline(Base):
|
134
|
-
"""
|
265
|
+
"""Macro-level paper organization unit.
|
266
|
+
|
267
|
+
Represents major paper divisions (Introduction, Methodology, etc.) with hierarchical section structure.
|
268
|
+
"""
|
135
269
|
|
136
270
|
title: str = Field(...)
|
137
|
-
"""
|
271
|
+
"""Chapter title reflecting standard academic sections (Title Case).
|
272
|
+
Example: 'Experimental Evaluation', 'Theoretical Framework'"""
|
273
|
+
|
138
274
|
description: str = Field(...)
|
139
|
-
"""
|
275
|
+
"""Chapter role specification containing:
|
276
|
+
1. Research phase covered
|
277
|
+
2. Chapter-specific objectives
|
278
|
+
3. Relationship to overall paper thesis
|
279
|
+
Example: 'Validates NAS framework through multilingual experiments. Demonstrates method effectiveness across 10 language pairs. Supports core thesis of parameter-efficient architecture search.'"""
|
280
|
+
|
140
281
|
sections: List[ArticleSectionOutline]
|
141
|
-
"""
|
282
|
+
"""3-5 sections implementing chapter's main function. Ordered to maintain academic paper logic:
|
283
|
+
Introduction → Related Work → Methods → Experiments → Analysis"""
|
142
284
|
|
143
285
|
|
144
286
|
class ArticleOutline(ProposedAble, Display, FinalizedDumpAble):
|
145
|
-
"""
|
287
|
+
"""Complete hierarchical structure for academic paper generation.
|
288
|
+
|
289
|
+
Provides multi-level outline specification for LLM-based paper drafting with strict academic conventions.
|
290
|
+
"""
|
146
291
|
|
147
292
|
title: str = Field(...)
|
148
|
-
"""
|
293
|
+
"""Full paper title with technical specificity (Title Case, 12-18 words).
|
294
|
+
Example: 'Parameter-Efficient Neural Architecture Search for Low-Resource Machine Translation: A Cross-Lingual Transfer Approach'"""
|
149
295
|
|
150
296
|
prospect: str = Field(...)
|
151
|
-
"""
|
297
|
+
"""Unified problem-solution statement combining:
|
298
|
+
1. Core research gap
|
299
|
+
2. Proposed methodology
|
300
|
+
3. Expected contribution
|
301
|
+
Example: 'Addressing NAS computational barriers in low-resource NLP through differentiable constrained search spaces and cross-lingual transfer metrics, enabling efficient architecture discovery for 50+ languages.'"""
|
152
302
|
|
153
303
|
chapters: List[ArticleChapterOutline]
|
154
|
-
"""
|
304
|
+
"""Standard academic structure (5-8 chapters):
|
305
|
+
1. Introduction
|
306
|
+
2. Related Work
|
307
|
+
3. Methodology
|
308
|
+
4. Experiments
|
309
|
+
5. Results
|
310
|
+
6. Discussion
|
311
|
+
7. Conclusion
|
312
|
+
Maintains IMRaD logical flow with clear inter-chapter transitions."""
|
155
313
|
|
156
314
|
def finalized_dump(self) -> str:
|
157
|
-
"""
|
315
|
+
"""Generates standardized hierarchical markup for paper drafting systems.
|
158
316
|
|
159
317
|
Returns:
|
160
|
-
str:
|
318
|
+
str: Multi-level outline using academic markup conventions:
|
319
|
+
= Chapter Title
|
320
|
+
== Section Title
|
321
|
+
=== Subsection Title
|
322
|
+
==== Subsubsection Title (if needed)
|
323
|
+
|
324
|
+
Example:
|
325
|
+
= Methodology
|
326
|
+
== Neural Architecture Search Framework
|
327
|
+
=== Differentiable Search Space
|
328
|
+
=== Constrained Optimization Approach
|
161
329
|
"""
|
162
330
|
lines: List[str] = []
|
163
331
|
|
fabricatio/models/role.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"""Module that contains the Role class."""
|
1
|
+
"""Module that contains the Role class for managing workflows and their event registrations."""
|
2
2
|
|
3
3
|
from typing import Any, Self, Set
|
4
4
|
|
@@ -13,19 +13,36 @@ from pydantic import Field
|
|
13
13
|
|
14
14
|
|
15
15
|
class Role(ProposeTask, HandleTask, Correct):
|
16
|
-
"""Class that represents a role with a registry of events and workflows.
|
16
|
+
"""Class that represents a role with a registry of events and workflows.
|
17
|
+
|
18
|
+
A Role serves as a container for workflows, managing their registration to events
|
19
|
+
and providing them with shared configuration like tools and personality.
|
20
|
+
|
21
|
+
Attributes:
|
22
|
+
registry: Mapping of events to workflows that handle them
|
23
|
+
toolboxes: Set of toolboxes available to this role and its workflows
|
24
|
+
"""
|
17
25
|
|
18
26
|
registry: dict[Event | str, WorkFlow] = Field(default_factory=dict)
|
19
|
-
"""
|
27
|
+
"""The registry of events and workflows."""
|
20
28
|
|
21
29
|
toolboxes: Set[ToolBox] = Field(default_factory=set)
|
30
|
+
"""Collection of tools available to this role."""
|
22
31
|
|
23
32
|
def model_post_init(self, __context: Any) -> None:
|
24
|
-
"""
|
33
|
+
"""Initialize the role by resolving configurations and registering workflows.
|
34
|
+
|
35
|
+
Args:
|
36
|
+
__context: The context used for initialization
|
37
|
+
"""
|
25
38
|
self.resolve_configuration().register_workflows()
|
26
39
|
|
27
40
|
def register_workflows(self) -> Self:
|
28
|
-
"""Register
|
41
|
+
"""Register each workflow in the registry to its corresponding event in the event bus.
|
42
|
+
|
43
|
+
Returns:
|
44
|
+
Self: The role instance for method chaining
|
45
|
+
"""
|
29
46
|
for event, workflow in self.registry.items():
|
30
47
|
logger.debug(
|
31
48
|
f"Registering workflow: `{workflow.name}` for event: `{Event.instantiate_from(event).collapse()}`"
|
@@ -34,7 +51,14 @@ class Role(ProposeTask, HandleTask, Correct):
|
|
34
51
|
return self
|
35
52
|
|
36
53
|
def resolve_configuration(self) -> Self:
|
37
|
-
"""
|
54
|
+
"""Apply role-level configuration to all workflows in the registry.
|
55
|
+
|
56
|
+
This includes setting up fallback configurations, injecting personality traits,
|
57
|
+
and providing tool access to workflows and their steps.
|
58
|
+
|
59
|
+
Returns:
|
60
|
+
Self: The role instance for method chaining
|
61
|
+
"""
|
38
62
|
for workflow in self.registry.values():
|
39
63
|
logger.debug(f"Resolving config for workflow: `{workflow.name}`")
|
40
64
|
(
|