fabricatio 0.2.12.dev2__cp312-cp312-win_amd64.whl → 0.2.13.dev0__cp312-cp312-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.
@@ -20,6 +20,7 @@ from fabricatio.models.extra.article_main import Article, ArticleChapter, Articl
20
20
  from fabricatio.models.extra.article_outline import ArticleOutline
21
21
  from fabricatio.models.extra.rule import RuleSet
22
22
  from fabricatio.models.kwargs_types import ChooseKwargs, LLMKwargs
23
+ from fabricatio.rust import convert_to_block_formula, convert_to_inline_formula
23
24
  from fabricatio.utils import ask_retain, ok
24
25
 
25
26
  TYPST_CITE_USAGE = (
@@ -162,6 +163,7 @@ class WriteArticleContentRAG(Action, RAG, Extract):
162
163
  )
163
164
  for p in new_subsec.paragraphs:
164
165
  p.content = cm.apply(p.content)
166
+ p.description = cm.apply(p.description)
165
167
  subsec.update_from(new_subsec)
166
168
  logger.debug(f"{subsec.title}:rpl\n{subsec.display()}")
167
169
  return subsec
@@ -286,6 +288,10 @@ class ArticleConsultRAG(Action, AdvancedRAG):
286
288
  while (req := await text("User: ").ask_async()) is not None:
287
289
  if await confirm("Empty the cm?").ask_async():
288
290
  cm.empty()
