fabricatio 0.2.13.dev2__cp312-cp312-win_amd64.whl → 0.3.13__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.
Files changed (42) hide show
  1. fabricatio/__init__.py +3 -3
  2. fabricatio/actions/article.py +32 -34
  3. fabricatio/actions/article_rag.py +89 -69
  4. fabricatio/actions/output.py +22 -21
  5. fabricatio/actions/rag.py +4 -3
  6. fabricatio/capabilities/check.py +29 -30
  7. fabricatio/capabilities/correct.py +23 -23
  8. fabricatio/capabilities/extract.py +36 -32
  9. fabricatio/capabilities/rag.py +34 -35
  10. fabricatio/capabilities/rating.py +77 -72
  11. fabricatio/capabilities/review.py +12 -11
  12. fabricatio/capabilities/task.py +4 -5
  13. fabricatio/core.py +22 -24
  14. fabricatio/decorators.py +10 -10
  15. fabricatio/fs/__init__.py +1 -2
  16. fabricatio/journal.py +2 -9
  17. fabricatio/models/action.py +2 -1
  18. fabricatio/models/extra/aricle_rag.py +10 -9
  19. fabricatio/models/extra/article_base.py +30 -6
  20. fabricatio/models/extra/article_main.py +11 -10
  21. fabricatio/models/extra/article_outline.py +5 -36
  22. fabricatio/models/generic.py +31 -59
  23. fabricatio/models/role.py +5 -3
  24. fabricatio/models/task.py +9 -9
  25. fabricatio/models/tool.py +5 -4
  26. fabricatio/models/usages.py +170 -161
  27. fabricatio/parser.py +2 -2
  28. fabricatio/rust.cp312-win_amd64.pyd +0 -0
  29. fabricatio/rust.pyi +496 -14
  30. fabricatio-0.3.13.data/scripts/tdown.exe +0 -0
  31. fabricatio-0.3.13.data/scripts/ttm.exe +0 -0
  32. {fabricatio-0.2.13.dev2.dist-info → fabricatio-0.3.13.dist-info}/METADATA +1 -3
  33. fabricatio-0.3.13.dist-info/RECORD +63 -0
  34. fabricatio/config.py +0 -430
  35. fabricatio/constants.py +0 -20
  36. fabricatio/models/events.py +0 -120
  37. fabricatio/rust_instances.py +0 -10
  38. fabricatio-0.2.13.dev2.data/scripts/tdown.exe +0 -0
  39. fabricatio-0.2.13.dev2.data/scripts/ttm.exe +0 -0
  40. fabricatio-0.2.13.dev2.dist-info/RECORD +0 -67
  41. {fabricatio-0.2.13.dev2.dist-info → fabricatio-0.3.13.dist-info}/WHEEL +0 -0
  42. {fabricatio-0.2.13.dev2.dist-info → fabricatio-0.3.13.dist-info}/licenses/LICENSE +0 -0
@@ -3,17 +3,16 @@
3
3
  from asyncio import gather
4
4
  from typing import List, Optional, Unpack
5
5
 
6
- from fabricatio import TEMPLATE_MANAGER
6
+ from fabricatio.rust import CONFIG, TEMPLATE_MANAGER, detect_language
7
+
7
8
  from fabricatio.capabilities.advanced_judge import AdvancedJudge
8
9
  from fabricatio.capabilities.propose import Propose
9
- from fabricatio.config import configs
10
10
  from fabricatio.journal import logger
11
11
  from fabricatio.models.extra.patches import RuleSetMetadata
12
12
  from fabricatio.models.extra.problem import Improvement
13
13
  from fabricatio.models.extra.rule import Rule, RuleSet
14
14
  from fabricatio.models.generic import Display, WithBriefing
15
15
  from fabricatio.models.kwargs_types import ValidateKwargs
16
- from fabricatio.rust import detect_language
17
16
  from fabricatio.utils import override_kwargs
18
17
 
19
18
 
@@ -25,7 +24,7 @@ class Check(AdvancedJudge, Propose):
25
24
  """
26
25
 
27
26
  async def draft_ruleset(
28
- self, ruleset_requirement: str, rule_count: int = 0, **kwargs: Unpack[ValidateKwargs[Rule]]
27
+ self, ruleset_requirement: str, rule_count: int = 0, **kwargs: Unpack[ValidateKwargs[Rule]]
29
28
  ) -> Optional[RuleSet]:
30
29
  """Generate rule set based on requirement description.
