memoryscope.core.utils.response_text_parser

class memoryscope.core.utils.response_text_parser.ResponseTextParser(response_text: str, language: LanguageEnum, logger_prefix: str = '')[源代码]

基类:object

The ResponseTextParser class is designed to parse and process response texts. It provides methods to extract patterns from the text and filter out unnecessary information, while also logging the processing steps and outcomes.

PATTERN_V1 = re.compile('<(.*?)>')
__init__(response_text: str, language: LanguageEnum, logger_prefix: str = '')[源代码]
response_text: str
language: LanguageEnum
logger_prefix: str
logger: Logger
parse_v1() List[List[str]][源代码]

Extract specific patterns from the text which match content within angle brackets.

返回:

Contents match the specific patterns.

parse_v2() List[str][源代码]

Extract lines which contain NONE_WORD.

返回:

Contents match the specific patterns.