xia_composer.parser.Parser
- class xia_composer.parser.Parser
Bases:
object- __init__()
Methods
__init__()extract_code(code_type, output_text)extract_list(output_text)extract_output(title, full_text)Extract the related data from full output text
extract_python_encode(output_format, output_text)parse_detailed_type(obj)parse_format(value)parse_output(output_text[, output_type, ...])Extract the related data from output text
strip_explanation(output_text)Stripping the explanation part of output text
- classmethod extract_output(title: str, full_text: str)
Extract the related data from full output text
- Parameters
title – Title used to split output
full_text – Output of GPT Engine
- Returns
Result if format is correct. None if format is not good
- classmethod parse_output(output_text: str, output_type: Optional[str] = None, output_format: Optional[str] = None)
Extract the related data from output text
- Parameters
output_format (str) –
output_type (str) –
output_text – Result of task
- Returns
Result if format is correct. None if format is not good
- classmethod strip_explanation(output_text: str)
Stripping the explanation part of output text
- Parameters
output_text (str) – task output
- Returns
Essential part of task output