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.
@@ -7,157 +7,325 @@ from pydantic import Field
7
7
 
8
8
 
9
9
  class Equation(Base):
10
- """Structured representation of mathematical equations (including their physical or conceptual meanings)."""
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
- """A concise explanation of the equation's meaning, purpose, and relevance in the context of the research."""
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
- """The LaTeX code used to represent the equation in a publication-ready format."""
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
- """Structured representation of figures (including their academic significance and explanatory captions)."""
31
+ """Visual component specification for technical communication.
32
+
33
+ Combines graphical assets with structured academic captioning.
34
+ """
21
35
 
22
36
  description: str
23
- """A detailed explanation of the figure's content and its role in conveying key insights."""
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
- """The caption accompanying the figure, summarizing its main points and academic value."""
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
- """The file path to the figure"""
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
- """Structured representation of highlighted elements in an academic paper (including equations, algorithms, figures, and tables)."""
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
- """Core mathematical equations that represent breakthroughs in the field, accompanied by explanations of their physical or conceptual significance,Should always be in LaTeX format wrapped in $ or $$ signs."""
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
- """Pseudocode for key algorithms, annotated to highlight innovative components."""
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
- """Critical diagrams or illustrations, each accompanied by a caption explaining their academic importance."""
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
- """Important data tables, annotated to indicate statistical significance or other notable findings."""
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
- """Structured representation of the core elements of an academic paper(providing a comprehensive digital profile of the paper's essential information)."""
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
- """The full title of the paper, including any subtitles if applicable."""
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
- """A list of the paper's authors, typically in the order of contribution."""
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
- """A list of keywords that summarize the paper's focus and facilitate indexing."""
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
- """The year in which the paper was published."""
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
- """A collection of highlighted elements in the paper, including equations, algorithms, figures, and tables."""
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
- """The research domains or fields addressed by the paper (e.g., ['Natural Language Processing', 'Computer Vision'])."""
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
- """A structured abstract that outlines the research problem, methodology, and conclusions in three distinct sections."""
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
- """Key academic contributions that distinguish the paper from prior work in the field."""
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
- """Specific technical innovations introduced by the research, listed as individual points."""
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
- """A clearly defined research question or problem addressed by the study."""
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
- """An analysis of the methodological or experimental limitations of the research."""
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
- """Suggestions for potential directions or topics for follow-up studies."""
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
- """An assessment of the paper's potential influence on the development of the field."""
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 representation of the proposal for an academic paper."""
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
- """The proposed title of the paper."""
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
- """The specific research problem or question that the paper aims to address."""
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
- """The main objective or goal of the research, outlining what the study aims to achieve."""
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
- """The methods used in the research, including the approach, techniques, and tools employed."""
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
- """Structured representation of the subsections of an academic paper."""
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
- """The title of the subsection."""
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
- """A brief description of the subsection's content should be, how it fits into the overall structure of the paper, and its significance in the context of the research."""
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
- """Structured representation of the sections of an academic paper."""
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
- """The title of the section."""
250
+ """Section title indicating methodological phase or conceptual component (Title Case).
251
+ Example: 'Architecture Search Methodology'"""
252
+
127
253
  description: str = Field(...)
128
- """A brief description of the section's content should be, how it fits into the overall structure of the paper, and its significance in the context of the research."""
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
- """The subsections of the section, outlining their content and significance."""
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
- """Structured representation of the chapters of an academic paper."""
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
- """The title of the chapter."""
271
+ """Chapter title reflecting standard academic sections (Title Case).
272
+ Example: 'Experimental Evaluation', 'Theoretical Framework'"""
273
+
138
274
  description: str = Field(...)
139
- """A brief description of the chapter's content should be, how it fits into the overall structure of the paper, and its significance in the context of the research."""
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
- """The sections of the chapter, outlining their content and significance."""
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
- """Structured representation of the outline for an academic paper."""
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
- """The proposed title of the paper."""
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
- """A brief description of the research problem or question that the paper aims to address manipulating methods or techniques"""
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
- """The chapters of the paper, outlining their content and significance."""
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
- """Finalized dump of the article outline.
315
+ """Generates standardized hierarchical markup for paper drafting systems.
158
316
 
159
317
  Returns:
160
- str: The finalized dump of the article outline.
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
 
@@ -81,6 +81,7 @@ class ValidateKwargs[T](GenerateKwargs, total=False):
81
81
 
82
82
  default: T
83
83
  max_validations: int
84
+ co_extractor: GenerateKwargs
84
85
 
85
86
 
86
87
  # noinspection PyTypedDict
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
- """ The registry of events and workflows."""
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
- """Register the workflows in the role to the event bus."""
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 the workflows in the role to the event bus."""
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
- """Resolve the configuration of the role."""
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
  (