31
30
 
@@ -45,7 +44,7 @@ class Check(AdvancedJudge, Propose):
45
44
  rule_reqs = (
46
45
  await self.alist_str(
47
46
  TEMPLATE_MANAGER.render_template(
48
- configs.templates.ruleset_requirement_breakdown_template,
47
+ CONFIG.templates.ruleset_requirement_breakdown_template,
49
48
  {"ruleset_requirement": ruleset_requirement},
50
49
  ),
51
50
  rule_count,
@@ -61,7 +60,7 @@ class Check(AdvancedJudge, Propose):
61
60
  rules = await self.propose(
62
61
  Rule,
63
62
  [
64
- TEMPLATE_MANAGER.render_template(configs.templates.rule_requirement_template, {"rule_requirement": r})
63
+ TEMPLATE_MANAGER.render_template(CONFIG.templates.rule_requirement_template, {"rule_requirement": r})
65
64
  for r in rule_reqs
66
65
  ],
67
66
  **kwargs,
@@ -81,11 +80,11 @@ class Check(AdvancedJudge, Propose):
81
80
  return RuleSet(rules=rules, **ruleset_patch.as_kwargs())
82
81
 
83
82
  async def check_string_against_rule(
84
- self,
85
- input_text: str,
86
- rule: Rule,
87
- reference: str = "",
88
- **kwargs: Unpack[ValidateKwargs[Improvement]],
83
+ self,
84
+ input_text: str,
85
+ rule: Rule,
86
+ reference: str = "",
87
+ **kwargs: Unpack[ValidateKwargs[Improvement]],
89
88
  ) -> Optional[Improvement]:
90
89
  """Validate text against specific rule.
91
90
 
@@ -104,15 +103,15 @@ class Check(AdvancedJudge, Propose):
104
103
  - Proposes Improvement only when violation is confirmed
105
104
  """
106
105
  if judge := await self.evidently_judge(
107
- f"# Content to exam\n{input_text}\n\n# Rule Must to follow\n{rule.display()}\nDoes `Content to exam` provided above violate the `{rule.name}` provided above?"
108
- f"should I take some measure to fix that violation? true for I do need, false for I don't need.",
109
- **override_kwargs(kwargs, default=None),
106
+ f"# Content to exam\n{input_text}\n\n# Rule Must to follow\n{rule.display()}\nDoes `Content to exam` provided above violate the `{rule.name}` provided above?"
107
+ f"should I take some measure to fix that violation? true for I do need, false for I don't need.",
108
+ **override_kwargs(kwargs, default=None),
110
109
  ):
111
110
  logger.info(f"Rule `{rule.name}` violated: \n{judge.display()}")
112
111
  return await self.propose(
113
112
  Improvement,
114
113
  TEMPLATE_MANAGER.render_template(
115
- configs.templates.check_string_template,
114
+ CONFIG.templates.check_string_template,
116
115
  {"to_check": input_text, "rule": rule.display(), "judge": judge.display(), "reference": reference},
117
116
  ),
118
117
  **kwargs,
@@ -120,11 +119,11 @@ class Check(AdvancedJudge, Propose):
120
119
  return None
121
120
 
122
121
  async def check_obj_against_rule[M: (Display, WithBriefing)](
123
- self,
124
- obj: M,
125
- rule: Rule,
126
- reference: str = "",
127
- **kwargs: Unpack[ValidateKwargs[Improvement]],
122
+ self,
123
+ obj: M,
124
+ rule: Rule,
125
+ reference: str = "",
126
+ **kwargs: Unpack[ValidateKwargs[Improvement]],
128
127
  ) -> Optional[Improvement]:
129
128
  """Validate object against rule using text representation.
130
129
 
@@ -152,11 +151,11 @@ class Check(AdvancedJudge, Propose):
152
151
  return await self.check_string_against_rule(input_text, rule, reference, **kwargs)
153
152
 
154
153
  async def check_string(
155
- self,
156
- input_text: str,
157
- ruleset: RuleSet,
158
- reference: str = "",
159
- **kwargs: Unpack[ValidateKwargs[Improvement]],
154
+ self,
155
+ input_text: str,
156
+ ruleset: RuleSet,
157
+ reference: str = "",
158
+ **kwargs: Unpack[ValidateKwargs[Improvement]],
160
159
  ) -> Optional[List[Improvement]]:
161
160
  """Validate text against full ruleset.
162
161
 
@@ -183,11 +182,11 @@ class Check(AdvancedJudge, Propose):
183
182
  return [imp for imp in imp_seq if imp]
184
183
 
185
184
  async def check_obj[M: (Display, WithBriefing)](
186
- self,
187
- obj: M,
188
- ruleset: RuleSet,
189
- reference: str = "",
190
- **kwargs: Unpack[ValidateKwargs[Improvement]],
185
+ self,
186
+ obj: M,
187
+ ruleset: RuleSet,
188
+ reference: str = "",
189
+ **kwargs: Unpack[ValidateKwargs[Improvement]],
191
190
  ) -> Optional[List[Improvement]]:
192
191
  """Validate object against full ruleset.
193
192
 
@@ -1,11 +1,12 @@
1
1
  """A module containing the Correct capability for reviewing, validating, and improving objects."""
2
2
 
3
3
  from asyncio import gather
4
- from typing import Optional, Type, Unpack, cast
4
+ from typing import Optional, Unpack, cast
5
+
6
+ from fabricatio.rust import CONFIG, TEMPLATE_MANAGER
5
7
 
6
8
  from fabricatio.capabilities.propose import Propose
7
9
  from fabricatio.capabilities.rating import Rating
8
- from fabricatio.config import configs
9
10
  from fabricatio.journal import logger
10
11
  from fabricatio.models.adv_kwargs_types import CorrectKwargs
11
12
  from fabricatio.models.extra.problem import Improvement, ProblemSolutions
@@ -14,7 +15,6 @@ from fabricatio.models.kwargs_types import (
14
15
  BestKwargs,
15
16
  ValidateKwargs,
16
17
  )
17
- from fabricatio.rust_instances import TEMPLATE_MANAGER
18
18
  from fabricatio.utils import fallback_kwargs, ok, override_kwargs
19
19
 
20
20
 
@@ -22,7 +22,7 @@ class Correct(Rating, Propose):
22
22
  """A class that provides the capability to correct objects."""
23
23
 
24
24
  async def decide_solution(
25
- self, problem_solutions: ProblemSolutions, **kwargs: Unpack[BestKwargs]
25
+ self, problem_solutions: ProblemSolutions, **kwargs: Unpack[BestKwargs]
26
26
  ) -> ProblemSolutions:
27
27
  """Decide the best solution from a list of problem solutions.
28
28
 
@@ -72,11 +72,11 @@ class Correct(Rating, Propose):
72
72
  return improvement
73
73
 
74
74
  async def fix_troubled_obj[M: SketchedAble](
75
- self,
76
- obj: M,
77
- problem_solutions: ProblemSolutions,
78
- reference: str = "",
79
- **kwargs: Unpack[ValidateKwargs[M]],
75
+ self,
76
+ obj: M,
77
+ problem_solutions: ProblemSolutions,
78
+ reference: str = "",
79
+ **kwargs: Unpack[ValidateKwargs[M]],
80
80
  ) -> Optional[M]:
81
81
  """Fix a troubled object based on problem solutions.
82
82
 
@@ -92,7 +92,7 @@ class Correct(Rating, Propose):
92
92
  return await self.propose(
93
93
  cast("Type[M]", obj.__class__),
94
94
  TEMPLATE_MANAGER.render_template(
95
- configs.templates.fix_troubled_obj_template,
95
+ CONFIG.templates.fix_troubled_obj_template,
96
96
  {
97
97
  "problem": problem_solutions.problem.display(),
98
98
  "solution": ok(
@@ -106,11 +106,11 @@ class Correct(Rating, Propose):
106
106
  )
107
107
 
108
108
  async def fix_troubled_string(
109
- self,
110
- input_text: str,
111
- problem_solutions: ProblemSolutions,
112
- reference: str = "",
113
- **kwargs: Unpack[ValidateKwargs[str]],
109
+ self,
110
+ input_text: str,
111
+ problem_solutions: ProblemSolutions,
112
+ reference: str = "",
113
+ **kwargs: Unpack[ValidateKwargs[str]],
114
114
  ) -> Optional[str]:
115
115
  """Fix a troubled string based on problem solutions.
116
116
 
@@ -125,7 +125,7 @@ class Correct(Rating, Propose):
125
125
  """
126
126
  return await self.ageneric_string(
127
127
  TEMPLATE_MANAGER.render_template(
128
- configs.templates.fix_troubled_string_template,
128
+ CONFIG.templates.fix_troubled_string_template,
129
129
  {
130
130
  "problem": problem_solutions.problem.display(),
131
131
  "solution": ok(
@@ -140,11 +140,11 @@ class Correct(Rating, Propose):
140
140
  )
141
141
 
142
142
  async def correct_obj[M: SketchedAble](
143
- self,
144
- obj: M,
145
- improvement: Improvement,
146
- reference: str = "",
147
- **kwargs: Unpack[ValidateKwargs[M]],
143
+ self,
144
+ obj: M,
145
+ improvement: Improvement,
146
+ reference: str = "",
147
+ **kwargs: Unpack[ValidateKwargs[M]],
148
148
  ) -> Optional[M]:
149
149
  """Review and correct an object based on defined criteria and templates.
150
150
 
@@ -178,7 +178,7 @@ class Correct(Rating, Propose):
178
178
  return obj
179
179
 
180
180
  async def correct_string(
181
- self, input_text: str, improvement: Improvement, reference: str = "", **kwargs: Unpack[ValidateKwargs[str]]
181
+ self, input_text: str, improvement: Improvement, reference: str = "", **kwargs: Unpack[ValidateKwargs[str]]
182
182
  ) -> Optional[str]:
183
183
  """Review and correct a string based on defined criteria and templates.
184
184
 
@@ -210,7 +210,7 @@ class Correct(Rating, Propose):
210
210
  return input_text
211
211
 
212
212
  async def correct_obj_inplace[M: ProposedUpdateAble](
213
- self, obj: M, **kwargs: Unpack[CorrectKwargs[M]]
213
+ self, obj: M, **kwargs: Unpack[CorrectKwargs[M]]
214
214
  ) -> Optional[M]:
215
215
  """Correct an object in place based on defined criteria and templates.
216
216
 
@@ -2,9 +2,10 @@
2
2
 
3
3
  from typing import List, Optional, Type, Unpack, overload
4
4
 
5
+ from fabricatio.rust import CONFIG
6
+
5
7
  from fabricatio import TEMPLATE_MANAGER
6
8
  from fabricatio.capabilities.propose import Propose
7
- from fabricatio.config import configs
8
9
  from fabricatio.models.generic import ProposedAble
9
10
  from fabricatio.models.kwargs_types import ValidateKwargs
10
11
 
@@ -14,54 +15,57 @@ class Extract(Propose):
14
15
 
15
16
  @overload
16
17
  async def extract[M: ProposedAble](
17
- self,
18
- cls: Type[M],
19
- source: str,
20
- extract_requirement: Optional[str] = None,
21
- align_language: bool = True,
22
- **kwargs: Unpack[ValidateKwargs[M]],
18
+ self,
19
+ cls: Type[M],
20
+ source: str,
21
+ extract_requirement: Optional[str] = None,
22
+ align_language: bool = True,
23
+ **kwargs: Unpack[ValidateKwargs[M]],
23
24
  ) -> M: ...
25
+
24
26
  @overload
25
27
  async def extract[M: ProposedAble](
26
- self,
27
- cls: Type[M],
28
- source: str,
29
- extract_requirement: Optional[str] = None,
30
- align_language: bool = True,
31
- **kwargs: Unpack[ValidateKwargs[None]],
28
+ self,
29
+ cls: Type[M],
30
+ source: str,
31
+ extract_requirement: Optional[str] = None,
32
+ align_language: bool = True,
33
+ **kwargs: Unpack[ValidateKwargs[None]],
32
34
  ) -> Optional[M]: ...
33
35
 
34
36
  @overload
35
37
  async def extract[M: ProposedAble](
36
- self,
37
- cls: Type[M],
38
- source: List[str],
39
- extract_requirement: Optional[str] = None,
40
- align_language: bool = True,
41
- **kwargs: Unpack[ValidateKwargs[M]],
38
+ self,
39
+ cls: Type[M],
40
+ source: List[str],
41
+ extract_requirement: Optional[str] = None,
42
+ align_language: bool = True,
43
+ **kwargs: Unpack[ValidateKwargs[M]],
42
44
  ) -> List[M]: ...
45
+
43
46
  @overload
44
47
  async def extract[M: ProposedAble](
45
- self,
46
- cls: Type[M],
47
- source: List[str],
48
- extract_requirement: Optional[str] = None,
49
- align_language: bool = True,
50
- **kwargs: Unpack[ValidateKwargs[None]],
48
+ self,
49
+ cls: Type[M],
50
+ source: List[str],
51
+ extract_requirement: Optional[str] = None,
52
+ align_language: bool = True,
53
+ **kwargs: Unpack[ValidateKwargs[None]],
51
54
  ) -> List[Optional[M]]: ...
55
+
52
56
  async def extract[M: ProposedAble](
53
- self,
54
- cls: Type[M],
55
- source: List[str] | str,
56
- extract_requirement: Optional[str] = None,
57
- align_language: bool = True,
58
- **kwargs: Unpack[ValidateKwargs[Optional[M]]],
57
+ self,
58
+ cls: Type[M],
59
+ source: List[str] | str,
60
+ extract_requirement: Optional[str] = None,
61
+ align_language: bool = True,
62
+ **kwargs: Unpack[ValidateKwargs[Optional[M]]],
59
63
  ) -> M | List[M] | Optional[M] | List[Optional[M]]:
60
64
  """Extract information from a given source to a model."""
61
65
  return await self.propose(
62
66
  cls,
63
67
  prompt=TEMPLATE_MANAGER.render_template(
64
- configs.templates.extract_template,
68
+ CONFIG.templates.extract_template,
65
69
  [{"source": s, "extract_requirement": extract_requirement} for s in source]
66
70
  if isinstance(source, list)
67
71
  else {"source": source, "extract_requirement": extract_requirement, "align_language": align_language},
@@ -10,16 +10,15 @@ from functools import lru_cache
10
10
  from operator import itemgetter
11
11
  from typing import List, Optional, Self, Type, Unpack
12
12
 
13
+ from fabricatio.rust import CONFIG, TEMPLATE_MANAGER
13
14
  from more_itertools.recipes import flatten, unique
14
15
  from pydantic import Field, PrivateAttr
15
16
 
16
- from fabricatio.config import configs
17
17
  from fabricatio.journal import logger
18
18
  from fabricatio.models.adv_kwargs_types import CollectionConfigKwargs, FetchKwargs
19
19
  from fabricatio.models.extra.rag import MilvusDataBase
20
20
  from fabricatio.models.kwargs_types import ChooseKwargs
21
21
  from fabricatio.models.usages import EmbeddingUsage
22
- from fabricatio.rust_instances import TEMPLATE_MANAGER
23
22
  from fabricatio.utils import ok
24
23
 
25
24
 
@@ -50,17 +49,17 @@ class RAG(EmbeddingUsage):
50
49
  return self._client
51
50
 
52
51
  def init_client(
53
- self,
54
- milvus_uri: Optional[str] = None,
55
- milvus_token: Optional[str] = None,
56
- milvus_timeout: Optional[float] = None,
52
+ self,
53
+ milvus_uri: Optional[str] = None,
54
+ milvus_token: Optional[str] = None,
55
+ milvus_timeout: Optional[float] = None,
57
56
  ) -> Self:
58
57
  """Initialize the Milvus client."""
59
58
  self._client = create_client(
60
- uri=milvus_uri or ok(self.milvus_uri or configs.rag.milvus_uri).unicode_string(),
59
+ uri=milvus_uri or ok(self.milvus_uri or CONFIG.rag.milvus_uri).unicode_string(),
61
60
  token=milvus_token
62
- or (token.get_secret_value() if (token := (self.milvus_token or configs.rag.milvus_token)) else ""),
63
- timeout=milvus_timeout or self.milvus_timeout or configs.rag.milvus_timeout,
61
+ or (token.get_secret_value() if (token := (self.milvus_token or CONFIG.rag.milvus_token)) else ""),
62
+ timeout=milvus_timeout or self.milvus_timeout or CONFIG.rag.milvus_timeout,
64
63
  )
65
64
  return self
66
65
 
@@ -73,7 +72,7 @@ class RAG(EmbeddingUsage):
73
72
  return self
74
73
 
75
74
  def view(
76
- self, collection_name: Optional[str], create: bool = False, **kwargs: Unpack[CollectionConfigKwargs]
75
+ self, collection_name: Optional[str], create: bool = False, **kwargs: Unpack[CollectionConfigKwargs]
77
76
  ) -> Self:
78
77
  """View the specified collection.
79
78
 
@@ -86,9 +85,9 @@ class RAG(EmbeddingUsage):
86
85
  kwargs["dimension"] = ok(
87
86
  kwargs.get("dimension")
88
87
  or self.milvus_dimensions
89
- or configs.rag.milvus_dimensions
88
+ or CONFIG.rag.milvus_dimensions
90
89
  or self.embedding_dimensions
91
- or configs.embedding.dimensions,
90
+ or CONFIG.embedding.dimensions,
92
91
  "`dimension` is not set at any level.",
93
92
  )
94
93
  self.client.create_collection(collection_name, auto_id=True, **kwargs)
@@ -115,7 +114,7 @@ class RAG(EmbeddingUsage):
115
114
  return ok(self.target_collection, "No collection is being viewed. Have you called `self.view()`?")
116
115
 
117
116
  async def add_document[D: MilvusDataBase](
118
- self, data: List[D] | D, collection_name: Optional[str] = None, flush: bool = False
117
+ self, data: List[D] | D, collection_name: Optional[str] = None, flush: bool = False
119
118
  ) -> Self:
120
119
  """Adds a document to the specified collection.
121
120
 
@@ -142,15 +141,15 @@ class RAG(EmbeddingUsage):
142
141
  return self
143
142
 
144
143
  async def afetch_document[D: MilvusDataBase](
145
- self,
146
- query: List[str],
147
- document_model: Type[D],
148
- collection_name: Optional[str] = None,
149
- similarity_threshold: float = 0.37,
150
- result_per_query: int = 10,
151
- tei_endpoint: Optional[str] = None,
152
- reranker_threshold: float = 0.7,
153
- filter_expr: str = "",
144
+ self,
145
+ query: List[str],
146
+ document_model: Type[D],
147
+ collection_name: Optional[str] = None,
148
+ similarity_threshold: float = 0.37,
149
+ result_per_query: int = 10,
150
+ tei_endpoint: Optional[str] = None,
151
+ reranker_threshold: float = 0.7,
152
+ filter_expr: str = "",
154
153
  ) -> List[D]:
155
154
  """Asynchronously fetches documents from a Milvus database based on input vectors.
156
155
 
@@ -215,11 +214,11 @@ class RAG(EmbeddingUsage):
215
214
  return document_model.from_sequence(resp)
216
215
 
217
216
  async def aretrieve[D: MilvusDataBase](
218
- self,
219
- query: List[str] | str,
220
- document_model: Type[D],
221
- max_accepted: int = 20,
222
- **kwargs: Unpack[FetchKwargs],
217
+ self,
218
+ query: List[str] | str,
219
+ document_model: Type[D],
220
+ max_accepted: int = 20,
221
+ **kwargs: Unpack[FetchKwargs],
223
222
  ) -> List[D]:
224
223
  """Retrieve data from the collection.
225
224
 
@@ -236,15 +235,15 @@ class RAG(EmbeddingUsage):
236
235
  query = [query]
237
236
 
238
237
  return (
239
- await self.afetch_document(
240
- query=query,
241
- document_model=document_model,
242
- **kwargs,
243
- )
244
- )[:max_accepted]
238
+ await self.afetch_document(
239
+ query=query,
240
+ document_model=document_model,
241
+ **kwargs,
242
+ )
243
+ )[:max_accepted]
245
244
 
246
245
  async def arefined_query(
247
- self, question: List[str] | str, **kwargs: Unpack[ChooseKwargs[Optional[List[str]]]]
246
+ self, question: List[str] | str, **kwargs: Unpack[ChooseKwargs[Optional[List[str]]]]
248
247
  ) -> Optional[List[str]]:
249
248
  """Refines the given question using a template.
250
249
 
@@ -257,7 +256,7 @@ class RAG(EmbeddingUsage):
257
256
  """
258
257
  return await self.alist_str(
259
258
  TEMPLATE_MANAGER.render_template(
260
- configs.templates.refined_query_template,
259
+ CONFIG.templates.refined_query_template,
261
260
  {"question": [question] if isinstance(question, str) else question},
262
261
  ),
263
262
  **kwargs,