MCPcopy Create free account
hub / github.com/OpenBMB/ChatDev / RegexSplitConfig

Class RegexSplitConfig

entity/configs/dynamic_base.py:69–185  ·  view source on GitHub ↗

Configuration for regex-based splitting. Split content by regex pattern matches. Each match becomes one execution unit. Attributes: pattern: Python regular expression used to split content. group: Capture group name or index. Defaults to the entire match (group 0).

Source from the content-addressed store, hash-verified

67
68@dataclass
69class RegexSplitConfig(SplitTypeConfig):
70 """Configuration for regex-based splitting.
71
72 Split content by regex pattern matches. Each match becomes one execution unit.
73
74 Attributes:
75 pattern: Python regular expression used to split content.
76 group: Capture group name or index. Defaults to the entire match (group 0).
77 case_sensitive: Whether the regex should be case sensitive.
78 multiline: Enable multiline mode (re.MULTILINE).
79 dotall: Enable dotall mode (re.DOTALL).
80 on_no_match: Behavior when no match is found.
81 """
82
83 pattern: str = ""
84 group: str | int | None = None
85 case_sensitive: bool = True
86 multiline: bool = False
87 dotall: bool = False
88 on_no_match: str = "pass"
89
90 FIELD_SPECS = {
91 "pattern": ConfigFieldSpec(
92 name="pattern",
93 display_name="Regex Pattern",
94 type_hint="str",
95 required=True,
96 description="Python regular expression used to split content.",
97 ),
98 "group": ConfigFieldSpec(
99 name="group",
100 display_name="Capture Group",
101 type_hint="str",
102 required=False,
103 description="Capture group name or index. Defaults to the entire match (group 0).",
104 ),
105 "case_sensitive": ConfigFieldSpec(
106 name="case_sensitive",
107 display_name="Case Sensitive",
108 type_hint="bool",
109 required=False,
110 default=True,
111 description="Whether the regex should be case sensitive.",
112 ),
113 "multiline": ConfigFieldSpec(
114 name="multiline",
115 display_name="Multiline Flag",
116 type_hint="bool",
117 required=False,
118 default=False,
119 description="Enable multiline mode (re.MULTILINE).",
120 advance=True,
121 ),
122 "dotall": ConfigFieldSpec(
123 name="dotall",
124 display_name="Dotall Flag",
125 type_hint="bool",
126 required=False,

Callers

nothing calls this directly

Calls 2

ConfigFieldSpecClass · 0.90
enum_options_from_valuesFunction · 0.90

Tested by

no test coverage detected