Split a string by multiple markers
(content: str, markers: list[str])
| 17 | {"role": roles[i % 2], "content": content} for i, content in enumerate(args) |
| 18 | ] |
| 19 | def split_string_by_multi_markers(content: str, markers: list[str]) -> list[str]: |
| 20 | """Split a string by multiple markers""" |
| 21 | if not markers: |
| 22 | return [content] |
| 23 | results = re.split("|".join(re.escape(marker) for marker in markers), content) |
| 24 | return [r.strip() for r in results if r.strip()] |
| 25 | async def _handle_single_entity_extraction( |
| 26 | record_attributes: list[str], |
| 27 | chunk_key: str, |
no outgoing calls
no test coverage detected