fabricatio 0.2.6.dev6__cp39-cp39-win_amd64.whl → 0.2.6.dev7__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/capabilities/rag.py +3 -3
- fabricatio/models/extra.py +396 -77
- fabricatio/models/kwargs_types.py +16 -6
- {fabricatio-0.2.6.dev6.data → fabricatio-0.2.6.dev7.data}/scripts/tdown.exe +0 -0
- {fabricatio-0.2.6.dev6.dist-info → fabricatio-0.2.6.dev7.dist-info}/METADATA +1 -1
- {fabricatio-0.2.6.dev6.dist-info → fabricatio-0.2.6.dev7.dist-info}/RECORD +9 -9
- {fabricatio-0.2.6.dev6.dist-info → fabricatio-0.2.6.dev7.dist-info}/WHEEL +0 -0
- {fabricatio-0.2.6.dev6.dist-info → fabricatio-0.2.6.dev7.dist-info}/licenses/LICENSE +0 -0
Binary file
|
fabricatio/capabilities/rag.py
CHANGED
@@ -15,7 +15,7 @@ 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,
|
@@ -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
|
fabricatio/models/extra.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
"""Extra models for built-in actions."""
|
2
2
|
|
3
|
-
from typing import List
|
3
|
+
from typing import List, Self
|
4
4
|
|
5
5
|
from fabricatio.models.generic import Base, Display, FinalizedDumpAble, PrepareVectorization, ProposedAble
|
6
6
|
from pydantic import Field
|
7
7
|
|
8
8
|
|
9
|
+
# <editor-fold desc="ArticleEssence">
|
9
10
|
class Equation(Base):
|
10
11
|
"""Mathematical formalism specification for research contributions.
|
11
12
|
|
@@ -200,6 +201,9 @@ class ArticleEssence(ProposedAble, Display, PrepareVectorization):
|
|
200
201
|
return self.model_dump_json()
|
201
202
|
|
202
203
|
|
204
|
+
# </editor-fold>
|
205
|
+
|
206
|
+
|
203
207
|
class ArticleProposal(ProposedAble, Display):
|
204
208
|
"""Structured proposal for academic paper development with core research elements.
|
205
209
|
|
@@ -221,119 +225,434 @@ class ArticleProposal(ProposedAble, Display):
|
|
221
225
|
"""Methodological components (list of techniques/tools).
|
222
226
|
Example: ['Differentiable architecture search', 'Transformer-based search space', 'Multi-lingual perplexity evaluation']"""
|
223
227
|
|
228
|
+
technical_approaches: List[str] = Field(default_factory=list)
|
224
229
|
|
225
|
-
class ArticleSubsectionOutline(Base):
|
226
|
-
"""Atomic content unit within academic paper sections.
|
227
230
|
|
228
|
-
|
229
|
-
|
231
|
+
# <editor-fold desc="ArticleOutline">
|
232
|
+
class ArticleSubsectionOutline(Base):
|
233
|
+
"""Atomic research component specification for academic paper generation."""
|
230
234
|
|
231
235
|
title: str = Field(...)
|
232
|
-
"""
|
233
|
-
|
236
|
+
"""Technical focus descriptor following ACL title conventions:
|
237
|
+
- Title Case with 4-8 word limit
|
238
|
+
- Contains method and domain components
|
239
|
+
Example: 'Differentiable Search Space Optimization'"""
|
234
240
|
|
235
241
|
description: str = Field(...)
|
236
|
-
"""
|
237
|
-
1. Core
|
238
|
-
2. Structural
|
239
|
-
3. Research
|
240
|
-
Example: 'Introduces continuous relaxation method for search space, enabling gradient-based optimization. Forms technical foundation for Section 3. Critical for reducing search complexity.'"""
|
242
|
+
"""Tripartite content specification with strict structure:
|
243
|
+
1. Technical Core: Method/algorithm/formalism (1 sentence)
|
244
|
+
2. Structural Role: Placement rationale in section (1 clause)
|
245
|
+
3. Research Value: Contribution to paper's thesis (1 clause)
|
241
246
|
|
247
|
+
Example: 'Introduces entropy-constrained architecture parameters enabling
|
248
|
+
gradient-based NAS. Serves as foundation for Section 3.2. Critical for
|
249
|
+
maintaining search space diversity while ensuring convergence.'"""
|
242
250
|
|
243
|
-
class ArticleSectionOutline(Base):
|
244
|
-
"""Primary organizational unit within paper chapters.
|
245
251
|
|
246
|
-
|
247
|
-
"""
|
252
|
+
class ArticleSectionOutline(Base):
|
253
|
+
"""Methodological unit organizing related technical components."""
|
248
254
|
|
249
255
|
title: str = Field(...)
|
250
|
-
"""
|
251
|
-
|
256
|
+
"""Process-oriented header with phase identification:
|
257
|
+
- Title Case with 5-10 word limit
|
258
|
+
- Indicates research stage/methodological focus
|
259
|
+
Example: 'Cross-Lingual Evaluation Protocol'"""
|
252
260
|
|
253
261
|
description: str = Field(...)
|
254
|
-
"""Functional
|
255
|
-
1.
|
256
|
-
2.
|
257
|
-
3.
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
+
"""Functional specification with four required elements:
|
263
|
+
1. Research Stage: Paper progression position
|
264
|
+
2. Technical Innovations: Novel components
|
265
|
+
3. Scholarly Context: Relationship to prior work
|
266
|
+
4. Forward Flow: Connection to subsequent sections
|
267
|
+
|
268
|
+
Example: 'Implements constrained NAS framework building on Section 2's
|
269
|
+
theoretical foundations. Introduces dynamic resource allocation mechanism.
|
270
|
+
Directly supports Results section through ablation study parameters.'"""
|
271
|
+
|
272
|
+
subsections: List[ArticleSubsectionOutline] = Field(..., min_length=3, max_length=5)
|
273
|
+
"""IMRaD-compliant substructure with technical progression:
|
274
|
+
1. Conceptual Framework
|
275
|
+
2. Methodological Details
|
276
|
+
3. Implementation Strategy
|
277
|
+
4. Validation Approach
|
278
|
+
5. Transition Logic
|
279
|
+
|
280
|
+
Example Flow:
|
281
|
+
[
|
282
|
+
'Search Space Constraints',
|
283
|
+
'Gradient Optimization Protocol',
|
284
|
+
'Multi-GPU Implementation',
|
285
|
+
'Convergence Validation',
|
286
|
+
'Cross-Lingual Extension'
|
287
|
+
]"""
|
262
288
|
|
263
289
|
|
264
290
|
class ArticleChapterOutline(Base):
|
265
|
-
"""Macro-
|
266
|
-
|
267
|
-
Represents major paper divisions (Introduction, Methodology, etc.) with hierarchical section structure.
|
268
|
-
"""
|
291
|
+
"""Macro-structural unit implementing standard academic paper organization."""
|
269
292
|
|
270
293
|
title: str = Field(...)
|
271
|
-
"""
|
272
|
-
|
294
|
+
"""IMRaD-compliant chapter title with domain specification:
|
295
|
+
- Title Case with 2-4 word limit
|
296
|
+
- Matches standard paper sections
|
297
|
+
Example: 'Multilingual Evaluation Results'"""
|
273
298
|
|
274
299
|
description: str = Field(...)
|
275
|
-
"""
|
276
|
-
1. Research
|
277
|
-
2. Chapter-specific
|
278
|
-
3.
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
300
|
+
"""Strategic chapter definition containing:
|
301
|
+
1. Research Phase: Introduction/Methods/Results/etc.
|
302
|
+
2. Chapter Objectives: 3-5 specific goals
|
303
|
+
3. Thesis Alignment: Supported claims/contributions
|
304
|
+
4. Structural Flow: Adjacent chapter relationships
|
305
|
+
|
306
|
+
Example: 'Presents cross-lingual NAS results across 10 language pairs.
|
307
|
+
Validates efficiency claims from Introduction. Provides empirical basis
|
308
|
+
for Discussion chapter. Contrasts with single-language baselines.'"""
|
309
|
+
|
310
|
+
sections: List[ArticleSectionOutline] = Field(..., min_length=3, max_length=5)
|
311
|
+
"""Standard academic progression implementing chapter goals:
|
312
|
+
1. Context Establishment
|
313
|
+
2. Technical Presentation
|
314
|
+
3. Empirical Validation
|
315
|
+
4. Comparative Analysis
|
316
|
+
5. Synthesis
|
317
|
+
|
318
|
+
Example Structure:
|
319
|
+
[
|
320
|
+
'Experimental Setup',
|
321
|
+
'Monolingual Baselines',
|
322
|
+
'Cross-Lingual Transfer',
|
323
|
+
'Low-Resource Scaling',
|
324
|
+
'Error Analysis'
|
325
|
+
]"""
|
284
326
|
|
285
327
|
|
286
328
|
class ArticleOutline(ProposedAble, Display, FinalizedDumpAble):
|
287
|
-
"""Complete
|
288
|
-
|
289
|
-
Provides multi-level outline specification for LLM-based paper drafting with strict academic conventions.
|
290
|
-
"""
|
329
|
+
"""Complete academic paper blueprint with hierarchical validation."""
|
291
330
|
|
292
331
|
title: str = Field(...)
|
293
|
-
"""Full
|
294
|
-
|
332
|
+
"""Full technical title following ACL 2024 guidelines:
|
333
|
+
- Title Case with 12-18 word limit
|
334
|
+
- Structure: [Method] for [Task] via [Approach] in [Domain]
|
335
|
+
Example: 'Efficient Differentiable NAS for Low-Resource MT Through
|
336
|
+
Parameter-Sharing: A Cross-Lingual Study'"""
|
295
337
|
|
296
338
|
prospect: str = Field(...)
|
297
|
-
"""
|
298
|
-
1.
|
299
|
-
2.
|
300
|
-
3.
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
339
|
+
"""Consolidated research statement with four pillars:
|
340
|
+
1. Problem Identification: Current limitations
|
341
|
+
2. Methodological Response: Technical approach
|
342
|
+
3. Empirical Validation: Evaluation strategy
|
343
|
+
4. Scholarly Impact: Field contributions
|
344
|
+
|
345
|
+
Example: 'Addressing NAS computational barriers through constrained
|
346
|
+
differentiable search spaces, validated via cross-lingual MT experiments
|
347
|
+
across 50+ languages, enabling efficient architecture discovery with
|
348
|
+
60% reduced search costs.'"""
|
349
|
+
|
350
|
+
chapters: List[ArticleChapterOutline] = Field(..., min_length=5, max_length=8)
|
351
|
+
"""IMRaD structure with enhanced academic validation:
|
352
|
+
1. Introduction: Problem Space & Contributions
|
353
|
+
2. Background: Theoretical Foundations
|
354
|
+
3. Methods: Technical Innovations
|
355
|
+
4. Experiments: Protocol Design
|
356
|
+
5. Results: Empirical Findings
|
357
|
+
6. Discussion: Interpretation & Limitations
|
358
|
+
7. Conclusion: Synthesis & Future Work
|
359
|
+
8. Appendices: Supplementary Materials"""
|
313
360
|
|
314
361
|
def finalized_dump(self) -> str:
|
315
|
-
"""Generates standardized hierarchical markup for
|
362
|
+
"""Generates standardized hierarchical markup for academic publishing systems.
|
363
|
+
|
364
|
+
Implements ACL 2024 outline conventions with four-level structure:
|
365
|
+
= Chapter Title (Level 1)
|
366
|
+
== Section Title (Level 2)
|
367
|
+
=== Subsection Title (Level 3)
|
368
|
+
==== Subsubsection Title (Level 4)
|
316
369
|
|
317
370
|
Returns:
|
318
|
-
str:
|
319
|
-
= Chapter Title
|
320
|
-
== Section Title
|
321
|
-
=== Subsection Title
|
322
|
-
==== Subsubsection Title (if needed)
|
371
|
+
str: Strictly formatted outline with academic sectioning
|
323
372
|
|
324
373
|
Example:
|
325
374
|
= Methodology
|
326
375
|
== Neural Architecture Search Framework
|
327
376
|
=== Differentiable Search Space
|
328
|
-
|
377
|
+
==== Constrained Optimization Parameters
|
378
|
+
=== Implementation Details
|
379
|
+
== Evaluation Protocol
|
329
380
|
"""
|
330
381
|
lines: List[str] = []
|
382
|
+
for i, chapter in enumerate(self.chapters, 1):
|
383
|
+
lines.append(f"= Chapter {i}: {chapter.title}")
|
384
|
+
for j, section in enumerate(chapter.sections, 1):
|
385
|
+
lines.append(f"== {i}.{j} {section.title}")
|
386
|
+
for k, subsection in enumerate(section.subsections, 1):
|
387
|
+
lines.append(f"=== {i}.{j}.{k} {subsection.title}")
|
388
|
+
return "\n".join(lines)
|
389
|
+
|
390
|
+
|
391
|
+
# </editor-fold>
|
392
|
+
|
393
|
+
|
394
|
+
# <editor-fold desc="Article">
|
395
|
+
class Paragraph(ProposedAble):
|
396
|
+
"""Structured academic paragraph blueprint for controlled content generation."""
|
397
|
+
|
398
|
+
description: str
|
399
|
+
"""Functional summary of the paragraph's role in document structure.
|
400
|
+
Example: 'Establishes NAS efficiency improvements through differentiable methods'"""
|
401
|
+
|
402
|
+
writing_aim: List[str]
|
403
|
+
"""Specific communicative objectives for this paragraph's content.
|
404
|
+
Example: ['Introduce gradient-based NAS', 'Compare computational costs',
|
405
|
+
'Link efficiency to practical applications']"""
|
406
|
+
|
407
|
+
lines: List[str]
|
408
|
+
"""Hierarchically structured content with enforced rhetorical elements:
|
409
|
+
1. Topic Sentence: Principal claim/position (1 sentence)
|
410
|
+
2. Development: Evidence chain with citations (2-4 sentences)
|
411
|
+
3. Synthesis: Interpretation & significance (1 sentence)
|
412
|
+
4. Transition: Logical bridge to next paragraph (optional)
|
413
|
+
|
414
|
+
Example: [
|
415
|
+
'Differentiable NAS revolutionized architecture search efficiency.',
|
416
|
+
'DARTS reduced search costs from 2000+ to 4 GPU days (Liu et al., 2019) while maintaining competitive ImageNet accuracy.',
|
417
|
+
'This order-of-magnitude improvement enables NAS deployment in resource-constrained research contexts.',
|
418
|
+
'These efficiency gains directly impact our framework's design choices as detailed in Section 3.'
|
419
|
+
]"""
|
420
|
+
|
421
|
+
|
422
|
+
class SectionRef(ProposedAble):
|
423
|
+
"""Cross-component reference system for maintaining document consistency."""
|
424
|
+
|
425
|
+
ref_chapter_title: str
|
426
|
+
"""Title of referenced chapter (e.g., 'Methodology')"""
|
427
|
+
|
428
|
+
ref_section_title: str
|
429
|
+
"""Exact section header text (e.g., '3.2 Gradient Optimization')"""
|
331
430
|
|
332
|
-
|
333
|
-
|
334
|
-
for section in chapter.sections:
|
335
|
-
lines.append(f"== {section.title}")
|
336
|
-
for subsection in section.subsections:
|
337
|
-
lines.append(f"=== {subsection.title}")
|
431
|
+
ref_subsection_title: str
|
432
|
+
"""Specific subsection identifier (e.g., '3.2.1 Learning Rate Scheduling')"""
|
338
433
|
|
339
|
-
|
434
|
+
|
435
|
+
class ArticleBase(ProposedAble, Display):
|
436
|
+
"""Foundation for hierarchical document components with dependency tracking."""
|
437
|
+
|
438
|
+
description: str
|
439
|
+
"""Functional purpose statement for this component's role in the paper.
|
440
|
+
Example: 'Defines evaluation metrics for cross-lingual transfer experiments'"""
|
441
|
+
|
442
|
+
writing_aim: List[str]
|
443
|
+
"""Author intentions mapped to rhetorical moves:
|
444
|
+
Example: ['Establish metric validity', 'Compare with baseline approaches',
|
445
|
+
'Justify threshold selection']"""
|
446
|
+
|
447
|
+
title: str = Field(...)
|
448
|
+
"""Standardized academic header following ACL style guidelines:
|
449
|
+
- Title Case with maximal 12-word length
|
450
|
+
- No abbreviations without prior definition
|
451
|
+
Example: 'Multilingual Benchmark Construction'"""
|
452
|
+
|
453
|
+
support_to: List[SectionRef]
|
454
|
+
"""Upstream dependencies requiring this component's validation.
|
455
|
+
Format: List of hierarchical references to supported claims/sections
|
456
|
+
Example: [SectionRef(chapter='Results', section='4.1', subsection='4.1.2')]"""
|
457
|
+
|
458
|
+
depend_on: List[SectionRef]
|
459
|
+
"""Downstream prerequisites for content validity.
|
460
|
+
Format: List of references to foundational components
|
461
|
+
Example: [SectionRef(chapter='Methods', section='2.3', subsection='2.3.4')]"""
|
462
|
+
|
463
|
+
|
464
|
+
class ArticleSubsection(ArticleBase):
|
465
|
+
"""Atomic argumentative unit with technical specificity."""
|
466
|
+
|
467
|
+
title: str = Field(...)
|
468
|
+
"""Technical descriptor with maximal information density:
|
469
|
+
Format: [Method]-[Domain]-[Innovation]
|
470
|
+
Example: 'Transformer-Based Architecture Search Space'"""
|
471
|
+
|
472
|
+
support_to: List[SectionRef]
|
473
|
+
"""Immediate parent components and supported hypotheses.
|
474
|
+
Example: [SectionRef(chapter='Methods', section='3', subsection='3.1')]"""
|
475
|
+
|
476
|
+
depend_on: List[SectionRef]
|
477
|
+
"""Technical dependencies including equations, algorithms, and datasets.
|
478
|
+
Example: [SectionRef(chapter='Background', section='2.2', subsection='2.2.3')]"""
|
479
|
+
|
480
|
+
paragraphs: List[Paragraph] = Field(..., min_length=3, max_length=5)
|
481
|
+
"""Technical exposition following ACM writing guidelines:
|
482
|
+
1. Contextualization: Position in research design
|
483
|
+
2. Technical Detail: Equations/algorithms/code
|
484
|
+
3. Validation: Citations/experimental confirmation
|
485
|
+
4. Interpretation: Scholarly significance
|
486
|
+
5. Transition: Logical connection to subsequent content
|
487
|
+
|
488
|
+
Example Paragraph Chain:
|
489
|
+
[
|
490
|
+
'Our search space builds on standard CNN architectures...',
|
491
|
+
'Formally, we define architecture parameters $\\alpha \\in R^d$ where...',
|
492
|
+
'This parameterization reduces search complexity by 42% compared to...',
|
493
|
+
'The efficiency gains validate our approach to...'
|
494
|
+
]"""
|
495
|
+
|
496
|
+
|
497
|
+
class ArticleSection(ArticleBase):
|
498
|
+
"""Methodological complete unit presenting cohesive research phase."""
|
499
|
+
|
500
|
+
title: str = Field(...)
|
501
|
+
"""Process-oriented header indicating methodological scope.
|
502
|
+
Example: 'Cross-Lingual Transfer Evaluation Protocol'"""
|
503
|
+
|
504
|
+
support_to: List[SectionRef]
|
505
|
+
"""Supported research questions and paper-level claims.
|
506
|
+
Example: [SectionRef(chapter='Introduction', section='1', subsection='1.2')]"""
|
507
|
+
|
508
|
+
depend_on: List[SectionRef]
|
509
|
+
"""Required methodological components and theoretical frameworks.
|
510
|
+
Example: [SectionRef(chapter='Background', section='2', subsection='2.4')]"""
|
511
|
+
|
512
|
+
subsections: List[ArticleSubsection] = Field(..., min_length=3, max_length=5)
|
513
|
+
"""Thematic progression implementing section's research function:
|
514
|
+
1. Conceptual Framework
|
515
|
+
2. Technical Implementation
|
516
|
+
3. Experimental Validation
|
517
|
+
4. Comparative Analysis
|
518
|
+
5. Synthesis
|
519
|
+
|
520
|
+
Example Subsection Flow:
|
521
|
+
[
|
522
|
+
'Evaluation Metrics',
|
523
|
+
'Dataset Preparation',
|
524
|
+
'Baseline Comparisons',
|
525
|
+
'Ablation Studies',
|
526
|
+
'Interpretation Framework'
|
527
|
+
]"""
|
528
|
+
|
529
|
+
|
530
|
+
class ArticleChapter(ArticleBase):
|
531
|
+
"""Macro-structural unit implementing IMRaD document architecture."""
|
532
|
+
|
533
|
+
title: str = Field(...)
|
534
|
+
"""Standard IMRaD chapter title with domain specification.
|
535
|
+
Example: 'Neural Architecture Search for Low-Resource Languages'"""
|
536
|
+
|
537
|
+
support_to: List[SectionRef]
|
538
|
+
"""Supported thesis statements and paper-level contributions.
|
539
|
+
Example: [SectionRef(chapter='Abstract', section='', subsection='')]"""
|
540
|
+
|
541
|
+
depend_on: List[SectionRef]
|
542
|
+
"""Foundational chapters and external knowledge prerequisites.
|
543
|
+
Example: [SectionRef(chapter='Related Work', section='2', subsection='2.3')]"""
|
544
|
+
|
545
|
+
sections: List[ArticleSection] = Field(..., min_length=3, max_length=5)
|
546
|
+
"""Complete research narrative implementing chapter objectives:
|
547
|
+
1. Context Establishment
|
548
|
+
2. Methodology Exposition
|
549
|
+
3. Results Presentation
|
550
|
+
4. Critical Analysis
|
551
|
+
5. Synthesis
|
552
|
+
|
553
|
+
Example Section Hierarchy:
|
554
|
+
[
|
555
|
+
'Theoretical Framework',
|
556
|
+
'Experimental Design',
|
557
|
+
'Results Analysis',
|
558
|
+
'Threats to Validity',
|
559
|
+
'Comparative Discussion'
|
560
|
+
]"""
|
561
|
+
|
562
|
+
|
563
|
+
class Article(ProposedAble, Display):
|
564
|
+
"""Complete academic paper specification with validation constraints."""
|
565
|
+
|
566
|
+
title: str = Field(...)
|
567
|
+
"""Full technical descriptor following ACL 2024 guidelines:
|
568
|
+
Structure: [Method] for [Task] in [Domain]: [Subtitle with Technical Focus]
|
569
|
+
Example: 'Efficient Differentiable NAS for Low-Resource MT:
|
570
|
+
A Parameter-Sharing Approach to Cross-Lingual Transfer'"""
|
571
|
+
|
572
|
+
abstract: str = Field(...)
|
573
|
+
"""Structured summary with controlled natural language:
|
574
|
+
1. Context: 2 clauses (problem + gap)
|
575
|
+
2. Methods: 3 clauses (approach + innovation + implementation)
|
576
|
+
3. Results: 3 clauses (metrics + comparisons + significance)
|
577
|
+
4. Impact: 2 clauses (theoretical + practical)
|
578
|
+
|
579
|
+
Example: 'Neural architecture search (NAS) faces prohibitive... [150 words]'"""
|
580
|
+
|
581
|
+
chapters: List[ArticleChapter] = Field(..., min_length=5, max_length=8)
|
582
|
+
"""IMRaD-compliant document structure with enhanced validation:
|
583
|
+
1. Introduction: Motivation & Contributions
|
584
|
+
2. Background: Literature & Theory
|
585
|
+
3. Methods: Technical Implementation
|
586
|
+
4. Experiments: Protocols & Setup
|
587
|
+
5. Results: Empirical Findings
|
588
|
+
6. Discussion: Interpretation & Limitations
|
589
|
+
7. Conclusion: Summary & Future Work
|
590
|
+
|
591
|
+
Additional: Appendices, Ethics Review, Reproducibility Statements"""
|
592
|
+
|
593
|
+
def init_from_outline(self, outline: ArticleOutline) -> Self:
|
594
|
+
"""Initialize the article from a given outline.
|
595
|
+
|
596
|
+
Args:
|
597
|
+
outline (ArticleOutline): The outline to initialize from.
|
598
|
+
|
599
|
+
Returns:
|
600
|
+
Self: The current instance of the article.
|
601
|
+
"""
|
602
|
+
# Set the title from the outline
|
603
|
+
self.title = outline.title
|
604
|
+
|
605
|
+
# Initialize chapters based on outline's chapters
|
606
|
+
self.chapters = []
|
607
|
+
|
608
|
+
for chapter_outline in outline.chapters:
|
609
|
+
# Create a new chapter
|
610
|
+
chapter = ArticleChapter(
|
611
|
+
title=chapter_outline.title,
|
612
|
+
description=chapter_outline.description,
|
613
|
+
writing_aim=["Implement " + chapter_outline.description],
|
614
|
+
support_to=[],
|
615
|
+
depend_on=[],
|
616
|
+
sections=[],
|
617
|
+
)
|
618
|
+
|
619
|
+
# Create sections for each chapter
|
620
|
+
for section_outline in chapter_outline.sections:
|
621
|
+
section = ArticleSection(
|
622
|
+
title=section_outline.title,
|
623
|
+
description=section_outline.description,
|
624
|
+
writing_aim=["Address " + section_outline.description],
|
625
|
+
support_to=[],
|
626
|
+
depend_on=[],
|
627
|
+
subsections=[],
|
628
|
+
)
|
629
|
+
|
630
|
+
# Create subsections for each section
|
631
|
+
for subsection_outline in section_outline.subsections:
|
632
|
+
subsection = ArticleSubsection(
|
633
|
+
title=subsection_outline.title,
|
634
|
+
description=subsection_outline.description,
|
635
|
+
writing_aim=["Explain " + subsection_outline.description],
|
636
|
+
support_to=[],
|
637
|
+
depend_on=[],
|
638
|
+
paragraphs=[
|
639
|
+
Paragraph(
|
640
|
+
description=f"Implementation of {subsection_outline.title}",
|
641
|
+
writing_aim=["Present key concepts", "Support main arguments"],
|
642
|
+
lines=[],
|
643
|
+
)
|
644
|
+
],
|
645
|
+
)
|
646
|
+
section.subsections.append(subsection)
|
647
|
+
|
648
|
+
chapter.sections.append(section)
|
649
|
+
|
650
|
+
self.chapters.append(chapter)
|
651
|
+
|
652
|
+
# Generate a placeholder abstract from the outline's prospect
|
653
|
+
self.abstract = f"Abstract: {outline.prospect}"
|
654
|
+
|
655
|
+
return self
|
656
|
+
|
657
|
+
|
658
|
+
# </editor-fold>
|
@@ -1,19 +1,29 @@
|
|
1
1
|
"""This module contains the types for the keyword arguments of the methods in the models module."""
|
2
2
|
|
3
|
+
from importlib.util import find_spec
|
3
4
|
from typing import Any, Required, TypedDict
|
4
5
|
|
5
6
|
from litellm.caching.caching import CacheMode
|
6
7
|
from litellm.types.caching import CachingSupportedCallTypes
|
7
8
|
|
9
|
+
if find_spec("pymilvus"):
|
10
|
+
from pymilvus import CollectionSchema
|
11
|
+
from pymilvus.milvus_client import IndexParams
|
8
12
|
|
9
|
-
class
|
10
|
-
|
13
|
+
class CollectionConfigKwargs(TypedDict, total=False):
|
14
|
+
"""Configuration parameters for a vector collection.
|
11
15
|
|
12
|
-
|
13
|
-
|
16
|
+
These arguments are typically used when configuring connections to vector databases.
|
17
|
+
"""
|
14
18
|
|
15
|
-
|
16
|
-
|
19
|
+
dimension: int | None
|
20
|
+
primary_field_name: str
|
21
|
+
id_type: str
|
22
|
+
vector_field_name: str
|
23
|
+
metric_type: str
|
24
|
+
timeout: float | None
|
25
|
+
schema: CollectionSchema | None
|
26
|
+
index_params: IndexParams | None
|
17
27
|
|
18
28
|
|
19
29
|
class FetchKwargs(TypedDict, total=False):
|
Binary file
|
@@ -1,12 +1,12 @@
|
|
1
|
-
fabricatio-0.2.6.
|
2
|
-
fabricatio-0.2.6.
|
3
|
-
fabricatio-0.2.6.
|
1
|
+
fabricatio-0.2.6.dev7.dist-info/METADATA,sha256=KJKAdxeQyQdtZjg8fyqf5BCnAZA4EJkAAMaNsDgXYCQ,14085
|
2
|
+
fabricatio-0.2.6.dev7.dist-info/WHEEL,sha256=mDFV3bKFgwlxLHvOsPqpR9up9dUKYzsUQNKBdkW5c08,94
|
3
|
+
fabricatio-0.2.6.dev7.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
|
4
4
|
fabricatio/actions/article.py,sha256=LfIWnbFYB9e3Bq2YDPk1geWDbJTq7zCitLtpFhAhYHM,4563
|
5
5
|
fabricatio/actions/output.py,sha256=KSSLvEvXsA10ACN2mbqGo98QwKLVUAoMUJNKYk6HhGc,645
|
6
6
|
fabricatio/actions/rag.py,sha256=GpT7YlqOYznZyaT-6Y84_33HtZGT-5s71ZK8iroQA9g,813
|
7
7
|
fabricatio/capabilities/correct.py,sha256=0BYhjo9WrLwKsXQR8bTPvdQITbrMs7RX1xpzhuQt_yY,5222
|
8
8
|
fabricatio/capabilities/propose.py,sha256=y3kge5g6bb8HYuV8e9h4MdqOMTlsfAIZpqE_cagWPTY,1593
|
9
|
-
fabricatio/capabilities/rag.py,sha256=
|
9
|
+
fabricatio/capabilities/rag.py,sha256=R1yUD675CDEmGakXb2nzEzZe0vjN7edMS7VHtPOAriU,15771
|
10
10
|
fabricatio/capabilities/rating.py,sha256=R9otyZVE2E3kKxrOCTZMeesBCPbC-fSb7bXgZPMQzfU,14406
|
11
11
|
fabricatio/capabilities/review.py,sha256=XYzpSnFCT9HS2XytQT8HDgV4SjXehexoJgucZFMx6P8,11102
|
12
12
|
fabricatio/capabilities/task.py,sha256=MBiDyC3oHwTbTiLiGyqUEVfVGSN42lU03ndeapTpyjQ,4609
|
@@ -19,9 +19,9 @@ fabricatio/fs/__init__.py,sha256=PCf0s_9KDjVfNw7AfPoJzGt3jMq4gJOfbcT4pb0D0ZY,588
|
|
19
19
|
fabricatio/journal.py,sha256=stnEP88aUBA_GmU9gfTF2EZI8FS2OyMLGaMSTgK4QgA,476
|
20
20
|
fabricatio/models/action.py,sha256=dSmwIrW68JhCrkhWENRgTLIQ-0grVA4408QAUy23HZo,8210
|
21
21
|
fabricatio/models/events.py,sha256=QvlnS8FEELg6KNabcJMeh2GV_y0ZBzKOPphcteKYWYU,4183
|
22
|
-
fabricatio/models/extra.py,sha256=
|
22
|
+
fabricatio/models/extra.py,sha256=oPCrh80u-O5XoFMVvZ6D6SVpSSW0zkxw4zfaTeK_wLU,26263
|
23
23
|
fabricatio/models/generic.py,sha256=IdPJMf3qxZFq8yqd6OuAYKfCM0wBlJkozgxvxQZVEEc,14025
|
24
|
-
fabricatio/models/kwargs_types.py,sha256=
|
24
|
+
fabricatio/models/kwargs_types.py,sha256=H6DI3Jdben-FER_kx7owiRzmbSFKuu0sFjCADA1LJB0,5008
|
25
25
|
fabricatio/models/role.py,sha256=mmQbJ6GKr2Gx3wtjEz8d-vYoXs09ffcEkT_eCXaDd3E,2782
|
26
26
|
fabricatio/models/task.py,sha256=8NaR7ojQWyM740EDTqt9stwHKdrD6axCRpLKo0QzS-I,10492
|
27
27
|
fabricatio/models/tool.py,sha256=4b-v4WIC_LuLOKzzXL9bvKXr8vmGZ8O2uAFv5-1KRA0,7052
|
@@ -37,6 +37,6 @@ fabricatio/workflows/rag.py,sha256=-YYp2tlE9Vtfgpg6ROpu6QVO8j8yVSPa6yDzlN3qVxs,5
|
|
37
37
|
fabricatio/_rust.pyi,sha256=eawBfpyGrB-JtOh4I6RSbjFSq83SSl-0syBeZ-g8270,3491
|
38
38
|
fabricatio/_rust_instances.py,sha256=2GwF8aVfYNemRI2feBzH1CZfBGno-XJJE5imJokGEYw,314
|
39
39
|
fabricatio/__init__.py,sha256=SzBYsRhZeL77jLtfJEjmoHOSwHwUGyvMATX6xfndLDM,1135
|
40
|
-
fabricatio/_rust.cp39-win_amd64.pyd,sha256=
|
41
|
-
fabricatio-0.2.6.
|
42
|
-
fabricatio-0.2.6.
|
40
|
+
fabricatio/_rust.cp39-win_amd64.pyd,sha256=GvYOGn9Xya6YMX-nhmqv-w908ndgc2HSinAYMkhypKo,1826304
|
41
|
+
fabricatio-0.2.6.dev7.data/scripts/tdown.exe,sha256=5mZx7mp19U-nnWHwoZTyRmJun2iR77nar1wab1j_Jj8,3397632
|
42
|
+
fabricatio-0.2.6.dev7.dist-info/RECORD,,
|
File without changes
|
File without changes
|