MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / SingleTxtGenerator

Class SingleTxtGenerator

camel/generators.py:285–309  ·  view source on GitHub ↗

r"""Single text generator for role-playing workers. Args: text_file_path (str): The path to the file containing the text data.

Source from the content-addressed store, hash-verified

283
284
285class SingleTxtGenerator:
286 r"""Single text generator for role-playing workers.
287
288 Args:
289 text_file_path (str): The path to the file containing the text data.
290 """
291
292 def __init__(
293 self,
294 text_file_path: str,
295 ) -> None:
296 with open(text_file_path, "r") as f:
297 data_list: List[str] = f.read().splitlines()
298 self.data_list = [
299 " ".join(name.split(" ")[1:]) for name in data_list
300 ]
301
302 def from_role_files(self) -> Generator[str, None, None]:
303 r"""Generate text from the file.
304
305 Returns:
306 Generator[str, None, None]: A generator that yields the text data.
307 """
308 for data in self.data_list:
309 yield data
310
311
312class CodeTaskPromptGenerator:

Callers 1

from_role_filesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected