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.
- fabricatio/__init__.py +3 -3
- fabricatio/actions/article.py +32 -34
- fabricatio/actions/article_rag.py +89 -69
- fabricatio/actions/output.py +22 -21
- fabricatio/actions/rag.py +4 -3
- fabricatio/capabilities/check.py +29 -30
- fabricatio/capabilities/correct.py +23 -23
- fabricatio/capabilities/extract.py +36 -32
- fabricatio/capabilities/rag.py +34 -35
- fabricatio/capabilities/rating.py +77 -72
- fabricatio/capabilities/review.py +12 -11
- fabricatio/capabilities/task.py +4 -5
- fabricatio/core.py +22 -24
- fabricatio/decorators.py +10 -10
- fabricatio/fs/__init__.py +1 -2
- fabricatio/journal.py +2 -9
- fabricatio/models/action.py +2 -1
- fabricatio/models/extra/aricle_rag.py +10 -9
- fabricatio/models/extra/article_base.py +30 -6
- fabricatio/models/extra/article_main.py +11 -10
- fabricatio/models/extra/article_outline.py +5 -36
- fabricatio/models/generic.py +31 -59
- fabricatio/models/role.py +5 -3
- fabricatio/models/task.py +9 -9
- fabricatio/models/tool.py +5 -4
- fabricatio/models/usages.py +170 -161
- fabricatio/parser.py +2 -2
- fabricatio/rust.cp312-win_amd64.pyd +0 -0
- fabricatio/rust.pyi +496 -14
- fabricatio-0.3.13.data/scripts/tdown.exe +0 -0
- fabricatio-0.3.13.data/scripts/ttm.exe +0 -0
- {fabricatio-0.2.13.dev2.dist-info → fabricatio-0.3.13.dist-info}/METADATA +1 -3
- fabricatio-0.3.13.dist-info/RECORD +63 -0
- fabricatio/config.py +0 -430
- fabricatio/constants.py +0 -20
- fabricatio/models/events.py +0 -120
- fabricatio/rust_instances.py +0 -10
- fabricatio-0.2.13.dev2.data/scripts/tdown.exe +0 -0
- fabricatio-0.2.13.dev2.data/scripts/ttm.exe +0 -0
- fabricatio-0.2.13.dev2.dist-info/RECORD +0 -67
- {fabricatio-0.2.13.dev2.dist-info → fabricatio-0.3.13.dist-info}/WHEEL +0 -0
- {fabricatio-0.2.13.dev2.dist-info → fabricatio-0.3.13.dist-info}/licenses/LICENSE +0 -0
fabricatio/rust.pyi
CHANGED
@@ -10,12 +10,12 @@ Key Features:
|
|
10
10
|
- Cryptographic utilities: BLAKE3 hashing.
|
11
11
|
- Text utilities: Word boundary splitting and word counting.
|
12
12
|
"""
|
13
|
-
|
14
|
-
from
|
15
|
-
from typing import Any, Dict, List, Optional, Tuple, overload
|
13
|
+
from enum import StrEnum
|
14
|
+
from typing import Any, Dict, List, Optional, Self, Tuple, overload, Union
|
16
15
|
|
17
16
|
from pydantic import JsonValue
|
18
17
|
|
18
|
+
|
19
19
|
class TemplateManager:
|
20
20
|
"""Template rendering engine using Handlebars templates.
|
21
21
|
|
@@ -25,17 +25,6 @@ class TemplateManager:
|
|
25
25
|
See: https://crates.io/crates/handlebars
|
26
26
|
"""
|
27
27
|
|
28
|
-
def __init__(
|
29
|
-
self, template_dirs: List[Path], suffix: Optional[str] = None, active_loading: Optional[bool] = None
|
30
|
-
) -> None:
|
31
|
-
"""Initialize the template manager.
|
32
|
-
|
33
|
-
Args:
|
34
|
-
template_dirs: List of directories containing template files
|
35
|
-
suffix: File extension for templates (defaults to 'hbs')
|
36
|
-
active_loading: Whether to enable dev mode for reloading templates on change
|
37
|
-
"""
|
38
|
-
|
39
28
|
@property
|
40
29
|
def template_count(self) -> int:
|
41
30
|
"""Returns the number of currently loaded templates."""
|
@@ -58,8 +47,10 @@ class TemplateManager:
|
|
58
47
|
|
59
48
|
@overload
|
60
49
|
def render_template(self, name: str, data: Dict[str, Any]) -> str: ...
|
50
|
+
|
61
51
|
@overload
|
62
52
|
def render_template(self, name: str, data: List[Dict[str, Any]]) -> List[str]: ...
|
53
|
+
|
63
54
|
def render_template(self, name: str, data: Dict[str, Any] | List[Dict[str, Any]]) -> str | List[str]:
|
64
55
|
"""Render a template with context data.
|
65
56
|
|
@@ -76,8 +67,10 @@ class TemplateManager:
|
|
76
67
|
|
77
68
|
@overload
|
78
69
|
def render_template_raw(self, template: str, data: Dict[str, Any]) -> str: ...
|
70
|
+
|
79
71
|
@overload
|
80
72
|
def render_template_raw(self, template: str, data: List[Dict[str, Any]]) -> List[str]: ...
|
73
|
+
|
81
74
|
def render_template_raw(self, template: str, data: Dict[str, Any] | List[Dict[str, Any]]) -> str | List[str]:
|
82
75
|
"""Render a template with context data.
|
83
76
|
|
@@ -89,6 +82,7 @@ class TemplateManager:
|
|
89
82
|
Rendered template content as string or list of strings
|
90
83
|
"""
|
91
84
|
|
85
|
+
|
92
86
|
class BibManager:
|
93
87
|
"""BibTeX bibliography manager for parsing and querying citation data."""
|
94
88
|
|
@@ -197,6 +191,7 @@ class BibManager:
|
|
197
191
|
Field value if found, None otherwise
|
198
192
|
"""
|
199
193
|
|
194
|
+
|
200
195
|
def blake3_hash(content: bytes) -> str:
|
201
196
|
"""Calculate the BLAKE3 cryptographic hash of data.
|
202
197
|
|
@@ -207,9 +202,11 @@ def blake3_hash(content: bytes) -> str:
|
|
207
202
|
Hex-encoded BLAKE3 hash string
|
208
203
|
"""
|
209
204
|
|
205
|
+
|
210
206
|
def detect_language(string: str) -> str:
|
211
207
|
"""Detect the language of a given string."""
|
212
208
|
|
209
|
+
|
213
210
|
def split_word_bounds(string: str) -> List[str]:
|
214
211
|
"""Split the string into words based on word boundaries.
|
215
212
|
|
@@ -220,6 +217,7 @@ def split_word_bounds(string: str) -> List[str]:
|
|
220
217
|
A list of words extracted from the string.
|
221
218
|
"""
|
222
219
|
|
220
|
+
|
223
221
|
def split_sentence_bounds(string: str) -> List[str]:
|
224
222
|
"""Split the string into sentences based on sentence boundaries.
|
225
223
|
|
@@ -230,6 +228,7 @@ def split_sentence_bounds(string: str) -> List[str]:
|
|
230
228
|
A list of sentences extracted from the string.
|
231
229
|
"""
|
232
230
|
|
231
|
+
|
233
232
|
def split_into_chunks(string: str, max_chunk_size: int, max_overlapping_rate: float = 0.3) -> List[str]:
|
234
233
|
"""Split the string into chunks of a specified size.
|
235
234
|
|
@@ -242,6 +241,7 @@ def split_into_chunks(string: str, max_chunk_size: int, max_overlapping_rate: fl
|
|
242
241
|
A list of chunks extracted from the string.
|
243
242
|
"""
|
244
243
|
|
244
|
+
|
245
245
|
def word_count(string: str) -> int:
|
246
246
|
"""Count the number of words in the string.
|
247
247
|
|
@@ -252,51 +252,67 @@ def word_count(string: str) -> int:
|
|
252
252
|
The number of words in the string.
|
253
253
|
"""
|
254
254
|
|
255
|
+
|
255
256
|
def is_chinese(string: str) -> bool:
|
256
257
|
"""Check if the given string is in Chinese."""
|
257
258
|
|
259
|
+
|
258
260
|
def is_english(string: str) -> bool:
|
259
261
|
"""Check if the given string is in English."""
|
260
262
|
|
263
|
+
|
261
264
|
def is_japanese(string: str) -> bool:
|
262
265
|
"""Check if the given string is in Japanese."""
|
263
266
|
|
267
|
+
|
264
268
|
def is_korean(string: str) -> bool:
|
265
269
|
"""Check if the given string is in Korean."""
|
266
270
|
|
271
|
+
|
267
272
|
def is_arabic(string: str) -> bool:
|
268
273
|
"""Check if the given string is in Arabic."""
|
269
274
|
|
275
|
+
|
270
276
|
def is_russian(string: str) -> bool:
|
271
277
|
"""Check if the given string is in Russian."""
|
272
278
|
|
279
|
+
|
273
280
|
def is_german(string: str) -> bool:
|
274
281
|
"""Check if the given string is in German."""
|
275
282
|
|
283
|
+
|
276
284
|
def is_french(string: str) -> bool:
|
277
285
|
"""Check if the given string is in French."""
|
278
286
|
|
287
|
+
|
279
288
|
def is_hindi(string: str) -> bool:
|
280
289
|
"""Check if the given string is in Hindi."""
|
281
290
|
|
291
|
+
|
282
292
|
def is_italian(string: str) -> bool:
|
283
293
|
"""Check if the given string is in Italian."""
|
284
294
|
|
295
|
+
|
285
296
|
def is_dutch(string: str) -> bool:
|
286
297
|
"""Check if the given string is in Dutch."""
|
287
298
|
|
299
|
+
|
288
300
|
def is_portuguese(string: str) -> bool:
|
289
301
|
"""Check if the given string is in Portuguese."""
|
290
302
|
|
303
|
+
|
291
304
|
def is_swedish(string: str) -> bool:
|
292
305
|
"""Check if the given string is in Swedish."""
|
293
306
|
|
307
|
+
|
294
308
|
def is_turkish(string: str) -> bool:
|
295
309
|
"""Check if the given string is in Turkish."""
|
296
310
|
|
311
|
+
|
297
312
|
def is_vietnamese(string: str) -> bool:
|
298
313
|
"""Check if the given string is in Vietnamese."""
|
299
314
|
|
315
|
+
|
300
316
|
def tex_to_typst(string: str) -> str:
|
301
317
|
"""Convert TeX to Typst.
|
302
318
|
|
@@ -307,6 +323,7 @@ def tex_to_typst(string: str) -> str:
|
|
307
323
|
The converted Typst string.
|
308
324
|
"""
|
309
325
|
|
326
|
+
|
310
327
|
def convert_all_inline_tex(string: str) -> str:
|
311
328
|
"""Convert all inline TeX code in the string.
|
312
329
|
|
@@ -317,6 +334,7 @@ def convert_all_inline_tex(string: str) -> str:
|
|
317
334
|
The converted string with inline TeX code replaced.
|
318
335
|
"""
|
319
336
|
|
337
|
+
|
320
338
|
def convert_all_block_tex(string: str) -> str:
|
321
339
|
"""Convert all block TeX code in the string.
|
322
340
|
|
@@ -327,6 +345,7 @@ def convert_all_block_tex(string: str) -> str:
|
|
327
345
|
The converted string with block TeX code replaced.
|
328
346
|
"""
|
329
347
|
|
348
|
+
|
330
349
|
def fix_misplaced_labels(string: str) -> str:
|
331
350
|
"""A func to fix labels in a string.
|
332
351
|
|
@@ -337,6 +356,7 @@ def fix_misplaced_labels(string: str) -> str:
|
|
337
356
|
The fixed string with labels properly placed.
|
338
357
|
"""
|
339
358
|
|
359
|
+
|
340
360
|
def comment(string: str) -> str:
|
341
361
|
"""Add comment to the string.
|
342
362
|
|
@@ -347,6 +367,7 @@ def comment(string: str) -> str:
|
|
347
367
|
The string with each line prefixed by '// '.
|
348
368
|
"""
|
349
369
|
|
370
|
+
|
350
371
|
def uncomment(string: str) -> str:
|
351
372
|
"""Remove comment from the string.
|
352
373
|
|
@@ -357,6 +378,7 @@ def uncomment(string: str) -> str:
|
|
357
378
|
The string with comments (lines starting with '// ' or '//') removed.
|
358
379
|
"""
|
359
380
|
|
381
|
+
|
360
382
|
def split_out_metadata(string: str) -> Tuple[Optional[JsonValue], str]:
|
361
383
|
"""Split out metadata from a string.
|
362
384
|
|
@@ -367,6 +389,7 @@ def split_out_metadata(string: str) -> Tuple[Optional[JsonValue], str]:
|
|
367
389
|
A tuple containing the metadata as a Python object (if parseable) and the remaining string.
|
368
390
|
"""
|
369
391
|
|
392
|
+
|
370
393
|
def to_metadata(data: JsonValue) -> str:
|
371
394
|
"""Convert a Python object to a YAML string.
|
372
395
|
|
@@ -377,8 +400,467 @@ def to_metadata(data: JsonValue) -> str:
|
|
377
400
|
The YAML string representation of the input data.
|
378
401
|
"""
|
379
402
|
|
403
|
+
|
380
404
|
def convert_to_inline_formula(string: str) -> str:
|
381
405
|
r"""Convert `$...$` to inline formula `\(...\)` and trim spaces."""
|
382
406
|
|
407
|
+
|
383
408
|
def convert_to_block_formula(string: str) -> str:
|
384
409
|
r"""Convert `$$...$$` to block formula `\[...\]` and trim spaces."""
|
410
|
+
|
411
|
+
|
412
|
+
def inplace_update(string: str, wrapper: str, new_body: str) -> Optional[str]:
|
413
|
+
"""Replace content between wrapper strings.
|
414
|
+
|
415
|
+
Args:
|
416
|
+
string: The input string containing content wrapped by delimiter strings.
|
417
|
+
wrapper: The delimiter string that marks the beginning and end of the content to replace.
|
418
|
+
new_body: The new content to place between the wrapper strings.
|
419
|
+
|
420
|
+
Returns:
|
421
|
+
A new string with the content between wrappers replaced.
|
422
|
+
|
423
|
+
"""
|
424
|
+
|
425
|
+
|
426
|
+
def extract_body(string: str, wrapper: str) -> Optional[str]:
|
427
|
+
"""Extract the content between two occurrences of a wrapper string.
|
428
|
+
|
429
|
+
Args:
|
430
|
+
string: The input string containing content wrapped by delimiter strings.
|
431
|
+
wrapper: The delimiter string that marks the beginning and end of the content to extract.
|
432
|
+
|
433
|
+
Returns:
|
434
|
+
The content between the first two occurrences of the wrapper string if found, otherwise None.
|
435
|
+
"""
|
436
|
+
|
437
|
+
|
438
|
+
class LLMConfig:
|
439
|
+
"""LLM configuration structure.
|
440
|
+
|
441
|
+
Contains parameters for configuring Language Learning Models.
|
442
|
+
"""
|
443
|
+
|
444
|
+
api_endpoint: Optional[str]
|
445
|
+
"""API endpoint URL for the LLM service."""
|
446
|
+
|
447
|
+
api_key: Optional[SecretStr]
|
448
|
+
"""Authentication key for the LLM service."""
|
449
|
+
|
450
|
+
timeout: Optional[int]
|
451
|
+
"""Maximum time in seconds to wait for a response."""
|
452
|
+
|
453
|
+
max_retries: Optional[int]
|
454
|
+
"""Number of retry attempts for failed requests."""
|
455
|
+
|
456
|
+
model: Optional[str]
|
457
|
+
"""Name of the LLM model to use."""
|
458
|
+
|
459
|
+
temperature: Optional[float]
|
460
|
+
"""Controls randomness in response generation (0.0-2.0)."""
|
461
|
+
|
462
|
+
stop_sign: Optional[List[str]]
|
463
|
+
"""Sequence(s) that signal the LLM to stop generating tokens."""
|
464
|
+
|
465
|
+
top_p: Optional[float]
|
466
|
+
"""Controls diversity via nucleus sampling (0.0-1.0)."""
|
467
|
+
|
468
|
+
generation_count: Optional[int]
|
469
|
+
"""Number of completions to generate for each prompt."""
|
470
|
+
|
471
|
+
stream: Optional[bool]
|
472
|
+
"""When true, responses are streamed as they're generated."""
|
473
|
+
|
474
|
+
max_tokens: Optional[int]
|
475
|
+
"""Maximum number of tokens to generate in the response."""
|
476
|
+
|
477
|
+
rpm: Optional[int]
|
478
|
+
"""Rate limit in requests per minute."""
|
479
|
+
|
480
|
+
tpm: Optional[int]
|
481
|
+
"""Rate limit in tokens per minute."""
|
482
|
+
|
483
|
+
presence_penalty: Optional[float]
|
484
|
+
"""Penalizes new tokens based on their presence in text so far (-2.0-2.0)."""
|
485
|
+
|
486
|
+
frequency_penalty: Optional[float]
|
487
|
+
"""Penalizes new tokens based on their frequency in text so far (-2.0-2.0)."""
|
488
|
+
|
489
|
+
|
490
|
+
class EmbeddingConfig:
|
491
|
+
"""Embedding configuration structure."""
|
492
|
+
|
493
|
+
model: Optional[str]
|
494
|
+
"""The embedding model name."""
|
495
|
+
|
496
|
+
dimensions: Optional[int]
|
497
|
+
"""The dimensions of the embedding."""
|
498
|
+
|
499
|
+
timeout: Optional[int]
|
500
|
+
"""The timeout of the embedding model in seconds."""
|
501
|
+
|
502
|
+
max_sequence_length: Optional[int]
|
503
|
+
"""The maximum sequence length of the embedding model."""
|
504
|
+
|
505
|
+
caching: Optional[bool]
|
506
|
+
"""Whether to cache the embedding."""
|
507
|
+
|
508
|
+
api_endpoint: Optional[str]
|
509
|
+
"""The API endpoint URL."""
|
510
|
+
|
511
|
+
api_key: Optional[SecretStr]
|
512
|
+
"""The API key."""
|
513
|
+
|
514
|
+
|
515
|
+
class RagConfig:
|
516
|
+
"""RAG (Retrieval Augmented Generation) configuration structure."""
|
517
|
+
|
518
|
+
milvus_uri: Optional[str]
|
519
|
+
"""The URI of the Milvus server."""
|
520
|
+
|
521
|
+
milvus_timeout: Optional[float]
|
522
|
+
"""The timeout of the Milvus server in seconds."""
|
523
|
+
|
524
|
+
milvus_token: Optional[SecretStr]
|
525
|
+
"""The token for Milvus authentication."""
|
526
|
+
|
527
|
+
milvus_dimensions: Optional[int]
|
528
|
+
"""The dimensions for Milvus vectors."""
|
529
|
+
|
530
|
+
|
531
|
+
class DebugConfig:
|
532
|
+
"""Debug configuration structure."""
|
533
|
+
|
534
|
+
log_level: Optional[str]
|
535
|
+
"""The logging level to use."""
|
536
|
+
|
537
|
+
|
538
|
+
class TemplateManagerConfig:
|
539
|
+
"""Template manager configuration structure."""
|
540
|
+
|
541
|
+
template_dir: List[str]
|
542
|
+
"""The directories containing the templates."""
|
543
|
+
|
544
|
+
active_loading: Optional[bool]
|
545
|
+
"""Whether to enable active loading of templates."""
|
546
|
+
|
547
|
+
template_suffix: Optional[str]
|
548
|
+
"""The suffix of the templates."""
|
549
|
+
|
550
|
+
|
551
|
+
class TemplateConfig:
|
552
|
+
"""Template configuration structure."""
|
553
|
+
|
554
|
+
create_json_obj_template: str
|
555
|
+
"""The name of the create json object template which will be used to create a json object."""
|
556
|
+
|
557
|
+
draft_tool_usage_code_template: str
|
558
|
+
"""The name of the draft tool usage code template which will be used to draft tool usage code."""
|
559
|
+
|
560
|
+
make_choice_template: str
|
561
|
+
"""The name of the make choice template which will be used to make a choice."""
|
562
|
+
|
563
|
+
make_judgment_template: str
|
564
|
+
"""The name of the make judgment template which will be used to make a judgment."""
|
565
|
+
|
566
|
+
dependencies_template: str
|
567
|
+
"""The name of the dependencies template which will be used to manage dependencies."""
|
568
|
+
|
569
|
+
task_briefing_template: str
|
570
|
+
"""The name of the task briefing template which will be used to brief a task."""
|
571
|
+
|
572
|
+
rate_fine_grind_template: str
|
573
|
+
"""The name of the rate fine grind template which will be used to rate fine grind."""
|
574
|
+
|
575
|
+
draft_rating_manual_template: str
|
576
|
+
"""The name of the draft rating manual template which will be used to draft rating manual."""
|
577
|
+
|
578
|
+
draft_rating_criteria_template: str
|
579
|
+
"""The name of the draft rating criteria template which will be used to draft rating criteria."""
|
580
|
+
|
581
|
+
extract_reasons_from_examples_template: str
|
582
|
+
"""The name of the extract reasons from examples template which will be used to extract reasons from examples."""
|
583
|
+
|
584
|
+
extract_criteria_from_reasons_template: str
|
585
|
+
"""The name of the extract criteria from reasons template which will be used to extract criteria from reasons."""
|
586
|
+
|
587
|
+
draft_rating_weights_klee_template: str
|
588
|
+
"""The name of the draft rating weights klee template which will be used to draft rating weights with Klee method."""
|
589
|
+
|
590
|
+
retrieved_display_template: str
|
591
|
+
"""The name of the retrieved display template which will be used to display retrieved documents."""
|
592
|
+
|
593
|
+
liststr_template: str
|
594
|
+
"""The name of the liststr template which will be used to display a list of strings."""
|
595
|
+
|
596
|
+
refined_query_template: str
|
597
|
+
"""The name of the refined query template which will be used to refine a query."""
|
598
|
+
|
599
|
+
pathstr_template: str
|
600
|
+
"""The name of the pathstr template which will be used to acquire a path of strings."""
|
601
|
+
|
602
|
+
review_string_template: str
|
603
|
+
"""The name of the review string template which will be used to review a string."""
|
604
|
+
|
605
|
+
generic_string_template: str
|
606
|
+
"""The name of the generic string template which will be used to review a string."""
|
607
|
+
|
608
|
+
co_validation_template: str
|
609
|
+
"""The name of the co-validation template which will be used to co-validate a string."""
|
610
|
+
|
611
|
+
as_prompt_template: str
|
612
|
+
"""The name of the as prompt template which will be used to convert a string to a prompt."""
|
613
|
+
|
614
|
+
check_string_template: str
|
615
|
+
"""The name of the check string template which will be used to check a string."""
|
616
|
+
|
617
|
+
ruleset_requirement_breakdown_template: str
|
618
|
+
"""The name of the ruleset requirement breakdown template which will be used to breakdown a ruleset requirement."""
|
619
|
+
|
620
|
+
fix_troubled_obj_template: str
|
621
|
+
"""The name of the fix troubled object template which will be used to fix a troubled object."""
|
622
|
+
|
623
|
+
fix_troubled_string_template: str
|
624
|
+
"""The name of the fix troubled string template which will be used to fix a troubled string."""
|
625
|
+
|
626
|
+
rule_requirement_template: str
|
627
|
+
"""The name of the rule requirement template which will be used to generate a rule requirement."""
|
628
|
+
|
629
|
+
extract_template: str
|
630
|
+
"""The name of the extract template which will be used to extract model from string."""
|
631
|
+
|
632
|
+
chap_summary_template: str
|
633
|
+
"""The name of the chap summary template which will be used to generate a chapter summary."""
|
634
|
+
|
635
|
+
|
636
|
+
class RoutingConfig:
|
637
|
+
"""Routing configuration structure for controlling request dispatching behavior."""
|
638
|
+
|
639
|
+
max_parallel_requests: Optional[int]
|
640
|
+
"""The maximum number of parallel requests. None means not checked."""
|
641
|
+
|
642
|
+
allowed_fails: Optional[int]
|
643
|
+
"""The number of allowed fails before the routing is considered failed."""
|
644
|
+
|
645
|
+
retry_after: int
|
646
|
+
"""Minimum time to wait before retrying a failed request."""
|
647
|
+
|
648
|
+
cooldown_time: Optional[int]
|
649
|
+
"""Time to cooldown a deployment after failure in seconds."""
|
650
|
+
|
651
|
+
|
652
|
+
class GeneralConfig:
|
653
|
+
"""General configuration structure for application-wide settings."""
|
654
|
+
|
655
|
+
confirm_on_ops: bool
|
656
|
+
"""Whether to confirm operations before executing them."""
|
657
|
+
|
658
|
+
use_json_repair: bool
|
659
|
+
"""Whether to automatically repair malformed JSON."""
|
660
|
+
|
661
|
+
|
662
|
+
class ToolBoxConfig:
|
663
|
+
"""Configuration for toolbox functionality."""
|
664
|
+
|
665
|
+
tool_module_name: str
|
666
|
+
"""The name of the module containing the toolbox."""
|
667
|
+
|
668
|
+
data_module_name: str
|
669
|
+
"""The name of the module containing the data."""
|
670
|
+
|
671
|
+
|
672
|
+
class PymitterConfig:
|
673
|
+
"""Pymitter configuration structure for controlling event emission and listener behavior."""
|
674
|
+
|
675
|
+
delimiter: str
|
676
|
+
"""The delimiter used to separate the event name into segments."""
|
677
|
+
|
678
|
+
new_listener_event: bool
|
679
|
+
"""If set, a newListener event is emitted when a new listener is added."""
|
680
|
+
|
681
|
+
max_listeners: int
|
682
|
+
"""The maximum number of listeners per event. -1 means unlimited."""
|
683
|
+
|
684
|
+
|
685
|
+
class Config:
|
686
|
+
"""Configuration structure containing all system components."""
|
687
|
+
|
688
|
+
embedding: EmbeddingConfig
|
689
|
+
"""Embedding configuration."""
|
690
|
+
|
691
|
+
llm: LLMConfig
|
692
|
+
"""LLM configuration."""
|
693
|
+
|
694
|
+
debug: DebugConfig
|
695
|
+
"""Debug configuration."""
|
696
|
+
|
697
|
+
rag: RagConfig
|
698
|
+
"""RAG configuration."""
|
699
|
+
|
700
|
+
templates: TemplateConfig
|
701
|
+
"""Template configuration."""
|
702
|
+
|
703
|
+
template_manager: TemplateManagerConfig
|
704
|
+
"""Template manager configuration."""
|
705
|
+
|
706
|
+
routing: RoutingConfig
|
707
|
+
"""Routing configuration."""
|
708
|
+
|
709
|
+
general: GeneralConfig
|
710
|
+
"""General configuration."""
|
711
|
+
|
712
|
+
toolbox: ToolBoxConfig
|
713
|
+
"""Toolbox configuration."""
|
714
|
+
|
715
|
+
pymitter: PymitterConfig
|
716
|
+
"""Pymitter configuration."""
|
717
|
+
|
718
|
+
|
719
|
+
CONFIG: Config
|
720
|
+
|
721
|
+
|
722
|
+
class SecretStr:
|
723
|
+
"""A string that should not be exposed."""
|
724
|
+
|
725
|
+
def __init__(self, source: str) -> None: ...
|
726
|
+
|
727
|
+
def expose(self) -> str:
|
728
|
+
"""Expose the secret string."""
|
729
|
+
|
730
|
+
|
731
|
+
TEMPLATE_MANAGER: TemplateManager
|
732
|
+
|
733
|
+
|
734
|
+
class Event:
|
735
|
+
"""Event class that represents a hierarchical event with segments.
|
736
|
+
|
737
|
+
Events can be constructed from strings, lists of strings, or other Events.
|
738
|
+
"""
|
739
|
+
segments: List[str]
|
740
|
+
|
741
|
+
def __init__(self, segments: Optional[List[str]] = None) -> None:
|
742
|
+
"""Initialize a new Event with optional segments.
|
743
|
+
|
744
|
+
Args:
|
745
|
+
segments: Optional list of string segments
|
746
|
+
"""
|
747
|
+
|
748
|
+
@staticmethod
|
749
|
+
def instantiate_from(event: Union[str, Event, List[str]]) -> Event:
|
750
|
+
"""Create an Event from a string, list of strings, or another Event.
|
751
|
+
|
752
|
+
Args:
|
753
|
+
event: The source to create the Event from
|
754
|
+
|
755
|
+
Returns:
|
756
|
+
A new Event instance
|
757
|
+
|
758
|
+
Raises:
|
759
|
+
ValueError: If list elements are not strings
|
760
|
+
TypeError: If event is an invalid type
|
761
|
+
"""
|
762
|
+
|
763
|
+
@staticmethod
|
764
|
+
def quick_instantiate(event: Union[str, Event, List[str]]) -> Event:
|
765
|
+
"""Create an Event and append wildcard and pending status.
|
766
|
+
|
767
|
+
Args:
|
768
|
+
event: The source to create the Event from
|
769
|
+
|
770
|
+
Returns:
|
771
|
+
A new Event instance with wildcard and pending status appended
|
772
|
+
"""
|
773
|
+
|
774
|
+
def derive(self, event: Union[str, Event, List[str]]) -> Event:
|
775
|
+
"""Create a new Event by extending this one with another.
|
776
|
+
|
777
|
+
Args:
|
778
|
+
event: The Event to append
|
779
|
+
|
780
|
+
Returns:
|
781
|
+
A new Event that combines this Event with the provided one
|
782
|
+
"""
|
783
|
+
|
784
|
+
def collapse(self) -> str:
|
785
|
+
"""Convert the Event to a delimited string.
|
786
|
+
|
787
|
+
Returns:
|
788
|
+
String representation with segments joined by delimiter
|
789
|
+
"""
|
790
|
+
|
791
|
+
def fork(self) -> Event:
|
792
|
+
"""Create a copy of this Event.
|
793
|
+
|
794
|
+
Returns:
|
795
|
+
A new Event with the same segments
|
796
|
+
"""
|
797
|
+
|
798
|
+
def push(self, segment: str) -> Self:
|
799
|
+
"""Add a segment to the Event.
|
800
|
+
|
801
|
+
Args:
|
802
|
+
segment: String segment to add
|
803
|
+
|
804
|
+
Raises:
|
805
|
+
ValueError: If segment is empty or contains the delimiter
|
806
|
+
"""
|
807
|
+
|
808
|
+
def push_wildcard(self) -> Self:
|
809
|
+
"""Add a wildcard segment (*) to the Event."""
|
810
|
+
|
811
|
+
def push_pending(self) -> Self:
|
812
|
+
"""Add a pending status segment to the Event."""
|
813
|
+
|
814
|
+
def push_running(self) -> Self:
|
815
|
+
"""Add a running status segment to the Event."""
|
816
|
+
|
817
|
+
def push_finished(self) -> Self:
|
818
|
+
"""Add a finished status segment to the Event."""
|
819
|
+
|
820
|
+
def push_failed(self) -> Self:
|
821
|
+
"""Add a failed status segment to the Event."""
|
822
|
+
|
823
|
+
def push_cancelled(self) -> Self:
|
824
|
+
"""Add a cancelled status segment to the Event."""
|
825
|
+
|
826
|
+
def pop(self) -> Optional[str]:
|
827
|
+
"""Remove and return the last segment.
|
828
|
+
|
829
|
+
Returns:
|
830
|
+
The removed segment or None if the Event is empty
|
831
|
+
"""
|
832
|
+
|
833
|
+
def clear(self) -> Self:
|
834
|
+
"""Remove all segments from the Event."""
|
835
|
+
|
836
|
+
def concat(self, event: Union[str, Event, List[str]]) -> Self:
|
837
|
+
"""Append segments from another Event to this one.
|
838
|
+
|
839
|
+
Args:
|
840
|
+
event: The Event to append segments from
|
841
|
+
"""
|
842
|
+
|
843
|
+
def __hash__(self) -> int: ...
|
844
|
+
|
845
|
+
def __eq__(self, other: object) -> bool: ...
|
846
|
+
|
847
|
+
def __ne__(self, other: object) -> bool: ...
|
848
|
+
|
849
|
+
|
850
|
+
class TaskStatus(StrEnum, str):
|
851
|
+
"""Enumeration of possible task statuses."""
|
852
|
+
|
853
|
+
Pending: TaskStatus
|
854
|
+
"""Task is pending execution."""
|
855
|
+
|
856
|
+
Running: TaskStatus
|
857
|
+
"""Task is currently running."""
|
858
|
+
|
859
|
+
Finished: TaskStatus
|
860
|
+
"""Task has finished successfully."""
|
861
|
+
|
862
|
+
Failed: TaskStatus
|
863
|
+
"""Task has failed."""
|
864
|
+
|
865
|
+
Cancelled: TaskStatus
|
866
|
+
"""Task has been cancelled."""
|
Binary file
|
Binary file
|