291
+
292
+ req = convert_to_block_formula(req)
293
+ req = convert_to_inline_formula(req)
294
+
289
295
  await self.clued_search(
290
296
  req,
291
297
  cm,
@@ -11,11 +11,12 @@ from fabricatio.models.kwargs_types import ChooseKwargs
11
11
 
12
12
  class AdvancedRAG(RAG):
13
13
  """A class representing the Advanced RAG (Retrieval Augmented Generation) model."""
14
+
14
15
  async def clued_search(
15
16
  self,
16
17
  requirement: str,
17
18
  cm: CitationManager,
18
- max_capacity=40,
19
+ max_capacity: int = 40,
19
20
  max_round: int = 3,
20
21
  expand_multiplier: float = 1.4,
21
22
  base_accepted: int = 12,
@@ -23,28 +24,30 @@ class AdvancedRAG(RAG):
23
24
  **kwargs: Unpack[FetchKwargs],
24
25
  ) -> CitationManager:
25
26
  """Asynchronously performs a clued search based on a given requirement and citation manager."""
26
- if max_round < 2:
27
+ if max_round <= 0:
28
+ raise ValueError("max_round should be greater than 0")
29
+ if max_round == 1:
27
30
  logger.warning(
28
31
  "max_round should be greater than 1, otherwise it behaves nothing different from the `self.aretrieve`"
29
32
  )
30
33
 
31
34
  refinery_kwargs = refinery_kwargs or {}
32
35
 
33
- for i in range(max_round + 1, 1):
34
- logger.info(f"Round [{i + 1}/{max_round}] search started.")
36
+ for i in range(1, max_round + 1):
37
+ logger.info(f"Round [{i}/{max_round}] search started.")
35
38
  ref_q = await self.arefined_query(
36
39
  f"{cm.as_prompt()}\n\nAbove is the retrieved references in the {i - 1}th RAG, now we need to perform the {i}th RAG."
37
40
  f"\n\n{requirement}",
38
41
  **refinery_kwargs,
39
42
  )
40
43
  if ref_q is None:
41
- logger.error(f"At round [{i + 1}/{max_round}] search, failed to refine the query, exit.")
44
+ logger.error(f"At round [{i}/{max_round}] search, failed to refine the query, exit.")
42
45
  return cm
43
46
  refs = await self.aretrieve(ref_q, ArticleChunk, base_accepted, **kwargs)
44
47
 
45
48
  if (max_capacity := max_capacity - len(refs)) < 0:
46
49
  cm.add_chunks(refs[0:max_capacity])
47
- logger.debug(f"At round [{i + 1}/{max_round}] search, the capacity is not enough, exit.")
50
+ logger.debug(f"At round [{i}/{max_round}] search, the capacity is not enough, exit.")
48
51
  return cm
49
52
 
50
53
  cm.add_chunks(refs)
@@ -1,6 +1,6 @@
1
1
  """A foundation for hierarchical document components with dependency tracking."""
2
2
 
3
- from abc import ABC, abstractmethod
3
+ from abc import ABC
4
4
  from enum import StrEnum
5
5
  from typing import Generator, List, Optional, Self, Tuple
6
6
 
@@ -18,7 +18,8 @@ from fabricatio.models.generic import (
18
18
  Titled,
19
19
  WordCount,
20
20
  )
21
- from fabricatio.rust import comment
21
+ from fabricatio.rust import split_out_metadata, to_metadata, word_count
22
+ from fabricatio.utils import fallback_kwargs
22
23
  from pydantic import Field
23
24
 
24
25
 
@@ -49,21 +50,46 @@ class ArticleMetaData(SketchedAble, Described, WordCount, Titled, Language):
49
50
  @property
50
51
  def typst_metadata_comment(self) -> str:
51
52
  """Generates a comment for the metadata of the article component."""
52
- return comment(
53
- (f"Desc:\n {self.description}\n" if self.description else "")
54
- + (f"Aims:\n {'\n '.join(self.aims)}\n" if self.aims else "")
55
- + (f"Expected Word Count:{self.expected_word_count}" if self.expected_word_count else "")
56
-
53
+ return to_metadata(self.model_dump(include={"description", "aims", "expected_word_count"}, by_alias=True))
54
+
55
+
56
+ class FromTypstCode(ArticleMetaData):
57
+ """Base class for article components that can be created from a Typst code snippet."""
58
+
59
+ @classmethod
60
+ def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
61
+ """Converts a Typst code snippet into an article component."""
62
+ data, body = split_out_metadata(body)
63
+
64
+ return cls(
65
+ heading=title,
66
+ **fallback_kwargs(
67
+ data or {},
68
+ elaboration="",
69
+ expected_word_count=word_count(body),
70
+ aims=[],
71
+ ),
72
+ **kwargs,
57
73
  )
58
74
 
59
75
 
76
+ class ToTypstCode(ArticleMetaData):
77
+ """Base class for article components that can be converted to a Typst code snippet."""
78
+
79
+ def to_typst_code(self) -> str:
80
+ """Converts the component into a Typst code snippet for rendering."""
81
+ return f"{self.title}\n{self.typst_metadata_comment}\n"
82
+
83
+
60
84
  class ArticleOutlineBase(
61
- ArticleMetaData,
62
85
  ResolveUpdateConflict,
63
86
  ProposedUpdateAble,
64
87
  PersistentAble,
65
88
  ModelHash,
66
89
  Introspect,
90
+ FromTypstCode,
91
+ ToTypstCode,
92
+ ABC,
67
93
  ):
68
94
  """Base class for article outlines."""
69
95
 
@@ -89,17 +115,13 @@ class ArticleOutlineBase(
89
115
  """Updates the current instance with the attributes of another instance."""
90
116
  return self.update_metadata(other)
91
117
 
92
- @abstractmethod
93
- def to_typst_code(self) -> str:
94
- """Converts the component into a Typst code snippet for rendering."""
95
-
96
118
 
97
119
  class SubSectionBase(ArticleOutlineBase):
98
120
  """Base class for article sections and subsections."""
99
121
 
100
122
  def to_typst_code(self) -> str:
101
123
  """Converts the component into a Typst code snippet for rendering."""
102
- return f"=== {self.title}\n{self.typst_metadata_comment}\n"
124
+ return f"=== {super().to_typst_code()}"
103
125
 
104
126
  def introspect(self) -> str:
105
127
  """Introspects the article subsection outline."""
@@ -124,9 +146,7 @@ class SectionBase[T: SubSectionBase](ArticleOutlineBase):
124
146
  Returns:
125
147
  str: The formatted Typst code snippet.
126
148
  """
127
- return f"== {self.title}\n{self.typst_metadata_comment}\n" + "\n\n".join(
128
- subsec.to_typst_code() for subsec in self.subsections
129
- )
149
+ return f"== {super().to_typst_code()}" + "\n\n".join(subsec.to_typst_code() for subsec in self.subsections)
130
150
 
131
151
  def resolve_update_conflict(self, other: Self) -> str:
132
152
  """Resolve update errors in the article outline."""
@@ -169,9 +189,7 @@ class ChapterBase[T: SectionBase](ArticleOutlineBase):
169
189
 
170
190
  def to_typst_code(self) -> str:
171
191
  """Converts the chapter into a Typst formatted code snippet for rendering."""
172
- return f"= {self.title}\n{self.typst_metadata_comment}\n" + "\n\n".join(
173
- sec.to_typst_code() for sec in self.sections
174
- )
192
+ return f"= {super().to_typst_code()}" + "\n\n".join(sec.to_typst_code() for sec in self.sections)
175
193
 
176
194
  def resolve_update_conflict(self, other: Self) -> str:
177
195
  """Resolve update errors in the article outline."""
@@ -203,12 +221,13 @@ class ChapterBase[T: SectionBase](ArticleOutlineBase):
203
221
  return ""
204
222
 
205
223
 
206
- class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, WordCount, Described, Titled, Language, ABC):
224
+ class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, FromTypstCode, ToTypstCode, ABC):
207
225
  """Base class for article outlines."""
208
226
 
209
- title: str = Field(alias="heading", description=Titled.model_fields["title"].description)
210
- description: str = Field(alias="abstract")
211
- """The abstract serves as a concise summary of an academic article, encapsulating its core purpose, methodologies, key results,
227
+ description: str = Field(
228
+ alias="elaboration",
229
+ )
230
+ """The abstract of this article, which serves as a concise summary of an academic article, encapsulating its core purpose, methodologies, key results,
212
231
  and conclusions while enabling readers to rapidly assess the relevance and significance of the study.
213
232
  Functioning as the article's distilled essence, it succinctly articulates the research problem, objectives,
214
233
  and scope, providing a roadmap for the full text while also facilitating database indexing, literature reviews,
@@ -293,6 +312,10 @@ class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, WordCount, Descri
293
312
  for _, _, subsec in self.iter_subsections():
294
313
  yield subsec.title
295
314
 
315
+ def to_typst_code(self) -> str:
316
+ """Generates the Typst code representation of the article."""
317
+ return f"// #{super().to_typst_code()}\n\n" + "\n\n".join(a.to_typst_code() for a in self.chapters)
318
+
296
319
  def finalized_dump(self) -> str:
297
320
  """Generates standardized hierarchical markup for academic publishing systems.
298
321
 
@@ -313,26 +336,16 @@ class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, WordCount, Descri
313
336
  === Implementation Details
314
337
  == Evaluation Protocol
315
338
  """
316
- return (
317
- comment(
318
- f"Title:{self.title}\n"
319
- + (f"Desc:\n{self.description}\n" if self.description else "")
320
- + f"Word Count:{self.expected_word_count}"
321
- if self.expected_word_count
322
- else ""
323
- )
324
- + "\n\n"
325
- + "\n\n".join(a.to_typst_code() for a in self.chapters)
326
- )
339
+ return self.to_typst_code()
327
340
 
328
- def avg_chap_wordcount[S](self: S) -> S:
341
+ def avg_chap_wordcount[S: "ArticleBase"](self: S) -> S:
329
342
  """Set all chap have same word count sum up to be `self.expected_word_count`."""
330
343
  avg = int(self.expected_word_count / len(self.chapters))
331
344
  for c in self.chapters:
332
345
  c.expected_word_count = avg
333
346
  return self
334
347
 
335
- def avg_sec_wordcount[S](self: S) -> S:
348
+ def avg_sec_wordcount[S: "ArticleBase"](self: S) -> S:
336
349
  """Set all sec have same word count sum up to be `self.expected_word_count`."""
337
350
  for c in self.chapters:
338
351
  avg = int(c.expected_word_count / len(c.sections))
@@ -340,7 +353,7 @@ class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, WordCount, Descri
340
353
  s.expected_word_count = avg
341
354
  return self
342
355
 
343
- def avg_subsec_wordcount[S](self: S) -> S:
356
+ def avg_subsec_wordcount[S: "ArticleBase"](self: S) -> S:
344
357
  """Set all subsec have same word count sum up to be `self.expected_word_count`."""
345
358
  for _, s in self.iter_sections():
346
359
  avg = int(s.expected_word_count / len(s.subsections))
@@ -348,6 +361,6 @@ class ArticleBase[T: ChapterBase](FinalizedDumpAble, AsPrompt, WordCount, Descri
348
361
  ss.expected_word_count = avg
349
362
  return self
350
363
 
351
- def avg_wordcount_recursive[S](self:S) -> S:
364
+ def avg_wordcount_recursive[S: "ArticleBase"](self: S) -> S:
352
365
  """Set all chap, sec, subsec have same word count sum up to be `self.expected_word_count`."""
353
366
  return self.avg_chap_wordcount().avg_sec_wordcount().avg_subsec_wordcount()
@@ -18,11 +18,16 @@ from fabricatio.models.extra.article_outline import (
18
18
  ArticleSubsectionOutline,
19
19
  )
20
20
  from fabricatio.models.generic import Described, PersistentAble, SequencePatch, SketchedAble, WithRef, WordCount
21
- from fabricatio.rust import convert_all_block_tex, convert_all_inline_tex, fix_misplaced_labels, word_count
22
- from fabricatio.utils import fallback_kwargs
21
+ from fabricatio.rust import (
22
+ convert_all_block_tex,
23
+ convert_all_inline_tex,
24
+ fix_misplaced_labels,
25
+ split_out_metadata,
26
+ word_count,
27
+ )
23
28
  from pydantic import Field, NonNegativeInt
24
29
 
25
- PARAGRAPH_SEP = "// - - -"
30
+ PARAGRAPH_SEP = "\n\n// - - -\n\n"
26
31
 
27
32
 
28
33
  class Paragraph(SketchedAble, WordCount, Described):
@@ -93,17 +98,17 @@ class ArticleSubsection(SubSectionBase):
93
98
  Returns:
94
99
  str: Typst code snippet for rendering.
95
100
  """
96
- return super().to_typst_code() + f"\n\n{PARAGRAPH_SEP}\n\n".join(p.content for p in self.paragraphs)
101
+ return super().to_typst_code() + PARAGRAPH_SEP.join(p.content for p in self.paragraphs)
97
102
 
98
103
  @classmethod
99
- def from_typst_code(cls, title: str, body: str) -> Self:
104
+ def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
100
105
  """Creates an Article object from the given Typst code."""
101
- return cls(
102
- heading=title,
103
- elaboration="",
104
- paragraphs=[Paragraph.from_content(p) for p in body.split(PARAGRAPH_SEP)],
105
- expected_word_count=word_count(body),
106
- aims=[],
106
+ _, para_body = split_out_metadata(body)
107
+
108
+ return super().from_typst_code(
109
+ title,
110
+ body,
111
+ paragraphs=[Paragraph.from_content(p) for p in para_body.split(PARAGRAPH_SEP)],
107
112
  )
108
113
 
109
114
 
@@ -111,16 +116,14 @@ class ArticleSection(SectionBase[ArticleSubsection]):
111
116
  """Atomic argumentative unit with high-level specificity."""
112
117
 
113
118
  @classmethod
114
- def from_typst_code(cls, title: str, body: str) -> Self:
119
+ def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
115
120
  """Creates an Article object from the given Typst code."""
116
- return cls(
121
+ return super().from_typst_code(
122
+ title,
123
+ body,
117
124
  subsections=[
118
125
  ArticleSubsection.from_typst_code(*pack) for pack in extract_sections(body, level=3, section_char="=")
119
126
  ],
120
- heading=title,
121
- elaboration="",
122
- expected_word_count=word_count(body),
123
- aims=[],
124
127
  )
125
128
 
126
129
 
@@ -128,21 +131,18 @@ class ArticleChapter(ChapterBase[ArticleSection]):
128
131
  """Thematic progression implementing research function."""
129
132
 
130
133
  @classmethod
131
- def from_typst_code(cls, title: str, body: str) -> Self:
134
+ def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
132
135
  """Creates an Article object from the given Typst code."""
133
- return cls(
136
+ return super().from_typst_code(
137
+ title,
138
+ body,
134
139
  sections=[
135
140
  ArticleSection.from_typst_code(*pack) for pack in extract_sections(body, level=2, section_char="=")
136
141
  ],
137
- heading=title,
138
- elaboration="",
139
- expected_word_count=word_count(body),
140
- aims=[],
141
142
  )
142
143
 
143
144
 
144
145
  class Article(
145
- SketchedAble,
146
146
  WithRef[ArticleOutline],
147
147
  PersistentAble,
148
148
  ArticleBase[ArticleChapter],
@@ -161,25 +161,20 @@ class Article(
161
161
  "Original Article": self.display(),
162
162
  }
163
163
 
164
- def convert_tex(self) -> Self:
164
+ def convert_tex(self, paragraphs: bool = True, descriptions: bool = True) -> Self:
165
165
  """Convert tex to typst code."""
166
- for _, _, subsec in self.iter_subsections():
167
- for p in subsec.paragraphs:
168
- p.content = fix_misplaced_labels(p.content)
169
- p.content = convert_all_inline_tex(p.content)
170
- p.content = convert_all_block_tex(p.content)
171
- return self
172
-
173
- def fix_wrapper(self) -> Self:
174
- """Fix wrapper."""
175
- for _, _, subsec in self.iter_subsections():
176
- for p in subsec.paragraphs:
177
- p.content = (
178
- p.content.replace(r" \( ", "$")
179
- .replace(r" \) ", "$")
180
- .replace("\\[\n", "$$\n")
181
- .replace("\n\\]", "\n$$")
182
- )
166
+ if descriptions:
167
+ for a in self.iter_dfs():
168
+ a.description = fix_misplaced_labels(a.description)
169
+ a.description = convert_all_inline_tex(a.description)
170
+ a.description = convert_all_block_tex(a.description)
171
+
172
+ if paragraphs:
173
+ for _, _, subsec in self.iter_subsections():
174
+ for p in subsec.paragraphs:
175
+ p.content = fix_misplaced_labels(p.content)
176
+ p.content = convert_all_inline_tex(p.content)
177
+ p.content = convert_all_block_tex(p.content)
183
178
  return self
184
179
 
185
180
  @override
@@ -269,16 +264,12 @@ class Article(
269
264
  @classmethod
270
265
  def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
271
266
  """Generates an article from the given Typst code."""
272
- return cls(
267
+ return super().from_typst_code(
268
+ title,
269
+ body,
273
270
  chapters=[
274
271
  ArticleChapter.from_typst_code(*pack) for pack in extract_sections(body, level=1, section_char="=")
275
272
  ],
276
- heading=title,
277
- **fallback_kwargs(
278
- kwargs,
279
- expected_word_count=word_count(body),
280
- abstract="",
281
- ),
282
273
  )
283
274
 
284
275
  @classmethod
@@ -1,7 +1,8 @@
1
1
  """A module containing the ArticleOutline class, which represents the outline of an academic paper."""
2
2
 
3
- from typing import Dict
3
+ from typing import Dict, Self
4
4
 
5
+ from fabricatio.fs.readers import extract_sections
5
6
  from fabricatio.models.extra.article_base import (
6
7
  ArticleBase,
7
8
  ChapterBase,
@@ -9,7 +10,7 @@ from fabricatio.models.extra.article_base import (
9
10
  SubSectionBase,
10
11
  )
11
12
  from fabricatio.models.extra.article_proposal import ArticleProposal
12
- from fabricatio.models.generic import PersistentAble, SketchedAble, WithRef
13
+ from fabricatio.models.generic import PersistentAble, WithRef
13
14
 
14
15
 
15
16
  class ArticleSubsectionOutline(SubSectionBase):
@@ -18,14 +19,39 @@ class ArticleSubsectionOutline(SubSectionBase):
18
19
 
19
20
  class ArticleSectionOutline(SectionBase[ArticleSubsectionOutline]):
20
21
  """A slightly more detailed research component specification for academic paper generation, Must contain subsections."""
22
+ @classmethod
23
+ def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
24
+ """Parse the given Typst code into an ArticleSectionOutline instance."""
25
+ return super().from_typst_code(
26
+ title,
27
+ body,
28
+ subsections=[
29
+ ArticleSubsectionOutline.from_typst_code(*pack)
30
+ for pack in extract_sections(body, level=3, section_char="=")
31
+ ],
32
+ )
33
+
21
34
 
22
35
 
23
36
  class ArticleChapterOutline(ChapterBase[ArticleSectionOutline]):
24
37
  """Macro-structural unit implementing standard academic paper organization. Must contain sections."""
25
38
 
39
+ @classmethod
40
+ def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
41
+ """Parse the given Typst code into an ArticleChapterOutline instance."""
42
+ return super().from_typst_code(
43
+ title,
44
+ body,
45
+ sections=[
46
+ ArticleSectionOutline.from_typst_code(*pack)
47
+ for pack in extract_sections(body, level=2, section_char="=")
48
+ ],
49
+
50
+ )
51
+
52
+
26
53
 
27
54
  class ArticleOutline(
28
- SketchedAble,
29
55
  WithRef[ArticleProposal],
30
56
  PersistentAble,
31
57
  ArticleBase[ArticleChapterOutline],
@@ -38,3 +64,15 @@ class ArticleOutline(
38
64
  "Original Article Proposal": self.referenced.display(),
39
65
  "Original Article Outline": self.display(),
40
66
  }
67
+
68
+ @classmethod
69
+ def from_typst_code(cls, title: str, body: str, **kwargs) -> Self:
70
+ """Parse the given Typst code into an ArticleOutline instance."""
71
+ return super().from_typst_code(
72
+ title,
73
+ body,
74
+ chapters=[
75
+ ArticleChapterOutline.from_typst_code(*pack)
76
+ for pack in extract_sections(body, level=1, section_char="=")
77
+ ],
78
+ )
Binary file
fabricatio/rust.pyi CHANGED
@@ -12,7 +12,9 @@ Key Features:
12
12
  """
13
13
 
14
14
  from pathlib import Path
15
- from typing import Any, Dict, List, Optional, overload
15
+ from typing import Any, Dict, List, Optional, Tuple, overload
16
+
17
+ from pydantic import JsonValue
16
18
 
17
19
  class TemplateManager:
18
20
  """Template rendering engine using Handlebars templates.
@@ -325,11 +327,11 @@ def convert_all_block_tex(string: str) -> str:
325
327
  The converted string with block TeX code replaced.
326
328
  """
327
329
 
328
- def fix_misplaced_labels(input: str) -> str:
330
+ def fix_misplaced_labels(string: str) -> str:
329
331
  """A func to fix labels in a string.
330
332
 
331
333
  Args:
332
- input: The input string containing misplaced labels.
334
+ string: The input string containing misplaced labels.
333
335
 
334
336
  Returns:
335
337
  The fixed string with labels properly placed.
@@ -354,3 +356,29 @@ def uncomment(string: str) -> str:
354
356
  Returns:
355
357
  The string with comments (lines starting with '// ' or '//') removed.
356
358
  """
359
+
360
+ def split_out_metadata(string: str) -> Tuple[Optional[JsonValue], str]:
361
+ """Split out metadata from a string.
362
+
363
+ Args:
364
+ string: The input string containing metadata.
365
+
366
+ Returns:
367
+ A tuple containing the metadata as a Python object (if parseable) and the remaining string.
368
+ """
369
+
370
+ def to_metadata(data: JsonValue) -> str:
371
+ """Convert a Python object to a YAML string.
372
+
373
+ Args:
374
+ data: The Python object to be converted to YAML.
375
+
376
+ Returns:
377
+ The YAML string representation of the input data.
378
+ """
379
+
380
+ def convert_to_inline_formula(string: str) -> str:
381
+ r"""Convert `$...$` to inline formula `\(...\)` and trim spaces."""
382
+
383
+ def convert_to_block_formula(string: str) -> str:
384
+ r"""Convert `$$...$$` to block formula `\[...\]` and trim spaces."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fabricatio
3
- Version: 0.2.12.dev2
3
+ Version: 0.2.13.dev0
4
4
  Classifier: License :: OSI Approved :: MIT License
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -1,15 +1,15 @@
1
- fabricatio-0.2.12.dev2.dist-info/METADATA,sha256=jqf6D_gMBaD9ClwWRHwr9-vI0WAFYc_u2XdLjpb4dq0,5263
2
- fabricatio-0.2.12.dev2.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
3
- fabricatio-0.2.12.dev2.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
1
+ fabricatio-0.2.13.dev0.dist-info/METADATA,sha256=VF_2f3NYiTYQ_AT0DvnBy42fBBaDCjV-t1XzZn5ts2E,5263
2
+ fabricatio-0.2.13.dev0.dist-info/WHEEL,sha256=jABKVkLC9kJr8mi_er5jOqpiQUjARSLXDUIIxDqsS50,96
3
+ fabricatio-0.2.13.dev0.dist-info/licenses/LICENSE,sha256=do7J7EiCGbq0QPbMAL_FqLYufXpHnCnXBOuqVPwSV8Y,1088
4
4
  fabricatio/actions/article.py,sha256=SFl1zc0hz9vW2sW4VJm9-w8E7kLEty-2LzXi9wgWMmE,10905
5
- fabricatio/actions/article_rag.py,sha256=dJJfPkfwnx8P4BebESOpPaeTfvER-1U68aPXpwMdDCQ,18723
5
+ fabricatio/actions/article_rag.py,sha256=1VlTFLrtsNfIrfHLEiR0u7eAuZjnIMNtdcj4HbTYMy0,18960
6
6
  fabricatio/actions/fs.py,sha256=gJR14U4ln35nt8Z7OWLVAZpqGaLnED-r1Yi-lX22tkI,959
7
7
  fabricatio/actions/output.py,sha256=lX0HkDse3ypCzZgeF-8Dr-EnNFdBiE-WQ1iLPFlGM1g,8302
8
8
  fabricatio/actions/rag.py,sha256=KN-OWgcQjGmNgSZ-s5B8m4LpYKSGFJR8eq72mo2CP9k,3592
9
9
  fabricatio/actions/rules.py,sha256=dkvCgNDjt2KSO1VgPRsxT4YBmIIMeetZb5tiz-slYkU,3640
10
10
  fabricatio/actions/__init__.py,sha256=wVENCFtpVb1rLFxoOFJt9-8smLWXuJV7IwA8P3EfFz4,48
11
11
  fabricatio/capabilities/advanced_judge.py,sha256=selB0Gwf1F4gGJlwBiRo6gI4KOUROgh3WnzO3mZFEls,706
12
- fabricatio/capabilities/advanced_rag.py,sha256=0VbVqx2WGhQfF9LNkHM6tdeodNxF4S0Gh7_vmH3X0UA,2282
12
+ fabricatio/capabilities/advanced_rag.py,sha256=1LAAaCgVnZllNzLH3yW9MNwguUNPB7NMOJbD83VLdAo,2376
13
13
  fabricatio/capabilities/censor.py,sha256=bBT5qy-kp7fh8g4Lz3labSwxwJ60gGd_vrkc6k1cZ1U,4719
14
14
  fabricatio/capabilities/check.py,sha256=kYqzohhv2bZfl1aKSUt7a8snT8YEl2zgha_ZdAdMMfQ,8622
15
15
  fabricatio/capabilities/correct.py,sha256=W_cInqlciNEhyMK0YI53jk4EvW9uAdge90IO9OElUmA,10420
@@ -33,10 +33,10 @@ fabricatio/models/adv_kwargs_types.py,sha256=kUO-SiZtFuz5cZCmMLnJJ9tjQ4-Zd_foo6R
33
33
  fabricatio/models/events.py,sha256=wiirk_ASg3iXDOZU_gIimci1VZVzWE1nDmxy-hQVJ9M,4150
34
34
  fabricatio/models/extra/advanced_judge.py,sha256=INUl_41C8jkausDekkjnEmTwNfLCJ23TwFjq2cM23Cw,1092
35
35
  fabricatio/models/extra/aricle_rag.py,sha256=p91JI8FmFSrHVg5KbhJq4w8vQdx4VUW75SrtQUi9ju4,10987
36
- fabricatio/models/extra/article_base.py,sha256=eyawpikQEp0-PR32Z0atpRvA77Ht3KjDwL5RD---mf8,14066
36
+ fabricatio/models/extra/article_base.py,sha256=R8EOlQBs7hadjP9cxG_uc24DJDpiVpJW9Wb9DA6XmXE,14516
37
37
  fabricatio/models/extra/article_essence.py,sha256=mlIkkRMR3I1RtqiiOnmIE3Vy623L4eECumkRzryE1pw,2749
38
- fabricatio/models/extra/article_main.py,sha256=19ZXnVRk4oZA7t8wTJzSTCGiDUS8NTuy2uqcKCkqQqg,11907
39
- fabricatio/models/extra/article_outline.py,sha256=w7O0SHgC7exbptWVbR62FMHAueMgBpyWKVYMGGl_oj8,1427
38
+ fabricatio/models/extra/article_main.py,sha256=pwY2bTYlnz8nh8y3nb_8nnYcYCmoed7ejK-ZSD8ocYc,11584
39
+ fabricatio/models/extra/article_outline.py,sha256=C9WNZNSz6gyuw9lDp29qidPvHBTENaeqcHfCoE_Y7F4,2793
40
40
  fabricatio/models/extra/article_proposal.py,sha256=NbyjW-7UiFPtnVD9nte75re4xL2pD4qL29PpNV4Cg_M,1870
41
41
  fabricatio/models/extra/patches.py,sha256=_WNCxtYzzsVfUxI16vu4IqsLahLYRHdbQN9er9tqhC0,997
42
42
  fabricatio/models/extra/problem.py,sha256=8tTU-3giFHOi5j7NJsvH__JJyYcaGrcfsRnkzQNm0Ew,7216
@@ -51,7 +51,7 @@ fabricatio/models/tool.py,sha256=jQ51g4lwTPfsMF1nbreDJtBczbxIHoXcPuLSOqHliq8,125
51
51
  fabricatio/models/usages.py,sha256=0bzITf0vug9ZaN6qnjNfFB7T8BAvpXE0bvx0otFYLLA,33356
52
52
  fabricatio/parser.py,sha256=-RbW2yzfJiu2ARq-lZw4tfgsjY2rIZWtJpoUmaE6gJQ,6637
53
53
  fabricatio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
- fabricatio/rust.pyi,sha256=Tdyid-kS402bxiIdX218nh2ekkGBD66K-6PhMN-xU0k,10734
54
+ fabricatio/rust.pyi,sha256=HbdeWbVK7QL2Z3VHh2aMJ1sGUGZyYoOLzDtn5nQIv18,11591
55
55
  fabricatio/rust_instances.py,sha256=Byeo8KHW_dJiXujJq7YPGDLBX5bHNDYbBc4sY3uubVY,313
56
56
  fabricatio/toolboxes/arithmetic.py,sha256=WLqhY-Pikv11Y_0SGajwZx3WhsLNpHKf9drzAqOf_nY,1369
57
57
  fabricatio/toolboxes/fs.py,sha256=l4L1CVxJmjw9Ld2XUpIlWfV0_Fu_2Og6d3E13I-S4aE,736
@@ -61,6 +61,7 @@ fabricatio/workflows/articles.py,sha256=ObYTFUqLUk_CzdmmnX6S7APfxcGmPFqnFr9pdjU7
61
61
  fabricatio/workflows/rag.py,sha256=-YYp2tlE9Vtfgpg6ROpu6QVO8j8yVSPa6yDzlN3qVxs,520
62
62
  fabricatio/workflows/__init__.py,sha256=5ScFSTA-bvhCesj3U9Mnmi6Law6N1fmh5UKyh58L3u8,51
63
63
  fabricatio/__init__.py,sha256=Rmvq2VgdS2u68vnOi2i5RbeWbAwrJDbk8D8D883PJWE,1022
64
- fabricatio/rust.cp312-win_amd64.pyd,sha256=ym9nuMyb-fdV1XDY4sHtPfzU8o7ee0r5U1LhAnTtLOA,4161536
65
- fabricatio-0.2.12.dev2.data/scripts/tdown.exe,sha256=PUdB1PvJP6qyimU9c8qNzl9PcQtR1eBJxTtnLiY4wuk,3349504
66
- fabricatio-0.2.12.dev2.dist-info/RECORD,,
64
+ fabricatio/rust.cp312-win_amd64.pyd,sha256=DiAJU6I8WeitBZaYiA5q_YL7VlxDGuQ4LcUgyGMuZ9s,4455936
65
+ fabricatio-0.2.13.dev0.data/scripts/tdown.exe,sha256=8UDdHeKT5n45yYe5UsDmBVm-aPveFi-LNUjpx97DNGs,3350528
66
+ fabricatio-0.2.13.dev0.data/scripts/ttm.exe,sha256=epNQ6JY5Rg2M1sR-Vei7OMthswpV1l2oyWr5TyY2aFw,2555392
67
+ fabricatio-0.2.13.dev0.dist-info/RECORD,,